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

Problem with writing uClinux image on flash

Altera_Forum
Honored Contributor II
1,024 Views

Hi, 

 

I followed the tutorial on http://www.alterawiki.com/wiki/flashprogrammer to write my zImage from the uClinux distribution on CFI-Flash but I can't upload the created file using 'nios2-flash-programmer'. 

 

The error message is Empty flash content cannot be programmed or verifiedMy FPGA configuration is in EPCS-Flash and the steps for it seem to work but not for the program which should be in uploaded in CFI-Flash 

 

I used the step 1. sof in epcs, program in cfi 

Here is my command I type in: 

elf2flash --base=0x02800000 --end=0x02FFFFFF --reset=0x0 --input=zImage --output=parallel_flash.flash --boot=$SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_cfi.srecWhen I do 'cat parallel_flash.flash' there is only one row with a few numbers a characters. But the zImage is much bigger than that. 

 

In attachment I have pictures of my reset_vector and the addresses of the flash types in sopc builder. Perhaps somebody see a mistake. 

 

 

PS: The linefeed in the code section is just for better reading 

 

Urmel
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
277 Views

I think you may need to set a reset address in flash for elf2flash even if that's not what you're using for the processor. 

 

Edit: I see you are using flash for the reset address in SOPC builder, so you need to give that absolute address to elf2flash. 

 

Edit 2: Also, if you're using an MMU, you'll need to add 0xC0000000 to those addresses.
0 Kudos
Altera_Forum
Honored Contributor II
277 Views

Hi Ykozlov, 

 

thank you so much!  

That reset address was the reason. I didn't realize that I mustn't use the offset but the base address + offset. 

 

Urmel
0 Kudos
Reply