Command line flash programming error - load failure: Ef(4)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Command line flash programming error - load failure: Ef(4)

1,957 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JAlvarez on Thu Aug 02 18:36:02 MST 2012
I get a "load failure: Ef(4)" when using the command line programming tool to flash a 91KB binary to an LPC4330 board with SPIFI flash using a Red Probe+. The command output is shown below. The GUI flash programmer from the LPCXpresso IDE also displays an error (06: File 'ostest.bin' load failure: Ef(4). Flash operation failed.) after downloading about 64KB of the binary. I get the same error with an LPC-Link (after initializing it and adding the -wire=hid option to the command below). Flash programming of small binaries works fine. The build uses Makefiles, not the LPCXpresso IDE.

Besides the 128K limit, are there other limits in the standalone flash programmer?

Thanks.

C:\Projects\ostest>C:\nxp\LPCXpresso_4.2.3_292\lpcxpresso\bin\crt_emu_lpc18_43_nxp -pLPC4330 -load-base=0x14000000 -flash-load-exec=ostest.bin -flash-driver=C:\nxp\LPCXpresso_4.2.3_292\lpcxpresso\bin\Flash\LPC1850A_4350A_SPIFI.cfx
Ni: LPCXpresso Debug Driver v4.0 (May 21 2012 21:42:30)
Nc: Looked for chip XML file in C:/nxp/LPCXpresso_4.2.3_292/lpcxpresso/bin/LPC4330.xml

Nc: Looked for vendor directory XML file in C:/nxp/LPCXpresso_4.2.3_292/lpcxpresso/bin/nxp_directory.xml

Nc: Found generic directory XML file in C:/nxp/LPCXpresso_4.2.3_292/lpcxpresso/bin/crt_directory.xml

Nc: Emu(0): Conn&Reset. DpID: 2BA01477. Info: FTV7X6ZPA
Nc: SWD Frequency: 3000 KHz. RTCK: False. Vector catch: False.
Nc: Packet delay: 16  Poll delay: 0.
Nc: Loaded C:\nxp\LPCXpresso_4.2.3_292\lpcxpresso\bin\Flash\LPC1850A_4350A_SPIFI.cfx: SPIFI on LPC18xx/43xx @0x14000000 Jan 24 2012 10:07:55  External Flash Device on SPI

Nc: NXP: LPC4330  Part ID: 0x00000000
Cr:v Registered license, download limit of 128K
Nt: Loading binary file 'ostest.bin' at location 14000000
Wc: Target driver error code: 1
Ed:06: File 'ostest.bin' load failure: Ef(4). Flash write operation failed.
0 Kudos
Reply
7 Replies

1,644 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sun Oct 21 23:17:28 MST 2012
I assume that you are using LPCXpresso 4.2.3 (or earlier). Upgrading to LPCXpresso 4.3.0 should solve the problem...

http://support.code-red-tech.com/CodeRedWiki/VersionInfo

Regards,
CodeRedSupport
0 Kudos
Reply

1,644 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mailgate_user on Sun Oct 21 13:37:17 MST 2012
Hi! Can anybody advise the outcome? I've got into the same issue :(
0 Kudos
Reply

1,644 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JAlvarez on Tue Aug 07 14:44:59 MST 2012

Quote: CodeRedSupport
Please can you contact our support team directly referencing this forum post...


I just sent a message to the address in the URL. Thanks for the suggestion.
0 Kudos
Reply

1,644 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Aug 07 14:14:34 MST 2012
Please can you contact our support team directly referencing this forum post, using the "Email the support team" link towards the bottom of the following page...

http://www.code-red-tech.com/support.php

Regards,
CodeRedSupport
0 Kudos
Reply

1,644 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JAlvarez on Tue Aug 07 12:59:55 MST 2012
The output is of the form below after adding -g -4. Occasionally it goes beyond that 64KB boundary but it takes multiple retries and is very slow. Reducing the SWD frequency (-s2000 instead of the default -s3000) doesn't make a difference. Increasing the erase page size from 256 bytes to 4KB may help but crt_emu_lpc18_43_nxp does not seem to have that option.

The Makefile project generates a BIN file. Would using the AXF format change the flash programmer behavior? arm-none-eabi-objcopy converts from AXF to BIN but does not appear to support the other way around.
...
Nt: Loading binary file 'ostest.bin' at location 14000000
Nt: Writing 93992 bytes to 14000000 in Flash (assumed clock: 72.0MHz)
Pb: (  0) Writing page 0 at 0x14000000 with 93992 bytes
Ps: (  0) Page  0 at 14000000
Ps: (  0) Page  0 at 14000000: 256 bytes
Ps: (  0) Page  0 at 14000100: 256 bytes
Ps: (  0) Page  0 at 14000200: 256 bytes
Ps: (  0) Page  0 at 14000300: 256 bytes
Ps: (  1) Page  0 at 14000400: 256 bytes
Ps: (  1) Page  0 at 14000500: 256 bytes
Ps: (  1) Page  0 at 14000600: 256 bytes
Ps: (  1) Page  0 at 14000700: 256 bytes
Ps: (  2) Page  0 at 14000800: 256 bytes
Ps: (  2) Page  0 at 14000900: 256 bytes
...
Ps: ( 69) Page  0 at 1400FE00: 256 bytes
Ps: ( 69) Page  0 at 1400FF00: 256 bytes
Wc: Target driver error code: 1
Pb: (100) Writing Flash ended with an error.
Ed:06: File 'ostest.bin' load failure: Ef(4). Flash write operation failed.
Pc: (100) Target Connection Failed
0 Kudos
Reply

1,644 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri Aug 03 01:00:17 MST 2012
You can use an axf file directly in the command line flash programmer. The load address will be taken from the axf file, so there is no need to provide any load address. Please try using the axf directly.

Also, please add "-4" to the command line, as this will increase the log level
0 Kudos
Reply

1,644 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JAlvarez on Thu Aug 02 19:08:20 MST 2012
After trying five or six times the flash programming process completed successfully with the 91K binary. I replaced USB cables and tested further, but both the command line and GUI standalone programmers failed several times before achieving a successful completion. Any suggestions on how this process could be made more reliable with ~100KB binaries?

Another alternative may be to use the debugger in the LPCXpresso IDE to download code to flash. With smaller binaries it appears to be faster and more reliable compared to the standalone programmers (using both the Red Probe+ and an LPC-Link). Can the IDE be used with a project that uses Makefiles but still allowing the debugger to download the binary to SPIFI flash and execute it?
0 Kudos
Reply