LPC54018 IOT OM40007 flash via UART 0

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

LPC54018 IOT OM40007 flash via UART 0

Jump to solution
711 Views
jamie3
Contributor II

Hi,

I am trying to flash the QSPI flash on an OM40007 via the UART (I have had USB DFU and BLHost working but as the IAP command for DFU is non functional (as described in the ERRATA) I now need a way to flash code from the UART  

I have a few questions.

1. Can you tell me where the Flashloader source code is for the 54018 IOT board ? I have looked in the SDK and the bootloader folder isnt included and the bootloader in the 54018 SDK doesnt seem to work when used with BLHOST. 

2.What program/utilitie can I use to load the flashloader into the SRAMX using the UART to be able to used BLHost.

 

Regards

 

Jamie Lowrie

0 Kudos
Reply
1 Solution
682 Views
jamie3
Contributor II

Thankyou for the great answer.

View solution in original post

0 Kudos
Reply
2 Replies
683 Views
jamie3
Contributor II

Thankyou for the great answer.

0 Kudos
Reply
684 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @jamie3 

1)USB DFU mode, refer to:

https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/Use-blhost-to-program-erase-LPC54-S-0xx-...  

 

2) UART ISP command. below is method from our SE team:

In order to program the SPIFI flash, the flashloader has to be placed in to the RAM and execute from there.

The entire procedure can be described as follows:

  1. Put the device into ISP mode
  2. Synchronize USART ISP interface
  3. Write the content of flashloader.bin to SRAMX (0x0000_0000)
  4. Use Go command to start the execution of the flashloader
  5. Communicate with the flashloader using blhost

For step 2-4, please refer to the attached archive, which contains a simple python script to download and execute the flashloader using the ISP commands. Please also note this script is for reference only and comes without waranty, thus should not be used in production.

In order to use the script, the following steps should be performed:

  1. Extract the contents of the archive to a directory
  2. Prepare Python3 environment
  3. Open a command line window, navigate to the extracted directory, and execute: pip install -r requirements.txt
  4. Connect the board's ISP UART to the computer and put the device into ISP mode
  5. Modify the connection parameters located in pyisp.py, such as port and baud rate (see below).
  6. In the same directory, execute: python pyisp.py

Parameter settings:

Alice_Yang_0-1702889344057.png

 

If everything has been set up correctly, the following output can be observed in the commandline window:

Alice_Yang_1-1702889344242.png

 

The flashloader should be running by now, and with blhost, we can communicate with the flashloader.

The source code of the flashloader can be obtained from SDK bootloader_examples/flashloader

Please refer to "Getting Started with LPC540xx/LPC54S0xx Flashloader User's Guide" for further configuration of the SPIFI flash. Note the connection mode should be UART instead of USB:

Alice_Yang_2-1702889344186.png

 

Alice_Yang_3-1702889344101.png

 

The SPIFI configuration word should be placed outside of the reserved region:

Alice_Yang_4-1702889344067.png

 

Alice_Yang_5-1702889344091.png

 

Alice_Yang_6-1702889344086.png

 

Then the user should be able to erase or program the external flash memory:

Alice_Yang_7-1702889344081.png

 

 

BR

Alice

0 Kudos
Reply