LPC54102 IAP

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

LPC54102 IAP

844 Views
eu_mtaverna
Contributor III

Hi all,

I'm working on a dual core project (CM4 Master + CM0 Slave) with LPC54102 and MCUXpresso IDE.

The project works correctly and I able to debug or download the projects (Master and Slave)  on the customer board by the NXP probe connected to the customer board.

Now I want to implement an on field upgrade procedure in order to upgrade the board, if necessary, when it will be installed.

The board is equipped with a SPI Flash device that I want to use to store the upgraded .bin files so, I want the LPC checks the SPI Flash at boot time and starts with the upgrade procedure if an upgrade file is found on the SPI Flash.

I think the way is to implement the IAP functions but I am a little bit confused. I have not understood how this functions works with a Dual core project. 

Actually I have two  files (Master.bin and Slave.bin), What is the way to flash both files to the LPC54102 using the IAP functions?

Can anyone point me to a guide?

Thanks a lot.

0 Kudos
8 Replies

836 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi eu_mtaverna 

slave bin file content is also included in master bin file. So when download master bin, both master and slave codes are programmed.

Regarding to implement IAP in secondary bootloader, please refer AN11610

https://www.nxp.com/docs/en/application-note/AN11610.zip

Hope this helps,

Jun Zhang

833 Views
eu_mtaverna
Contributor III

Tanks for your support, I just take a look to the application note you have suggested.

The scenario explained in the application note is not exactly my scenario.

If I have understood the application note suppose that the host controller is directly connected to the LPC54102 by SPI interface and the upgrade driver has to be developed on the host controller.

This solution require to develop the Host driver, and download the second bootloader on the LPC. Is it correct?

In my case a SPI flash memory device is shared by the Host controller and LPC54102. My target is the host controller writes the .bin file on the SPI flash memory and then the LPC54102 read the .bin file from the SPI flash device and starts with the upload process yourself by the IAP functions.

Since my host controller already is able to write the SPI flash memory device, I have to develope the only LPC update driver.

Do you think my solution is feasible?

Tanks in advence

0 Kudos

807 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

>> This solution require to develop the Host driver, and download the second bootloader on the LPC. Is it correct?

Yes, correct.

LPC54102 IAP can't read SPI Flash.  User needs to implement code to read SPI Flash.

 

0 Kudos

805 Views
eu_mtaverna
Contributor III

Hi, Thanks for replay,

Yes, I have write the SPI Flash read drivers an it work. Unfortunately I have some issue during the LPC Flash Write procedure using IAP functions.

Where this functions are runnig from? LPC Flash region or RAM? 

It's possible to Erase/Write LPC Flash Sector by IAP functions while the main application  is running or it's needed to configure the linker in order to put the IAP and SPI functions in a Flash region that I will not go to update?

 

0 Kudos

797 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

The function is run from Flash.

You can program Flash while the code is running. 

I suggest you checking flashiap SDK demo code for its usage.

Thanks,

Jun Zhang

0 Kudos

793 Views
eu_mtaverna
Contributor III

I have take a look to the iap demo project but it flashs only the sector 1 of the LPC Flash memory.

I think it works because the iap demo project, due to his little memory occupation, is stored in sector 0 and it occupies only this sector . The iap demo flashs only sector 1!! It doesn't try to flash sector 0 itself..

In my application the code occupies more than one sector and I want to flash the entire Flash memory region (sector 0 to sector 15). I noted that when I try to Flash the sectors were my code is stored the application crashes.. Otherwise if try to flash a sector were my code isn't stored the Flash algoritm seems to works.

My opinion is that it's not possible to Flash the sectors were the iap functions are running because this operation will be erase the code and the iap functions itself and this causes the crashes.

I think it's needed to run the iap and spi functions on RAM memory or on one Flash sector will be not flashed.

Could you think about?

Thanks

 

0 Kudos

786 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Yes, you can copy your appliaction code to RAM and run it from RAM.

IAP code is in Boot ROM but not 512KB on chip Flash memory. So it will not be erased.

ZhangJennie_0-1669378257830.png

 

 

 
 

 

 

782 Views
eu_mtaverna
Contributor III

Thanks for your support.... you are trhe best!!!

Ciao

0 Kudos