Part Number: MSP432P401R
Hi,
We are attempting to update application firmware by using the bootloader inJTAG/SWD lock mode. The reference document for our testing is: www.ti.com/.../slau690e.pdf
The unencrypted firmware binary is first transferred via custom firmware into the memory location: 0x0002.0000 (as shown on Figure 10 of the manual above)
JTAG/SWD lock parameters are set to their default state and flashmailbox is cleaned out prior to update.
Then we configure the flashmailbox as shown below:
/* Setup the flash mailbox */ uint8_t flashMailBox[0x290]; memset(flashMailBox, 0xFF, sizeof(flashMailBox)); /* Unprotecting Info Bank 0, Sector 0 */ FlashCtl_unprotectSector(FLASH_INFO_MEMORY_SPACE_BANK0, FLASH_SECTOR0); /* Erase the flash mailbox */ FlashCtl_eraseSector((uint32_t) flashMailBox_ptr); /* Set flash mailbox start */ * (uint32_t *) (&flashMailBox[0x0000]) = (uint32_t) 0x0115ACF6; /* Set flash mailbox command to firmware update (SEC_ZONE0_UPDATE ) */ * (uint32_t *) (&flashMailBox[0x0004]) = COMMAND_JTAG_SWD_LOCK_ENC_UPDATE | COMMAND_JTAG_SWD_LOCK_SECEN; /* Enable JTAG/SWD lock */ * (uint32_t *) (&flashMailBox[0x0010]) = (uint32_t) 0x00000000; /* Set address of uploaded firmware */ * (uint32_t *) (&flashMailBox[0x01F8]) = (uint32_t) 0x00020000; /* Set length of uploaded firmware */ * (uint32_t *) (&flashMailBox[0x01FC]) = (uint32_t) sector * D_OS2SAS_SYS_FLASH_SECTOR_LENGTH + 0x10; /* Set the destination address after decryption */ * (uint32_t *) (&flashMailBox[0x0200]) = (uint32_t) 0x00001000; /* Set flash mailbox end */ * (uint32_t *) (&flashMailBox[0x028C]) = (uint32_t) 0x0011E11D; /* Program the flash mailbox */ FlashCtl_programMemory(&flashMailBox, flashMailBox_ptr, sizeof(flashMailBox)); /* Protecting Info Bank 0, Sector 0 */ FlashCtl_protectSector(FLASH_INFO_MEMORY_SPACE_BANK0, FLASH_SECTOR0);
Basically, the code above sets the flashmailbox configuration to exactly what Figure 14 in the reference manual states. We do not invoke any BSL hardware pin parameters since the firmware update is being done internally and not via JTAG/SWD or BSL.
Few questions:
Can it be assumed that the application firmware memory address destination is 0x0000.1000 as shown in the manual?
Is there an acknowledgement field for successful update via JTAG/SWD lock firmware update as there is in the Secure IP Zone Update (0xACE vs 0xDEAD)? How do we confirm it updated the firmware correctly? Is there maybe even a way to perform this update without JTAG/SWD lock since we are doing it internally (triggered by custom UART driver calling the update firmware) not by an external interface.
Regarding the GUI (MSP432P4xx Security and Update Tool) - www.ti.com/.../MSP432-SECURITY-AND-UPDATE-TOOL
On the JTAG/SWD Lock Update tab - Update Firmware within the program, How do we generate an output encrypted firmware image? Does the encrypted version of the firmware need to be the input binary to the update?
Last question, why has the tool been deprecated as of Rev D? Couldn't find the exact reference in the SLAA700A that pertains to this functionality.
Thank you,
Best,
Robert