Step by Step Guide to update user firmware through host interface for PN7642

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

Step by Step Guide to update user firmware through host interface for PN7642

Step by Step Guide to update user firmware through host interface for PN7642

 

Some customers are trying to update the user firmware on PN7642 through host interface and using “DownloadLibEx1” demo,  and they are using SFWUMaker to create .esfwu file from .bin followed the readme file but failed to do a firmware update. Here is a step-by-step guide to do it. I will use the SDK led blinky demo,  and generate an Esfwu file , and program it into PN7642 board with LPC5516 host.  Led blinky demo is in PN7642_MCUXpresso_SDK_02-15-00_PUB.  You can download it from PN7642 product page.  Single-Chip Solution with High-Performance NFC Reader, Customizable MCU and Security Toolbox | NXP S...

Step 1: compile pnev7642fama_led_blinky demo

Please make sure the flash size is 180KB.  By default,  the output flash size is 180KB with MCUXpresso IDE.

danielchen_0-1727969697151.png

 

 

Step 2: Bin file generation

The binary (.bin) file is not generated by default, we can do it manually by doing following:

  1. Build your target application
  2. Open the debug/release folder in MCUXpresso
  3. Right-click on the *.axf file
  4. Choose 'Binary Utilities' → 'Create binary' in the menu
  5. The .bin should appear
danielchen_1-1727969750247.png

 

Step 3: Make an ESFWU file

To convert a bin file to an ESFWU file, we can use the ESFWU Maker Utility (sw810311). It can be downloaded from PN7642 product page. It is a secure file, and you need to have an active NDA to get it. 

To run this utility, the toml file is very important.  You need to change the output name and binary name according to your project ,  and  you need to use the correct aes_root_key. For other parameters, we left them unchanged.

 

3.1   change the output name and binary name

danielchen_2-1727969831738.png

 

3.2 set the correct aes_root_key

The application flashed via SWD is a bin file and NOT encrypted neither is it flashed with our bootloader. The .esfwu file via host interface is encrypted and flashed by our own bootloader.  The keys have to be valid, else the bootloader will not be able to decrypt the received file.

Please make sure we are using the right keys to create the user application firmware.  This is crucial and without it, it won’t work anyways. The default keys are mentioned in the datasheet as transport keys. See below picture.  But it is highly recommended to provision your own keys!  Please have a look at the secure key mode application note for further information on that.

 

danielchen_3-1727969857833.png

 

danielchen_4-1727969899780.png

 

 If you are not sure whether you have provisioned the root key or not, you can check the SKM state by running SKM demo. if the root key is provisioned, please use the provisioned root key.  From below picture, I can see that the app_root_key is  not provisioned, so I use the default transport key.

danielchen_5-1727969952354.png

 

  3.3  use the EsfwuMaker command to generate the Esfwu file.

 

danielchen_6-1727969995698.png

 

After this command, we can get the esfwu file.

 

danielchen_7-1727970036883.png

 

 

Step 4: Secure firmware download

 

We use the firmware download example to update the PN7642 firmware.  It is in the host software package, it  holds examples to be used with LPC55S16 and MCUXpresso, to interact with the PN7642. The LPC55S16 Host Software can be download from PN7642 product page.

LPC55S16 Host Software Version 02.01.00 (nxp.com)

To run the demo, we need to edit the firmware location.  In file DownloadLibEx1.c,  about line 60.

 

danielchen_8-1727970075699.png

 

 

Please set the correct hardware settings as below.  we have to stack the PNEV7642A Rev-B development board on top of the LPC55S16-EVK board.

Align Pin.1 of J36 of the PNEV7642A Rev-B development board with Pin.1 of J9 of the LPC55 board. The last 4 pins, 17 - 20, of J12 of the LPC board are not connected. As well as pin 1-4 of J10 stay unconnected, as below picture shows.

 

danielchen_9-1727970111317.png

 

 

Run the firmware download Demo with LPC55s16,  see the log output below.  Choose option “6” to update your application firmware. The update may take a while.  At the end, a successful update is indicated by the prompt of “Successful firmware upload ”.  

 

danielchen_10-1727970154067.png

 

 

To verify it is successful, we can run this demo, please keep J65 open.  you will see the D7 (RED LED) blinky (0.5 HZ rate). If you need the pnev7642fama_led_blinky.esfwu, please let me know.

 

 

No ratings
Version history
Last update:
‎10-03-2024 08:48 AM
Updated by: