Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Altera Cyclone IV Programming .elf file to flash?

Status
Not open for further replies.

digi001

Full Member level 5
Joined
Apr 5, 2011
Messages
244
Helped
22
Reputation
44
Reaction score
21
Trophy points
1,298
Activity points
2,904
I am working on a DE2-115 dev board and have finished my design.

Now i need to program Flash memories so that my code will be non-viotile.
I have successfully converted the .sof file to .pof and programmed a Active Serial device EPS64.

However I cannot get the .elf file programmed in the ISSI 8MB Flash correctly. I followed the tutorial on terasic https://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=49&No=656


by creating a CFI flash controller ,creating a tri-state bus and setting the reset vector to cfi_flash. I am able to program the flash and everything seems ok, but the code is not running correctly.

Any idea why this could be happening? If i run as 'Nios II hardware' in eclipse the program works great, but if i flash the .elf file and recycle power I get strange things like half of the program works. My LCD display works, but the UART doesn't.

Any ideas?
 

Ok. I got everything working now.

It looks like the issue was with the program running out of flash instead of RAM. To fix this I implemented the bootloader which takes the program from flash and puts it into RAM at startup.

Here are the steps to do this:

In BSP editor I linked everything to on-chip memory except for RESET Vector.

Then in hal.linker I checked all boxes:
allow_code_at_reset
enable_alt_load
enable_alt_load_copy_exceptions
enable_alt_load_copy_rodata
enable_alt_load_copy_rwdata

Then when programming the flash I used the .sopcinfo file rather than .bsp settings options.

This seemed to do the trick. My design now works at full speed and running out of on-chip RAM.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top