How can i update software of our device on field without open the machine, with the help of Usb boot mode??

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

How can i update software of our device on field without open the machine, with the help of Usb boot mode??

1,435 Views
monarchbaxi
Contributor II

Dear,

we were able to program the controller using USB boot mode and using the utility DFUSEC_V1_11 available on NXP website
We have used the following hardware configuration
P2_7 -->  LOW
P2_9 --> LOW
P1_1 -->  LOW
P2_8 --> HIGH
P1_2 -->HIGH

However once the firmware is downloaded in the controller we were not able to reprogram it using the USB IAP mode.
To reprogram the device we had to again configure pin P2_7 --> LOW, but we cannot pull this pin to GND if we require to reprogram the device on field without opening the instrument .

It is Ok for us to Pull the pin P2_7to GND when the device is programmed for the first time, but we need to avoid this when we need to re-program the device on field

As such can u pl let us know the procedure / set of commands that can be used to re-program the device without configuring pin P2_7 (LOW)

0 Kudos
11 Replies

1,132 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Monarch BAXI ,

Thank you for your interest in NXP Semiconductor products and the opportunity to serve you.

Before answer your question, I was wondering if you can tell what chip you use.
Have a great day,
Ping

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

0 Kudos

1,132 Views
monarchbaxi
Contributor II

Dear ,

Thanks for your quick reply , I am using NXP LPC4357 .

0 Kudos

1,132 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Monarch BAXI ,

There's the trick to 'set' the P2.7 ='0'.

Right before calling the IAP_Reinvoke_ISP function, write 0x00000018 to the ISFSP2_7 register. Then regardless of the actual voltage at the P2.7 pin, the boot code will always read it as 0.
Have a great day,
Ping

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

0 Kudos

1,132 Views
monarchbaxi
Contributor II

Thanks for a quick reply . I tried doing this

ISFSP2_7 |= ( 1 << 4 ) | (1 << 3 ) ;//0x00000018;
  Chip_IAP_ReinvokeISP();

But with this, it is giving following error

systemsetup.c(3942): error:  #20: identifier "ISFSP2_7" is undefined
                ISFSP2_7 |= ( 1 << 4 ) | (1 << 3 ) ;//0x00000018;
systemsetup.c: 0 warnings, 1 error

Thanks

0 Kudos

1,132 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Monarch BAXI ,

Thanks for your reply.

Let me make it clear.

Before write or read the ISFSP2_7 register, you must assure the pointer ISFSP2_7 should point the address 0x4008_611C (Fig 1).

However in the LPCOpen, it has already doen the job for the customer, you can use the LPC_SCU->SFSP[2][7] directly.

Please have a try.

2016-10-19_9-46-24.jpg


Have a great day,
Ping

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

0 Kudos

1,132 Views
monarchbaxi
Contributor II

Hi,

Thanks for the reply, as per your suggestion the code got compiled but with this the device (LPC 4357) is not going in USB boot mode

Pl find below the code that we have used

------------------------------------------------------------------

LPC_SCU->SFSP[2][7]  = ((1 << 3) | (1 << 4));//0x00000018;
Chip_IAP_ReinvokeISP();

--------------------------------------------------------------

void Chip_IAP_ReinvokeISP(void)
{
    paramin[0] = IAP_REINVOKE_ISP;
    iap_entry(paramin, paramout);

}

Thanks

0 Kudos

1,132 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Monarch BAXI ,

Thanks for your reply.

I've also adapted the codes and please refer to them for details

LPC_SCU->SFSP[2][7]  = ((1 << 3) | (1 << 4));//0x00000018;
// Set the P2.7pin  to be low
Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0x0, 7); Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0x0, 7, false);Chip_IAP_ReinvokeISP();‍‍‍


Have a great day,
Ping

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

0 Kudos

1,132 Views
monarchbaxi
Contributor II

Thanks for your reply, we tried doing this but we were not able to program it using USB Boot Mode.

We are following the below mentioned steps

1--> We have an input button... when we press this the following code gets executed

        LPC_SCU->SFSP[2][7]  = ((1 << 3) | (1 << 4));//0x00000018;
        // Set the P2.7pin  to be low
        Chip_GPIO_SetPinDIROutput(
LPC_GPIO_PORT, 0x0, 7);
        Chip_GPIO_SetPinState(
LPC_GPIO_PORT, 0x0, 7, false);
        Chip_IAP_ReinvokeISP();

2--> Then Using DFU Programmer tool (version dfusec_v1_11) we are selecting the .bin file and we are trying to program it (this will be using USB boot mode -- on USB1), but when we do this DFU utility gives an error  "DFU download of programming algorithm failed"

But when we physically pull down P2.7 and use the DFU utility then we are able to program the controller

Do we need to set pin2.5 High

We are using IAP_REINVOKE_ISP command in Chip_IAP_ReinvokeISP()

But the User manual also states that

 This command is used to invoke the boot loader in ISP mode. It configures
UART0 pins U0_RX and U0_TX. so is this command ok for USB boot mode

Pl advise

0 Kudos

1,132 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Monarch BAXI,

Sorry, I recognized that I had made a mistake after I contacted with some AE.

Actually, the IAP Re-invoke ISP will force the MCU boot from device connected to the USART0, in another word, the command can't make the MCU boot from the USB.

Sorry for bringing any inconveniences to you.
Have a great day,
Ping

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

0 Kudos

1,132 Views
monarchbaxi
Contributor II

Hi, No problem and thanks for all your help, please do let us know in case if you come across some solution to boot LPC4357 from USB and without physically pulling down P2.7

0 Kudos

1,132 Views
bernhardfink
NXP Employee
NXP Employee

Just to close this thread with a potential solution for the problem:

https://community.nxp.com/thread/419584 

0 Kudos