ISP Mode from User Code

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

ISP Mode from User Code

2,411 Views
phateee
Contributor II

Hello,

can somebody help me?I try to get processor to ISP mode from user code. Is it possible?

thank you

Labels (2)
0 Kudos
Reply
10 Replies

1,885 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jan,

  Yes, you can!

   You can use the IAP command: reinvoke ISP.

39.jpg

In the community, there has a post for your reference:

Entering ISP from user code 

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,885 Views
phateee
Contributor II

Thank you for your info.

Now I can go to ISP mode by User - I use the system function Chip_IAP_ReinvokeISP(). It is ok.

But I try to send the command from terminal on PC, e.g. P 0 0 0<CR><LF>. But the processor doesn't comunicate.

I use USB0, it is in windows as QCUSB_COM5_2.

But when I try to use LPCScrypt and it works. I wil be use LPCScrypt, but I need it on LPC5461, but LPCScrypt is only for LPC18xx and LPC4xxx, not for LPC5461.

I need only go to ISP mode, load the program into processor and restart the processor.

Thank you

0 Kudos
Reply

1,885 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jan,

  Please tell me your board name, the chip name, I will try it on my side.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,885 Views
phateee
Contributor II

Hello,

I bought the board OM13094 with LPC 54618. I try to use ISP mode, beacuse I am moving on this processor and customer would like to do update by ISP.
I use the example lpcxpresso54608_driver_examples_flashiap and I try to boot to USB ISP - Reinvoke ISP, command 57.
So in the libray fsl_flashiap.c is not any function Reinvoke ISP, so I add my function to this library:

status_t Chip_IAP_ReinvokeISP( void )
{
uint32_t command[5], result[4];

command[0] = kIapCmd_FLASHIAP_ReinvokeISP; //57
command[1] = 8; //usb
iap_entry(command, result);
return translate_iap_status(result[0]);
}

and the function main:

int main(void)
{
Chip_IAP_ReinvokeISP();
while(1){ }
}

The result: ISP mode doesn't work. When I push the button ISP1 on the board, I get in Windows CRP DISABLD - this works.

I need to boot to ISP, load the new firmware and then reboot processor - Without buttons (remote desktop).

thank you for your help

0 Kudos
Reply

1,885 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jan

Thank you very much for your patience.
I have checked USB ISP enter code again, it's wrong, I modified it again, it works now.
From user manual, Reinvoke ISP input is:Command code: 57 (decimal), Param0: Pointer to ISP parameter structure. See Table 78.
You and I all write the wrong code, param0 is the pointer to ISP parameter structure, not the data directly.
Now, I modified the code like this:
status_t Chip_IAP_ReinvokeISP( void )
{
uint32_t command[9], result[4];
uint8_t Param[8];
uint8_t *p=Param;
Param[0] = 0;
Param[1] = 8; //usb 8// 6 usart
Param[2] = 0;
Param[3] = 0;
Param[4] = 0;
Param[5] = 0;
Param[6] = 0;
Param[7] = 8;

command[0] = kIapCmd_FLASHIAP_ReinvokeISP; //57
command[1] = (uint32_t )p;

iap_entry(command, result);
return translate_iap_status(result[0]);
}
Now, I can ener the USB ISP mode now, is the same function as the ISP1 pin enter.
After you call Chip_IAP_ReinvokeISP, please also connect a USB port in J3, then you will find a device named as: CRP DISABLED
Then open CRP DISABLED, delete the firmware.bin file, change your own application bin file as firmware.bin, and copy it to CPR DISABLED, press the reset button.
You will find the application code work.
Please try it on your side.
Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,885 Views
phateee
Contributor II

Hello,

I tried it and it works...

thank you

0 Kudos
Reply

1,885 Views
phateee
Contributor II

Thank you for your infomation..I will try it today...:)  

And is any possibility, how restart processor without buttons only with software?

Thanks

0 Kudos
Reply

1,885 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jan,

   This is also a question, I am also considering this point, because you actually don't want to touch the board after downloading the app by USB bootloader ISP.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,885 Views
phateee
Contributor II

Yes, ISP UART is very good, that you can restart processor only with SW:)

0 Kudos
Reply

1,885 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jan,

   Thank you for your updated information.

   I have reproduced your problem on my side, I will do the deep research, any updated information from my side, will let you know.

  Please wait patiently.

   Thanks a lot for your understanding.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply