LPC1200 problem flashing more than 70 kByte

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

LPC1200 problem flashing more than 70 kByte

1,977 Views
antonioorzelli
Contributor I

Hello,

I'm using LPCXpresso v8.1.4, with the LPC1200 REV B demo board.

When I flash the micro with a code less than around 70 kByte size, everything works fine; instead, when I try to flash it with a larger code, I got an Erase Sector timeout Error. The targeted micro has 128 kByte of Flash, so it should be possible to download the code in it.

I've already tried 2 demo boards, having the same error.

Here there is the log I receive:

LPCXpresso RedlinkMulti Driver v8.1 (Mar 11 2016 13:34:34 - crt_emu_cm_redlink build 672)
============= SCRIPT: LPC12XXConnect.scp =============
LPC12XX Connect Script
No probes found
DpID = 0BB11477
AP_ID = 0x04770021
============= END SCRIPT =============================
Probe Firmware: LPC-Link Probe v1.3 (NXP - LPC-Link)
Serial Number: WIN64HS12
VID:PID: 1FC9:0009
USB Path:
Emu(0): Connected&Reset. DpID: 0BB11477. CpuID: 410CC200. Info: <None>
Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
inspected v.2 On-chip Flash Memory C:\nxp\LPCXpresso_8.1.4_606\lpcxpresso\bin\Flash\LPC11_12_13_128K_8K.cfx
image 'LPC11_12_13 (128K Flash, min 8K RAM) Feb 16 2016 09:19:07'
NXP: LPC1227/301 Part ID: 0x00000000
Connected: was_reset=true. was_stopped=true
LPCXpresso Free License - Download limit is 256K
Writing 73736 bytes to address 0x00000000 in Flash
driver "EraseSector" timeout (3000 ms) PC: 1FFF1536
Target error from Commit Flash write: Ec: Flash driver "EraseSector" timeout (3000 ms) PC: 1FFF1536
(crt_emu_cm_redlink) terminating on communication loss: Pipe has been closed by GDB.

Can you help me on this?

Thank you,

Antonio

0 Kudos
19 Replies

1,371 Views
antonioorzelli
Contributor I

With the new script I was able to flash 125 kByte of code.

You can see the log attached.

Thanks and Regards,

Antonio

0 Kudos

1,371 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Thank you for your test case.

Please can you try using the replacement flash driver file in the attached ZIp file and see if this resolves your issue.

To do this extract the .cfx file from the .zip and place in into the

<lpcxpresso_install>\lpcxpresso\bin\Flash

directory. You might want to rename the original file first, just in case.

Then try starting your debug sessions without mass erasing first. Please let us know how you get on.

Regards,

LPCXpresso Support

0 Kudos

1,371 Views
lpcxpresso_supp
NXP Employee
NXP Employee

So is the application that you have programmed into flash before you see the failure turning the watchdog on (or maybe I should say, leaving it turned on)?  https://community.nxp.com/message/630654 

Regards,

LPCXpresso Support

0 Kudos

1,371 Views
antonioorzelli
Contributor I

The __DISABLE_WATCHDOG symbol is present, so I guess the watchdog should be disabled…

I attached a sample project, which make the error on my setup.

Regards,

Antonio

0 Kudos

1,371 Views
antonioorzelli
Contributor I

Yes, it is working even with the manual boot in ISP mode; also in this case I have to repeat the procedure each time.

Regards,

Antonio

0 Kudos

1,371 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Did you try booting into ISP mode before starting a flash programming session?

Regards,

LPCXpresso Support

0 Kudos

1,371 Views
antonioorzelli
Contributor I

I attached the log when I receive the error ("log_error.txt") and when it is working ("log_working.txt").

There is also the log of the mass erase ("mass_erase.txt").

After the mass erase I'm able to start the debug, even with the larger code.

Anyway, if I stop it and try again, it doesn't work... I have to do the mass erase each time before debugging it.

On the chip it is written:

LPC1227FBD64

/301

Regards,

Antonio

0 Kudos

1,371 Views
lpcxpresso_supp
NXP Employee
NXP Employee

It would also be worth trying to boot the part into ISP mode before starting your debug connection, which will mean pulling the ISP to ground as you power up the board (or reset the chip): https://community.nxp.com/message/630748 

Regards,

LPCXpresso Support

0 Kudos

1,371 Views
lpcxpresso_supp
NXP Employee
NXP Employee

OK. Thanks for the confirmation.

Can I now ask you to try something else. Again using LPCXpresso IDE v8.2.2, can you go to the menu:

  • Window -> Preferences -> LPCXpresso -> Debug Options (Advanced)

And enter the value 0x3FFF into the "Extended debug trace (DEBUG_TRACE)" entry

Then try starting a debug session again. This will produce a much more detailed log of what is going on. Please copy into a txt file, and attach.

It would also be interesting to see if doing a full mass erase of the chip works : Using the GUI flash programming tool. Again please post the log generated from doing this.

And if the mass erase does work, does this then allows your debug launch to then succeed?

Finally, can you also confirm the exact markings on the LPC12 MCU chip fitted to your board. It should be something like

LPC1227BD64

/301

PS : Once you have done the above, you can change the "Extended debug trace" setting back to its original blank value.

Regards,

LPCXpresso Support

0 Kudos

1,371 Views
antonioorzelli
Contributor I

Yes, when I tried on another PC, I was using the new version v8.2.2.

Here is the log:

LPCXpresso RedlinkMulti Driver v8.2 (Sep  5 2016 10:12:38 - crt_emu_cm_redlink build 725)

============= SCRIPT: LPC12XXConnect.scp =============

LPC12XX Connect Script

DpID = 0BB11477

APID = 0x04770021

============= END SCRIPT =============================

Probe Firmware: LPC-Link Probe v1.3 (NXP - LPC-Link)

Serial Number:  WIN64HS12

VID:PID:  1FC9:0009

USB Path:

Emu(0): Connected&Reset. DpID: 0BB11477. CpuID: 410CC200. Info: <None>

Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.

inspected v.2 On-chip Flash Memory C:\nxp\LPCXpresso_8.2.2_650\lpcxpresso\bin\Flash\LPC11_12_13_128K_8K.cfx

image 'LPC11_12_13 (128K Flash, min 8K RAM) Jun 21 2016 11:53:37'

NXP: LPC1227/301  Part ID: 0x00000000

Connected: was_reset=true. was_stopped=true

LPCXpresso Free License - Download limit is 256K

Opening flash driver C:\nxp\LPCXpresso_8.2.2_650\lpcxpresso\bin\Flash\LPC11_12_13_128K_8K.cfx

Writing 98908 bytes to address 0x00000000 in Flash

driver "EraseSector" timeout (3000 ms)  PC: 1FFF1536

Target error from Commit Flash write: Ec: Flash driver "EraseSector" timeout (3000 ms)  PC: 1FFF1536

(crt_emu_cm_redlink) terminating on communication loss: Pipe has been closed by GDB.

Regards,

Antonio

0 Kudos

1,371 Views
lpcxpresso_supp
NXP Employee
NXP Employee

We haven't managed to replicate the problem here yet on any version of Windows.

However I've just realised that you are using LPCXpresso IDE v8.1.4. Can you try using the current v8.2.2 as see if you see the same problem?

Regards,

LPCXpresso Support

0 Kudos

1,371 Views
antonioorzelli
Contributor I

An update:

I tried also with another PC (always Windows 10 PRO), and the problem is still present.

Regards,

Antonio

0 Kudos

1,371 Views
antonioorzelli
Contributor I

I tried with the other board I have, and it is the same; here is the log:

LPCXpresso RedlinkMulti Driver v8.1 (Mar 11 2016 13:34:34 - crt_emu_cm_redlink build 672)
============= SCRIPT: LPC12XXConnect.scp =============
LPC12XX Connect Script
No probes found
DpID = 0BB11477
AP_ID = 0x04770021
============= END SCRIPT =============================
Probe Firmware: LPC-Link Probe v1.3 (NXP - LPC-Link)
Serial Number:  WIN64HS12
VID:PID:  1FC9:0009
USB Path:
Emu(0): Connected&Reset. DpID: 0BB11477. CpuID: 410CC200. Info: <None>
Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
inspected v.2 On-chip Flash Memory C:\nxp\LPCXpresso_8.1.4_606\lpcxpresso\bin\Flash\LPC11_12_13_128K_8K.cfx
image 'LPC11_12_13 (128K Flash, min 8K RAM) Feb 16 2016 09:19:07'
NXP: LPC1227/301  Part ID: 0x00000000
Connected: was_reset=true. was_stopped=true
LPCXpresso Free License - Download limit is 256K
Writing 75796 bytes to address 0x00000000 in Flash
driver "EraseSector" timeout (3000 ms)  PC: 1FFF1536
Target error from Commit Flash write: Ec: Flash driver "EraseSector" timeout (3000 ms)  PC: 1FFF1536
(crt_emu_cm_redlink) terminating on communication loss: Pipe has been closed by GDB.

Regards,

Antonio

0 Kudos

1,371 Views
lpcxpresso_supp
NXP Employee
NXP Employee

The “No probes found” message is erroneous, and not fatal. I also don’t see how it could be related to the flash download problem.I can say this message is not present in the script output in the next LPCXpresso maintenance release. I've filled the LPCXpresso1227 flash (128 kB) at least a half dozen times, and I can't reproduce your results. Do you have another board you can try and report your results?

Thanks and regards,

LPCXpresso Support

0 Kudos

1,371 Views
lpcxpresso_supp
NXP Employee
NXP Employee

My guess is that with the script file failing to turn off the watchdog (as indicated by the "No probes found" message means that part of the flash can get programmed before the watchdog then triggers.

But I certainly can't yet explain why you are getting this failure to run the connect script correctly. This is certainly not something we have seen ourselves, or had reported before. Anyway, we'll investigate further.

Regards,

LPCXpresso Support

0 Kudos

1,371 Views
antonioorzelli
Contributor I

Yes, even if I manually boot, I still see the "No probes found" in the connect script section of the debug log.

I'm running on a Windows 10 PRO OS.

The "No probes found" appear also when I have the system working, using less than 70kB code size.

Regards,

Antonio

0 Kudos

1,371 Views
lpcxpresso_supp
NXP Employee
NXP Employee

So just to confirm, even if you manually boot, you still see the "No probes found" in the connect script section of the debug log? Can you also confirm what OS you are running?

Regards,

LPCXpresso Support

0 Kudos

1,371 Views
antonioorzelli
Contributor I

I tried to unplug the board from the PC, plug it back and manually boot the built in probe with the script in the "lpcxpresso/bin" folder, as you suggested. Anyway it does not change, I receive the same log as before.

Thanks for the help,

Antonio

0 Kudos

1,371 Views
lpcxpresso_supp
NXP Employee
NXP Employee

I can't replicate the problem here - programming up to 128KB into the flash of an LPCXpresso1227 board without problem

The fact that you see the "No probes found" message inside the connect script at the start of the debug log is a bit concerning though. This could mean that the watchdog in the MCU is not being disabled as the debug connection is made, which could be triggering your flash programming failure

Can you try unplugging your LPCXpresso1227 board from your PC, and plugging it back in and manually booting the built in probe rather than relying on the IDE to do : Booting LPC-Link . Then try debugging again, and see if this helps.

Regards,

LPCXpresso Support

0 Kudos