Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHi LiangYi,
> Am29DL323GB Flash: 4M, base address:=0x00000000. Is your base address correct? The base address for your flash was 0x0020_0000 in the last email you sent. > *** Warning - bad CRC, using default environment -#define CFG_ENV_ADDR (CFG_RESET_ADDR + CFG_MONITOR_LEN) +#define CFG_ENV_ADDR CFG_FLASH_BASE /* Or whatever you like */ Since the reset address has changed to the epcs controller, the vanilla CFG_ENV_ADDR is not valid -- the default configs for the altera boards assume the reset address is in flash ... and assume the environment is stored in the sector following the u-boot binary. > Here, --base is epcs base or cfi flash base. If it is cfi flash, why --end=0x7fffffff. It's just a simple way to grab everything from the elf file since the Nios II memory space is only 2GB [0000_0000 - 7fff_ffff]. The flash file for an epcs is handled a bit different -- it contains a sequence of length-address-data records that must be copied to the appropriate address in the Nios II memory space. These records are actually programmed into the epcs. For a parallel (CFI) flash device, only the data is programmed into the device (if it falls within the device's address range). > Is flash-programmer can know to allot the address space to configuration data and > u-boot.flash intelligently? Yes, otherwise you would overwrite your FPGA configuration data. > The data in epcs are in the sequence, .sof, boot_loader_srec(or store in on-chip rom), u-boot, > then u-boot is relocated by boot_loader_srec to run in sdram text_base. > Right? Yes (the onchip rom is part of the sof). You can examine all of this using the u-boot epcs commands: <div class='quotetop'>QUOTE </div> --- Quote Start --- ==> help epcs epcs epcs erase start [end] - erase sector start or sectors start through end. epcs info - display EPCS device information. epcs protect on | off - turn device protection on or off. epcs read addr offset count - read count bytes from offset to addr. epcs write addr offset count - write count bytes to offset from addr. epcs verify addr offset count - verify count bytes at offset from addr. ==> epcs info EPCS4 : 512 kbytes (8 sectors x 64 kbytes, 256 bytes/page) status: 0x00 (WIP:0, WEL:0, PROT:off) config: 0x02d453 (185427) bytes 0: 000000 data @ 0x000010 1: 010000 data @ 0x010000 2: 020000 data @ 0x020000 3: 030000 data @ 0x030000 4: 040000 data @ 0x040000 5: 050000 erased 6: 060000 erased 7: 070000 erased ==> epcs read 400 2d453 10 epcs: read 00000400 <- 02d453 (0x10 bytes) ==> md.b 400 10 00000400: c2 2d 80 00 00 00 bf 00 28 10 00 80 2c 00 02 80 .-......(...,...[/b] --- Quote End --- If you bit reverse the first two words you get: 0001_b443 00fc_0000 which is in fact, the length and address of the .text section for my particular board. Regards, --Scott