Content originally posted in LPCWare by robertpalmerjr on Fri Nov 14 12:18:44 MST 2014
Here is the flash programming command:
crt_emu_cm3_nxp -g -2 -vendor=NXP -pLPC1756 -s250 -flash-load-exec "<path>/Release/Bootloader.axf"
It fails with error code 138
Here is the output of the flash programming:
Ni: LPCXpresso Debug Driver v5.2 (Apr 26 2013 19:51:18 - crt_emu_cm3_nxp build 1153)
Pc: ( 0) Reading remote configuration
Nc: Looked for chip XML file in /Applications/lpcxpresso_5.2.4_2122/lpcxpresso/bin/LPC1756.xml
Nc: Looked for vendor directory XML file in /Applications/lpcxpresso_5.2.4_2122/lpcxpresso/bin/nxp_directory.xml
Nc: Found generic directory XML file in /Applications/lpcxpresso_5.2.4_2122/lpcxpresso/bin/crt_directory.xml
Pc: ( 5) Remote configuration complete
Pc: ( 30) Emulator Connected
Pc: ( 40) Debug Halt
Pc: ( 50) CPU ID
Nc: Emu(2): Conn&Reset. DpID: 2BA01477. Info: FTWN9IJGA
Nc: SWD Frequency: 250 KHz. RTCK: False. Vector catch: False.
Nc: Packet delay: 0 Poll delay: 0.
Nc: Loaded LPC175x_6x_256.cfx: LPC175x_6x (256K) Apr 22 2013 12:14:30 On-chip Flash Memory
Nc: NXP: LPC1756 Part ID: 0x00000000
Pc: ( 65) Chip Setup Complete
Nt: Connected: was_reset=false. was_stopped=false
Cr:v Registered license, download limit of 128K
Pc: ( 70) License Check Complete
Nt: Loading ELF file 'Bootloader.axf' at location 00000000
Nt: Writing 3576 bytes to 0000 in Flash (assumed clock: 4.0MHz)
Pb: 1 of 1 ( 0) Writing pages 0-0 at 0x00000000 with 3576 bytes
Ps: ( 0) Page 0 at 00000000
Ps: ( 0) Page 0 at 00000000: 3576 bytes
Nt: Erased/Wrote page 0-0 with 3576 bytes in 1053msec
Pb: (100) Finished writing Flash successfully.
Nt: Flash write Done
Nt: Loading ELF file 'Bootloader.axf' at location 00000FF0
Nt: Writing 4 bytes to 0FF0 in Flash (assumed clock: 4.0MHz)
Pb: 1 of 1 ( 0) Writing pages 0-0 at 0x00000FF0 with 4 bytes
Ps: ( 0) Page 0 at 00000FF0
So it appears that the first part writes correctly, but that the last 4 bytes don't. Do flash write requests have to being on a page boundary? Should these last 4 bytes be combined into the same write as the first 3576 bytes?