Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12621 Discussions

NiosII booting from on-chip memory SPI issue

reubengoh
New Contributor I
13,332 Views

Hi all,

 

I am using quartus prime 19.1 lite, and I am trying to load a simple SPI program that sends SPI commands using NIOS II processor. The board that I am using is DECA Max10 Development Board. I am able to send "$HELLOABC*" continuously when I load the program in NIOS II SDK debug mode.

 

The problem comes when I try to generate the .hex file using "mem_init_generate" and compile the project in quartus to generate the .pof file. The .pof file that I loaded inside my FPGA is unable to send the "$HELLOABC*" continously. It only sends 2 "$HELLOABC*" and stops abruptly (as attached in spi_output.PNG )

 

I have tried to load a simple led and switch program that basically turns on and off an LED, and I am able to burn it into the FPGA. So I am assuming that my steps to load the .pof file containing the NIOS II application code is correct. 

 

Hence, if anyone can enlighten me about why is this happening to my SPI program? 

Below attached is the hardware of my SPI program, Nios II Application Code and spi_output image from a external logic analyzer.

 

I am using the test code given by Altera SPI Core in the link below. 

https://www.intel.com/content/www/us/en/docs/programmable/683130/23-4/example-test-code.html

While editing it to include a while loop to send the data continuously. I have excluded the ISR to avoid any other issues. 

 

Thanks in Advance,

Reuben Goh

 

 

0 Kudos
1 Solution
reubengoh
New Contributor I
9,567 Views

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

View solution in original post

0 Kudos
45 Replies
wwanalim_intel
Employee
864 Views

Hi,


We are still debugging on the design, sorry for the delay.


0 Kudos
wwanalim_intel
Employee
837 Views

Hi,


Is there any new update on this issue?


0 Kudos
reubengoh
New Contributor I
9,568 Views

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

0 Kudos
wwanalim_intel
Employee
822 Views

I’m glad that your question has been addressed, I now transition this thread to community support. If you have a new question, Please login to ‘https://supporttickets.intel.com’, 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.


0 Kudos
Reply