Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Problem with writing uClinux image on flash

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 verified
My 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.srec
When 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

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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