Forum Discussion
NiosII booting from on-chip memory SPI issue
- 2 years ago
Hi all,
Just an update to this issue.
The problem has been resolved by disabling the alt_printf statement in my C code. My .pof works now, and it can send the spi commands after power cycling the board.
My guess is that as there is no communication between the board and the nios2 terminal, the alt_printf pointer got lost when executing the function. Hence when loading .pof, all alt_printf must be disabled.
Regards,
Reuben Goh
Hi,
It appears that the ELF file is functioning correctly, but there is an issue with the HEX file. We suspect the error might be due to one of the following:
• The file being stored in the wrong RAM location.
• Incorrect arguments passed to Elf2hex.
• Function user mem_init generated wrong HEX file.
Software abnormalities due to ELF2HEX are rare, and any references are scarce.
The best approach is to review the PD address map, and the elf2hex command ran by mem_init_generate.
Both the HEX file created from mem_init_generate and download as ELF in Nios II SBT are the same.
Alternatively, we can read the OCRAM using Nios II SBT Memory Browser after download as ELF in Nios II SBT. And compare it with the HEX file from mem_init_generate.
- reubengoh2 years ago
Occasional Contributor
Hi,
Thanks for your reply. Upon some digging into the memory browser, I have found that the onchip_memory2_0.hex always starts with 20000000? Why is that so?
I have attached some images of the mem_init_generate console window and nios sbt memory browser, as well as the hex file generated by mem_init_generate and the OCRAM memory exported from nios sbt memory browser.
Regards,
Reuben Goh