LPC51U68 enter ISP from user code

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

LPC51U68 enter ISP from user code

1,480 Views
abele_barbieri
Contributor I

Hi,
on my last project, I tried to enter the LPC51U68 in USART0 ISP Mode by invoking the function IAP_ReinvokeISP. USART 0 is routed to PIO0_0 and PIO0_1 and configured inside BOARD_InitBootPeripherals(); function.
Here below the code I add to my application, that isn't working.
I tryed the ispType 0, 1, 4, 8 wit same result, the function returns always error 10228 (0x27f4)
Screenshot 2025-02-04 153916.jpg

I tryed also using ISP pins and connecting USART0 to external serial, and ISP answer right to command "?" (0x3f)

Where I wrong?
Could help me to solve this issue?

Many thank

Abele Barbieri - Italy

 

Labels (1)
0 Kudos
Reply
8 Replies

1,466 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @abele_barbieri 

The parameter for selecting the ISP mode is set as 1, which represents USART.

Please note that you should enable the clocks for the default USART RXD and TXD pins before calling this command.

 
 

BR

Alice

0 Kudos
Reply

1,457 Views
abele_barbieri
Contributor I

Many thanks Alice for the quick reply
The UART0 (as I writed) is configured and activated BEFORE invoking the function. I tried further tests, and I discovered that the IAP_ReinvokeISP seems "wrong" in the project where I need to enter ISP by user code (this project is several years old)

Screenshot 2025-02-05 095127.png

I tried in new project, and it works fine. Here below the "upgraded" IAP_ReinvokeISP that I have found in fsl_iap.c file

Screenshot 2025-02-05 100259.png

Using this versione It work also on this old project.
A further important question:
the board that need to program via ISP has only the UART0 RX & TX signals ruoted the ISP host board (that perform the programming), and we heve no chance to power off o reset the target board to restart it.
There is an ISP command that can be sent to target to force "exit" from ISP mode at end of programming? 

Abele Barbieri

0 Kudos
Reply

1,451 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @abele_barbieri 

 

Yes, ISP Go command.

go.jpg

 

Hope it helps you.

 

BR

Alice

 

0 Kudos
Reply

1,448 Views
abele_barbieri
Contributor I

Thanks Alice
This means that I has to know what the address of reset code, in other words, where is locate the ResetISR() startup function?

 

0 Kudos
Reply

1,428 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @abele_barbieri 

By default, the address of  reset is 0x00.

 

BR

Alice 

0 Kudos
Reply

1,422 Views
abele_barbieri
Contributor I

I'm sorry Alice, but if I invoke the "GO" command with address 0 the board never restart
Thne, I have "sniffed" the comunication at end of Flash Magic, an here below the result

Screenshot 2025-02-07 110545.png

Seems the GO is on RAM address ... could you help me about?

 

0 Kudos
Reply

1,408 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @abele_barbieri 

How about using the same address with Flash Maigc?

 

BR

Alice

0 Kudos
Reply

1,294 Views
abele_barbieri
Contributor I

Hello Alice,
I tried to send "G" command using Flash Magic as you said ...

Here below the test I made, but the target don't restart

Screenshot 2025-02-13 123059.png

If I try as here, the target restarts. It seems that needs to load a code into RAM and then send G command to this area. Could you verify and send me more details about this behaviour and how I can integrate it on my code?

Thanks

Abele

Screenshot 2025-02-13 122812.png

0 Kudos
Reply