LPCScrypt flash programming fails on LPC43S67 OM13084

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

LPCScrypt flash programming fails on LPC43S67 OM13084

2,397 Views
omidathari
Contributor II

I am trying to load an image to the on board flash BankA of my device and LPCScrypt fails.

Here is the console output :

C:\nxp\LPCScrypt\bin>..\scripts\boot_lpcscrypt.cmd
Booting LPCScrypt target with "LPCScrypt_140.bin.hdr"
LPCScrypt target booted

C:\nxp\LPCScrypt\bin>lpcscrypt.exe queryFlash
Number of Flash Devices = 2
Name = BankA
Base = 0x1a000000
Size = 0x80000
Page = 0x1000
Sector = 8-64KB
Blank = 0xff
Buffer = 0x8000
Name = EEPROM
Base = 0x20040000
Size = 0x3f80
Page = 0x80
Sector = NA
Blank = 0x0
Buffer = 0x8000

C:\nxp\LPCScrypt\bin>lpcscrypt.exe blankCheck BankA
Not blank at 0x1a000000

C:\nxp\LPCScrypt\bin>lpcscrypt.exe erase all
Erasing BankA LPC_Error Fatal 0x10
... completed in 0.122s
Error: <Command line>:1: Fatal 0x10
Script cmd: erase all
Last target cmd: =eraseFlash 1a000000
Terminated with errors

C:\nxp\LPCScrypt\bin>lpcscrypt.exe program ..\images\freertos_app.bin BankA
.
Programmed 16376 bytes to 0x1a000000 in 0.100s (159.804KB/sec)

C:\nxp\LPCScrypt\bin>

Even though it says that the image was written it is not.

There is error erasing the flash as well.

Any help is appreciated

omid

0 Kudos
Reply
5 Replies

1,755 Views
converse
Senior Contributor V

It is the valid image checksum. This is required in all LPC parts and is described in the user manual for the part. How to add it is described in this FAQ. https://community.nxp.com/message/630596 

I think lpcscrypt can add add it too.read the manual.

0 Kudos
Reply

1,755 Views
omidathari
Contributor II

Thank you.

Please consider this issue closed

0 Kudos
Reply

1,755 Views
omidathari
Contributor II

Thanks for the reply.

Both responses were very informative. Like using the Target usb port  rather than on the Link port.

However it is important to mention that I had to hold the ISP switch down while connecting the Target to the pc.  That is when the usb device comes up as a "LPC based USB device"  in the Windows device manager.

At that point I was able to follow your instructions and load the image to the target using LPCScrypt.  But the image still did not run. When I used the LPCXpersso Ide to program the bin file to BankA it loads and runs without difficulty.  But when I used LPCScrypt the program loads fine but does not run.

I then compared the contents of the flash (using LPCScrypt memDisplay command) and found that the is a small difference between the two loading techniques.  At memory location 0x1a00001c  (around the vectors location) the contents of the flash are not the same even though the same bin file was used to program the device.

When using LPCXpresso the value of that memory location is 0x53ff4426 but when I use LPCScrypt the value is 0x00000000.  I manually updated the contents of  0x1a00001c to  0x53ff4426 ( using LPCScrypt flashSet command) and the program began to run.  That is the only location where there was a discrepancy. 

pastedImage_1.png

Why and what is there a different between programming with LPCXpresso and LPCSrypt.

How can we correct this?

0 Kudos
Reply

1,755 Views
lpcxpresso_supp
NXP Employee
NXP Employee

I suspect one potential issue is that you are connecting to the LPC43 part that acts as the debug probe on your board, rather than the main target LPC43S67 MCU. Make sure that your USB cable is connected to "Target" USB socket rather than the "Link" USB socket. If you hold the board so that the USB sockets are on the left, then the "Target" socket is the upper one.

And if you want to erase the bankA flash,  then I would also recommend erasing that specifically, rather than trying to erase everything:

lpscrypt erase BankA

Regards,

LPCXpresso Support

0 Kudos
Reply

1,755 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Omid,

What was previously programmed to the MCU? Have you tried using the "Program Flash" option in LPCXpresso to see if the same problem is present?

I have done some tests on my LPCXpresso4367 board and don't have any problem:

C:\Users\b38285>cd C:\nxp\LPCScrypt\scripts

C:\nxp\LPCScrypt\scripts>boot_lpcscrypt.cmd
Booting LPCScrypt target with "LPCScrypt_140.bin.hdr"
LPCScrypt target booted

C:\nxp\LPCScrypt\scripts>cd C:\nxp\LPCScrypt\bin

C:\nxp\LPCScrypt\bin>lpcscrypt querypart
partID = 0x8001c030 0
decode = LPC4367: BankA 512KB, BankB 512KB
Core Clock = 180000000

C:\nxp\LPCScrypt\bin>lpcscrypt queryflash
Number of Flash Devices = 4
Name = SPIFI
Base = 0x14000000
Size = 0x100000
Page = 0x100
Sector = 0x10000
Blank  = 0xff
Buffer = 0x8000
Name = BankA
Base = 0x1a000000
Size = 0x80000
Page = 0x1000
Sector = 8-64KB
Blank = 0xff
Buffer = 0x8000
Name = BankB
Base = 0x1b000000
Size = 0x80000
Page = 0x1000
Sector = 8-64KB
Blank = 0xff
Buffer = 0x8000
Name = EEPROM
Base = 0x20040000
Size = 0x3f80
Page = 0x80
Sector = NA
Blank = 0x0
Buffer = 0x8000

C:\nxp\LPCScrypt\bin>lpcscrypt program ..\images\periph_blinky.bin BankA
.
Programmed 8612 bytes to 0x1a000000 in 0.031s (271.295KB/sec)

C:\nxp\LPCScrypt\bin>lpcscrypt verify ..\images\periph_blinky.bin BankA
.
Verified 8612 bytes to 0x1a000000 in 0.006s (1401.693KB/sec)

C:\nxp\LPCScrypt\bin>lpcscrypt gotoimage BankA

After programming the image I erased it and programmed it again without any problem:

C:\nxp\LPCScrypt\bin>cd C:\nxp\LPCScrypt\scripts

C:\nxp\LPCScrypt\scripts>boot_lpcscrypt.cmd
Booting LPCScrypt target with "LPCScrypt_140.bin.hdr"
LPCScrypt target booted

C:\nxp\LPCScrypt\scripts>cd C:\nxp\LPCScrypt\bin

C:\nxp\LPCScrypt\bin>lpcscrypt querypart
partID = 0x8001c030 0
decode = LPC4367: BankA 512KB, BankB 512KB
Core Clock = 180000000

C:\nxp\LPCScrypt\bin>lpcscrypt blankcheck BankA
Not blank at 0x1a000000

C:\nxp\LPCScrypt\bin>lpcscrypt erase BankA
Erasing BankA ... completed in 0.201s

C:\nxp\LPCScrypt\bin>lpcscrypt program ..\images\periph_blinky.bin BankA
.
Programmed 8612 bytes to 0x1a000000 in 0.030s (280.282KB/sec)

C:\nxp\LPCScrypt\bin>lpcscrypt verify ..\images\periph_blinky.bin BankA
.
Verified 8612 bytes to 0x1a000000 in 0.004s (2102.014KB/sec)

C:\nxp\LPCScrypt\bin>lpcscrypt gotoimage BankA

I'm flashing the blinky example that comes with the LPCOpen package for the LPCXpresso4337 and LPCXpresso43S37 boards (Compatible with LPCXpresso4367 and LPCXpresso43S67 boards):

LPCOpen Software for LPC43XX|NXP 


Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos
Reply