How to write secondary bootloader in MCUXpresso(LPC1768)??

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

How to write secondary bootloader in MCUXpresso(LPC1768)??

2,271 Views
md712538
Contributor II

Hello everyone,

First of all thanks you for your immediate helpful support.

I am working on FOTA(firmware update over the air).

I am using MCUxpresso tool id and lpc1768 MCU.

As a example i have Led_1 blinking code in MCU and i want to write Led_2 blinking code in the place of Led_1 code.

I have few concerns.

1)Failed to write internal flash (sector 0 to 15) by using IAP command. Sector preparing commands return error number 9.

2)When i received data(Led_2 blinking code) by UART and write in internal flash in any address(Sector16 to 20) and also updated  FIRMWARE_UPDATE_FLAG and then erase Led_1 code by iap cmd and then write Led_2 code in the address of Led_1 code.

When i erase Led_1 code so code execution is stopped.

3)But i want execute code from ram when i deleted Led_1 code from internal flash.

4) How can i write secondary bootloader for resloving these problem?

If u have any other better idea than secondary bootloader to resolve my concern so please suggest me?

If u have any demo code so please provide me link?

Thanks in advance.

Labels (1)
4 Replies

2,082 Views
ramanamadishett
Contributor II

Hi md712538@gmail.com,

As above suggested, you require a custom bootloader to flash the new firmware as addressed.

I request you to go thought the below  link for your reference. It is custom SPI bootloader implemented through sd card.

GitHub - triffid/LPC17xx-DFU-Bootloader: DFU Bootloader for LPC17xx family 

You require to download new firmware to the sd card via uart 4G connectivity. Once the new bin file saved inside the sd card, the system reset action need to be done.

After the reset, the custom boot will look over to dump the code as addressed.

Hope this helps.

0 Kudos

2,082 Views
converse
Senior Contributor V

Search for AN10866 - application note for boot loader for LPC1700

2,082 Views
md712538
Contributor II

This documents helpful for keil user but i am using MCU xpresso tool.

I alreday successfully initialize IAP cmd and all cmd working fine.

But problem is this how can i over write my code after receiving update

code by UART?

If i shoot IAP erase cmd to erasing old code that time my code execution is

stop because my code is erased.

I hope u understand my problem.

Thank you.

0 Kudos

2,082 Views
converse
Senior Contributor V
0 Kudos