- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have made a "hello world" project using Quartus lite23.1, RiscFree 24.3 on a Cyclone IV.
The initial project works OK, but if i do an edit to the c soure file (hello world), the newly compiled elf-file is not downloaded to the Nios V, it runs the old version of the program.
I have verified that the .elf file in the build/Default folder is updated, so it has been recompiled..
Using niosv-download from niosv-shell works, then the new .elf is downloaded, but recompile and run from riskFree does not work.
Any suggestions?
Eivind
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank You for Your reply.
Things has made a weird turn to the better..
I tried to recreate the situation before I did the edits in bsp_editor I mentioned in my previous post.
I started bsp_editor, opened the settings.bsp-file, checked enable_alt_load and enable_alt_load_copy_rwdata and generated bsp_settings again.
However, I did not get back to my previous situation. I was still in a situation where a reset would freeze the niosV, only a new run from RiscFree would get it running again.
To get out of this situation, I tried to generate a new bsp rather than editing the old one.
Voila:, everything works. If I edit the hello.c file, the newest version runs on then NIOS.
I think I am now in the situation where the old proverb "If it aint broken, dont fix it" applies.
We can consider this case closed.
Unfortunately, when I regenerated the new setting.bsp the old one was overwritten, and it it thus not possible to compare working and non-working versions.
Thank You again for Your help.
Best regards
Eivind
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
When running downloading the elf in RiscFree did you by chance selected the old elf file in the configuration settings below:
Regards
Jingyang, Teh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply.
There is only one .elf file in the system, the old one is overwritten during compile. I have verified that the .elf-file on the PC is in fact the newest version.
It makes no difference whether I have selected "use project binary" or "use file" and link to the correct file. Somehow then new .elf seems to not download to the FPGA.
Regards
Eivind
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Is there any error when you are trying to download the new elf file?
Did you select the reset signal after download option?
What kind of boot method the Nios is using?
Regards
Jingyang, Teh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Do you have any update on this case?
Did you manage to flash the new elf that you created?
Regards
Jingyang, Teh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your reply.
I have not had any progress lately.
1. I do not get any error messages when downloading new elf-file from riscFree. I have not been able to find any error message in any .log-file. It just does not give the NIOS the latest elf. Using niosv-download from niosv-shell works perfectly.
2. I do not know how to select reset signal after download option. I do not get an automatic reset after download, I need to do a reset from hardware (Push-button) to make the program on Nios to start running again. This applies whether I try to download from riscFree or using niosv_download. I have tried adding the -r option to niosv-download without sucess.
3. I do not know what boot method the nios is using? How do I tell and where do I change it?
Best regards
Eivind
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Update:
! have solved the problem with restart og program after download to NiosV:
I need to select "Resume" in startup in run configuration, or use niosv-download with the -g option.
The main problem, getting riscFree to download updated .elf file remain unsolved.
Regards
Eivind
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
For the Nios V boot method, you could check the BSP setting of your project.
The niosv-download will only load the elf file into the memory.
If you are using a volatile boot method such as booting from Flash, that could explain why after reboot the old elf is reloaded into the memory.
Regards
JIngyang, Teh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank You for Your reply.
I run the project om a DE2-115 evaluation board with Cyclone IVE. There is no flash memory so I assume I boot from OCRAM.
In Nios® V Embedded Processor Design Handbook I find:
Nios® V processor application execute in-place from On-chip Memory (OCRAM) | OCRAM | OCRAM | Enable allow_code_at_reset in Advanced.hal.linker and uncheck other settings. | Make sure all Linker Sections are set to OCRAM. |
I checked Advanced.hal.linker in bsp-editor. In my system allow_code_at_reset was checked, but also enable_alt_load and enable_alt_load_copy_rwdata.
I unchecked enable_alt_load and enable_alt_load_copy_rwdata and generated bsp_settings again.
When I build the software project I now sometimes, but not always, get this waring:
warning: hallo.elf has a LOAD segment with RWX permissions
If i get this warning, the program will not run at all. Pressing reset button has no effect.
However, if I do not get this waring during compile, the program is running latest version of the .elf-file.
The drawback is that a reset from reset button makes the app stop executing, it will not restart, not even after repeated press to reset button. To get the program running again I need to do a "run" from RiscFree software.
Best regards
Eivind
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
This could be a linker issue.
Could you share us your linker file and bsp setting files?
Just to confirm you are using the riscv32 compile to compile the elf right( riscv32-unknown-elf-gcc) ?
Regards
Jingyang, Teh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank You for Your reply.
Things has made a weird turn to the better..
I tried to recreate the situation before I did the edits in bsp_editor I mentioned in my previous post.
I started bsp_editor, opened the settings.bsp-file, checked enable_alt_load and enable_alt_load_copy_rwdata and generated bsp_settings again.
However, I did not get back to my previous situation. I was still in a situation where a reset would freeze the niosV, only a new run from RiscFree would get it running again.
To get out of this situation, I tried to generate a new bsp rather than editing the old one.
Voila:, everything works. If I edit the hello.c file, the newest version runs on then NIOS.
I think I am now in the situation where the old proverb "If it aint broken, dont fix it" applies.
We can consider this case closed.
Unfortunately, when I regenerated the new setting.bsp the old one was overwritten, and it it thus not possible to compare working and non-working versions.
Thank You again for Your help.
Best regards
Eivind
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I’m glad that your question has been addressed, I will now transition this thread to community support. If you have a new question, Please login to ‘https://supporttickets.intel.com/s/?language=en_US’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.
Regards
Jingyang, Teh

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page