lpcware

Hitex 4350 external flash boot

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by gregUR on Tue Dec 04 07:16:13 MST 2012
Hi everyone

I have a problem while loading binary into flash on Hitex eval board(LPC 4350). I am using GNUARM toolchain to compile, and JLink GDB server to load/debug.

I can load .elf file to ram through JlinkGDB server and arm-none-eabi-gdb (target remote :2331). I run the program, everything works fine.

When I want to load it to flash, I build my elf so text goes to 0x1c000000 (static external memory CS0), data follows it in flash, and on startup data is copied to 0x20000000 (RAM).

I tried to load it with GDB by setting "monitor flash device LPC4350" (not recognized), "monitor flash device Cortex-M4" (no complains), then "monitor flash download 1" and then load main.elf, here is the output:

(gdb) load main.elf
Loading section vectors, size 0x114 lma 0x1c000000
Loading section .text, size 0xd6f8 lma 0x1c000118
Loading section .ARM.exidx, size 0x8 lma 0x1c00d810
Loading section .data, size 0x64 lma 0x1c00d818
Start address 0x1c00035d, load size 55416
Transfer rate: 82 KB/sec, 7916 bytes/write.
(gdb)

But when I try to read adresses, nothing changes, it seems like it is not written. When I reset the board, preflashed demo starts, I can never overwrite it.

I also tried by JLink.exe and it is similar, here is the output:

J-Link>loadbin main.bin 0x1c000000
Loading binary file... [main.bin]
Writing bin data into target memory @ 0x1C000000.
J-Link>

What is the general procedure while loading to flash ? Is it enough to set those commands ?

Jlink software version V456.

Outcomes