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++
12600 Discussions

Strange problem after changing reset vector

Altera_Forum
Honored Contributor II
1,025 Views

Hi, 

 

I've been struggling for about one day around a strange problem which appeared after some changes in sopc system. 

Apart a few minor changes (added 2 pio ports, changed ethernet mac isr priority), the major one was moving the Nios I reset vector from flash to epcs, since I want to boot from this device. 

However, I'm still not booting from epcs; I load and start the program with usb blaster. 

When I run the Nios code on the new system, program starts (I can see printf output in the console) then hangs. 

I use Quartus 9.0sp2. My Nios program runs with uC OS and NicheStack. 

After several hours of tests, placing breakpoints here and there, I discovered the main OS timer was not initialized. 

Then, I inserted a few instructions to initialize it manually and almost everything begun to work again. 

I still can't operate TCP/IP interface, so I suppose something else is still not initialized (I think on Nichestack side, since raw Ethernet frames rx/tx is working) 

 

Have you any ideas? 

 

Regards 

Cris
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
291 Views

Hi again, 

I think I found the bug myself. 

 

I rebuilt the Quartus project with some changes and the situation was even worse: I couldn't load the Nios program because I got and "Invalid system ID" error; moreover the fpga outputs connected to PIOs behaved in strange ways just after configuration. 

Then, I erased the epcs device with the programmer and everything was perfect again. 

So, I think the problem was with data from previous configurations stored on epcs. When I switched Nios mode from flash to epcs, probably Nios tried to boot load from this invalid data, leading to instable behaviour or corrupting sopc components init status. 

 

Can anyone confirm if this is a valid explanation? 

Thank you 

 

Cris
0 Kudos
Altera_Forum
Honored Contributor II
291 Views

I have found that there are 3 scenarios with EPCS when debugging with the USB Blaster, 1 of which, in my experience, leads to flakiness. 

 

1) EPCS is blank. 

2) EPCS has the old configuration. 

3) EPCS has the new configuration. 

 

I have found scenario 2 leads to flaky behavior. I have also found that scenarios 1 and 2 lead to erratic output of the debug messages in the debugger. Scenario 3 makes things the most stable and how I usually try to run. 

 

This could all be due to our configuration which is a fairly complex TSE-based system. And, this is still using 8.1 Quartus/NIOS II. 

 

Bill
0 Kudos
Altera_Forum
Honored Contributor II
291 Views

Thank you for your answer Bill.  

You are right. I was working in scenario 2.  

This could also explain some strange behaviours I seldom experienced in the past. 

I never had problems with scenarios 1 and 3. 

I've been working for two days after I erased previous configuration from epcs and I had no more problems. 

I could also successfully load both fpga configuration and Nios firmware from epcs device. 

 

Cris
0 Kudos
Reply