Forum Discussion
impossible to boot ep3c25 from epcs16 - reset_vector problem ?
Hi,
I am developing my first niosII design. It works well when I use a volatile programming file (.sof) but I have issues to program the fpga with an external flash. I use : - cycloneIII ep3c25 - flash epcs16 (configuration) - ssram (nios memory) - quartus 9.1 sp2 - nios software 10.0 - windows7 x64 The hardware image seems to boot (1 led and 1 screen managed by hw are powered) but NOT the nios. When i try to run the nios manually (run as niosII hw application in eclipse) I have the following error: "Verifying 02401800 (99%) / Verify failed between address / 0x2401800 and 0x240181F / Leaving target processor paused" @02401800 is the epcs_controller base address (=reset_vector @) in the nios. I don't understand the reason of the failure. Thanks for helping ! I configure the nios in the sopc builder like that: - cypress ssram controller - epcs serial flash controller ("automatically select dedicated AS..." enabled") - cpu nios : reset_vector = epcs_flash_controller // offset 0x0 exception_vector = ssram // offset 0x20 - other modules: spi_control_port, pio, jtag, sys_clk_timer, sysid... fpga design/quartus: - flash pins are set to "use as regular IO" i use the following method to program the epcs16 :# 1) Convert SOF to Flash sof2flash --input=file.sof --output=hwimage.flash --epcs --verbose# 2) Convert ELF to Flash elf2flash --input=../testBoot.elf --output=swimage.flash --epcs --after=hwimage.flash --verbose# 3) Concatenate cp hwimage.flash hw_sw.flash cat swimage.flash >> hw_sw.flash# 4) Create HexFile nios2-elf-objcopy -I srec -O ihex hw_sw.flash hw_sw.hex Then i create a .jic file with quartus convert pgm file: - flash_loader : ep3c25 - hex_data : hw_sw.hex (I try absolute and relative addressing) I also try without concatenation : file.sof and sw.hex (relative addressing) to create the .jic file. With the same sopc file I have tested the epcs16 flash with the project template "memory test". both write and read operations work. Thanks for helping again ! SG.18 Replies
- Altera_Forum
Honored Contributor
I don't think that you should write anything to the EPCS controller base address when downloading the NiosII application. At this address you have a bootloader that is supposed to be read only.
Did you do anything special to the BSP settings? Check that it is configured to have the application code in the SSRAM (and in the hardware setup, that the NiosII instruction master is connected to the SSRAM). - Altera_Forum
Honored Contributor
Hi Daixiwen,
I didn't change anything in the bsp settings. In the linker script tab i have : - .bss, .exceptions, .heap, .rodata, rwdata, .stack, .text linked in ssram - .entry linked to reset in epcs_flash_controller The epcs_flash_controller is connected to instruction_master and data_master. I flash the .jic file by jtag and the harware image successfully boot on power up but not the Nios. Maybe the bootloader (in flash @reset_vector addr) can't be found ? Is there an offset for the bootloader (which implies an offset for the nios reset_vector) ? Is it correct to linked vector_reset into epcs instead of system ram ? thx - Altera_Forum
Honored Contributor
It looks okay. What is strange is that the memory test template works, but you can't even upload your software directly to memory through JTAG... There must be a difference between your project and the memory test that causes this...
There isn't any offset and the bootloader is always present, directly in the EPCS controller. What version of Quartus are you using? Several versions have a bug with the flash converter that puts the software in the wrong place in the EPCS. But this doesn't explain your "verify failed" problem anyway. - Altera_Forum
Honored Contributor
I use quartus 9.1 sp2 and nios 10.0 (i also try nios 9.1).
I have made a more simple project with only an epcs controller, a sram controller, +sysid, jtag uart and a pio for debug purpose. I was using the locked signal from an alt_pll to reset the Nios. It was asserted several ms before fpga conf_done signal was asserted so now I use an external reset signal. But it still doesn't work, Nios doesn't boot. When I program the epcs16 with a jic file (composed by hw & sw), only the hardware boots. After hardware has booted from flash, I can flash the software with Nios IDE, it boots correctly (no more verifying problem...). If I assert (briefly) the external reset signal, the Nios is reseted but never reboots. I both try reset_vector in sram and in flash. I don't understand why the Nios doesn't reboot, especially when the reset vector is in sram ?? Is it because Nios has been downloaded by jtag/ide ? It works as if the reset_vector always point to a bad memory region... - Altera_Forum
Honored Contributor
Quartus 9.1 sp2 is one of the versions that had some problems with EPCS booting. Have a look at this thread (http://www.alteraforum.com/forum/showthread.php?t=22441).
I never tried to flash through a .jic file, but it should work still. As an alternative you can use the Nios flash programmer from the .flash file. I agree that if the reset vector is pointing on the SRAM and you apply an external reset signal to the NIOS cpu after having downloaded your software to SRAM, then the CPU should boot. In some cases I know that the JTAG UART can hang the CPU if no terminal is connected. You could try to remove the UART and just flash a led or something similar from your software to check if it boots. If it still doesn't work, I suggest to use some signaltap probes on the CPU to see what it is doing when getting out of reset. - Altera_Forum
Honored Contributor
I try several nios configurations with small memory needs (reset_vector is in flash in each configurations) and external reset :
- onchip memory only without jtag -> nios & hard boot without problem - onchip memory only with jtag&debug -> nios & hard boot without problem - sram only without jtag&debug -> nios don't boot - onchip mem (.exception) + sram (all others) + jtag/debug -> nios don't boot. So I guess there is no problem with jtag. unless quartus bugs are random, i guess there is no problem with quartus too. The problem seems to be the sram. Hardware could be loaded in sram from flash but not the nios. The nios could be loaded by IDE (with reset_vector in sram) but doesn't support reset... I will try to downgrade quartus to 9.1 sp1 (unless you think that 10.0 sp1 is better) and maybe use signal tap probes after if no new solutions. - Altera_Forum
Honored Contributor
I also try this configuration :
- reset_vector in flash, onchip mem (everything in the linker section mappings except reset) + sram (nothing linked to) + jtag/debug -> nios boot ! so it also suggests that sram is responsible for nios boot problems. nios is not (or not properly) loaded in sram ? some pointers point wrong sram region ? - Altera_Forum
Honored Contributor
Yes it seems to be a problem with the sram. What is strange though is that you can still upload a software to the sram through the IDE, so it seems to be working partially.
Could you create a project with the memory test template and run it from on-chip memory to test the sram? Are the timing settings correct for the sram? - Altera_Forum
Honored Contributor
I was working on a coworker computer because mine was corrupted (vista, quartus& nios 9.1sp2). I have formated it this morning (w7 x64). I install quartus 9.1sp1, nios 9.1sp1 because after reading several thread I thought it had no bugs (1 is solved : http://www.alteraforum.com/forum/showthread.php?t=19765)...
I can't run memory test from on chip memory (not enough memory on fpga - ep3c25) and it doesn't work with sram memory. it is strange because it works with sram a few days ago. I will try without onchip memory at all, maybe I change something in the bsp editor. is there any documentation about linker ? I don't know what is the function of each field (.bss, .entry...) and I don't find any doc. maybe it could help to understand what occurs in sram. - Altera_Forum
Honored Contributor
Two problems,
1. If Quartus II 9.1SP2, DO NOT generate compressed SOF file, use uncompressed instead 2. If NIOS II flash programmer, command line or GUI, DO NOT program EPCS through NIOS II flash programmer, it does not work