KW45 Production Binary

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

KW45 Production Binary

1,471 Views
Arjv
Contributor II

I am trying to do the generate a single binary for mass production following the AN14003 and I am facing some issues. I was not successful with the jupyter part for generating the keys and creating the secure binaries. For that part I am using the SPSDK CLI tool that was mentioned in an nxp forum thread (https://community.nxp.com/t5/Wireless-MCU/KW45-Sb3-file/m-p/2181239#M20082), by downloading spsdk from https://github.com/nxp-appcodehub/dm-kw45-secure-boot-scripts (I mean for generating the keys and the sb3 files). But I am getting issues when I merge the Binary files as mentioned in the AN14003.

As per the document, i gave used the otap_client_freertos sdk example and did modifications as mentioned. and generated the bin file. Then I opened the otap_client_freertos.bin & kw45b41_nbu_ble_xp_hosted.sb3 files in a hex editor and copied the contents of the sb3 file to the address 0x7A000 of the otap_client_freertos.bin as mentioned. I then loaded the merged binary to the SEGGER J-Flash utility for flashing the binary into the KW45. But the operation failed and after this, I am not even able to program a blinky example also. To recover from this condition I had to enter the ISP mode and erase the entire chip (I was not able to access the chip via SWD even for erasing it). The following is the error message I got when the flashing failed with the merged binary.

****************************************************************************************

Programming and verifying target (1040384 bytes, 1 range) ...

- Connecting ...

- Connecting via USB to probe/ programmer device 0

- Probe/ Programmer firmware: J-Link V9 compiled Dec 13 2022 11:14:50

- Probe/ Programmer S/N: 69730348

- Device "KW45B41Z83" selected.

- Target interface speed: 4000 kHz (Fixed)

- VTarget = 3.290V

- ConfigTargetSettings() start

- ConfigTargetSettings() end - Took 499us

- InitTarget() start

- SWD selected. Executing JTAG -> SWD switching sequence.

- ROM entered ISP command handling loop. Re-enable the debug access.

- InitTarget() end - Took 117ms

- Found SW-DP with ID 0x6BA02477

- DPv0 detected

- CoreSight SoC-400 or earlier

- AP map detection skipped. Manually configured AP map found.

- AP[0]: AHB-AP (IDR: Not set, ADDR: 0x00000000)

- Iterating through AP map to find AHB-AP to use

- AP[0]: Skipped ROMBASE read. CoreBaseAddr manually set by user

- AP[0]: Core found

- CPUID register: 0x410FD214. Implementer code: 0x41 (ARM)

- Feature set: Mainline

- Cache: No cache

- Found Cortex-M33 r0p4, Little endian.

- Cortex-M (ARMv8-M and later): The connected J-Link (S/N 69730348) uses an old firmware module that does not handle I/D-cache correctly. Proper debugging functionality cannot be guaranteed if cache is enabled

- FPUnit: 8 code (BP) slots and 0 literal slots

- Security extension: implemented

- Secure debug: enabled

- ROM table scan skipped. CoreBaseAddr manually set by user: 0x80030000

- SetupTarget() start

- SetupTarget() end - Took 7.11ms

- Executing init sequence ...

- Executing Reset (0, 0 ms)

- ResetTarget() start

- No valid application programmed. Skipping reset.

- ResetTarget() end - Took 1.18ms

- Device specific reset executed.

- Initialized successfully

- Target interface speed: 4000 kHz (Fixed)

- Found 1 JTAG device. Core ID: 0x6BA02477 (None)

- Connected successfully

- Checking if selected data fits into selected flash sectors.

- Start of preparing flash programming

- End of preparing flash programming

- Start of determining dirty areas in flash cache

- End of determining dirty areas

- CPU speed could not be measured.

- Start of flash programming

- Programming range 0x00000000 - 0x00007FFF ( 4 Sectors, 32 KB)

- End of flash programming

- ERROR: Program failed

- Start of restoring

- ERROR: Failed to restore target. RAMCode never stops

- End of restoring

- ERROR: Failed to program and verify target

WARNING: Supply voltage too low or too high, disconnecting target! VTarget = 0.000V

Disconnecting ...

- Disconnected

**********************************************************************************************

It appears like the area we are attempting to program is 0x00000000 - 0x00007FFF & as per the document the NBU firmware is copied to 0x7A000 which is beyond this range.

Please correct me if I'm wrong here.

0 Kudos
Reply
3 Replies

1,448 Views
luis_maravilla
NXP Employee
NXP Employee

Hello,

Could you help us confirm the following?

Are you using a NXP development board [KW45B41Z-EVK / KW45-LOC] or a custom board? as this will influence in the necessary keys; also, could you help us confirm if you have burned the fuses already?

Could you help us bring more details about the error in generating the keys? Or share the error message, It would be highly appreciated.

I notice that the NBU that you are using is [kw45b41_nbu_ble_xp_hosted.sb3].

The differences between the NBU versions are described as this:

"nbu_ble_hosted" is the standard BLE 5.3 controller firmware that supports general BLE features.

"nbu_ble_xp_hosted" stack enables experimental features such as DBAF and ACS.

Could you help us try using the nbu_ble_hosted.sb3 file instead?

Best Regards

Luis

0 Kudos
Reply

1,406 Views
Arjv
Contributor II

Dear Luis

Thank you for the reply...

"Are you using a NXP development board [KW45B41Z-EVK / KW45-LOC] or a custom board? as this will influence in the necessary keys; also, could you help us confirm if you have burned the fuses already?"

we have designed a custom BLE Module out of KW45 and are working on that module. We have burned the default NXP keys already into the module. we have tested the module with a basic wireless sdk example(ancs_client).

"Could you help us bring more details about the error in generating the keys? Or share the error message, It would be highly appreciated."

I am able to generate the keys using the SPSDK scripts provided github link that I had mentioned in my original query. the error here I'm getting is while flashing the combined binary.  AS i mentioned, the J-Flash tool is trying to flash the memory in the range 0x00000000 - 0x00007FFF (4 Sectors, 32 KB). But the SB3 file is being copied to 0x7A000 (as per AN14003) which is beyond this range. 

"Could you help us try using the nbu_ble_hosted.sb3 file instead?"

As you suggested, we tried with nbu_ble_hosted.sb3 and the results were same.

 

0 Kudos
Reply

1,382 Views
luis_maravilla
NXP Employee
NXP Employee

Hello

Could you help us confirm if you add a padding of 0x00 between the valid signedcm33.bin to 0x7A000 as the AN14003 Chapter 5.4 Figure 11?

This implies that the binary must include padding 0x00 between 0x00007FFF up to address 0x0007A000.

Best Regards

Luis

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2206725%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EKW45%20Production%20Binary%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2206725%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20trying%20to%20do%20the%20generate%20a%20%3CSTRONG%3Esingle%20binary%20for%20mass%20production%3C%2FSTRONG%3E%20following%20the%20%3CSTRONG%3EAN14003%3C%2FSTRONG%3E%20and%20I%20am%20facing%20some%20issues.%20I%20was%20not%20successful%20with%20the%20jupyter%20part%20for%20generating%20the%20keys%20and%20creating%20the%20secure%20binaries.%20For%20that%20part%20I%20am%20using%20the%20SPSDK%20CLI%20tool%20that%20was%20mentioned%20in%20an%20nxp%20forum%20thread%20(%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FWireless-MCU%2FKW45-Sb3-file%2Fm-p%2F2181239%23M20082%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FWireless-MCU%2FKW45-Sb3-file%2Fm-p%2F2181239%23M20082%3C%2FA%3E)%2C%20by%20downloading%20spsdk%20from%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-appcodehub%2Fdm-kw45-secure-boot-scripts%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-appcodehub%2Fdm-kw45-secure-boot-scripts%3C%2FA%3E%20(I%20mean%20for%20generating%20the%20keys%20and%20the%20sb3%20files).%20But%20I%20am%20getting%20issues%20when%20I%20merge%20the%20Binary%20files%20as%20mentioned%20in%20the%20AN14003.%3C%2FP%3E%3CP%3EAs%20per%20the%20document%2C%20i%20gave%20used%20the%20%3CSTRONG%3Eotap_client_freertos%3C%2FSTRONG%3E%20sdk%20example%20and%20did%20modifications%20as%20mentioned.%20and%20generated%20the%20bin%20file.%20Then%20I%20opened%20the%20%3CSTRONG%3Eotap_client_freertos.bin%3C%2FSTRONG%3E%20%26amp%3B%20%3CSTRONG%3Ekw45b41_nbu_ble_xp_hosted.sb3%3C%2FSTRONG%3E%20files%20in%20a%20hex%20editor%20and%20copied%20the%20contents%20of%20the%20sb3%20file%20to%20the%20address%20%3CSTRONG%3E0x7A000%3C%2FSTRONG%3E%20of%20the%20%3CSTRONG%3Eotap_client_freertos.bin%3C%2FSTRONG%3E%20as%20mentioned.%20I%20then%20loaded%20the%20merged%20binary%20to%20the%20%3CSTRONG%3ESEGGER%20J-Flash%3C%2FSTRONG%3E%20utility%20for%20flashing%20the%20binary%20into%20the%20KW45.%20But%20the%20operation%20failed%20and%20after%20this%2C%20I%20am%20not%20even%20able%20to%20program%20a%20blinky%20example%20also.%20To%20recover%20from%20this%20condition%20I%20had%20to%20enter%20the%20ISP%20mode%20and%20erase%20the%20entire%20chip%20(I%20was%20not%20able%20to%20access%20the%20chip%20via%20SWD%20even%20for%20erasing%20it).%20The%20following%20is%20the%20%3CSTRONG%3Eerror%20message%3C%2FSTRONG%3E%20I%20got%20when%20the%20flashing%20failed%20with%20the%20merged%20binary.%3C%2FP%3E%3CP%3E****************************************************************************************%3C%2FP%3E%3CP%3EProgramming%20and%20verifying%20target%20(1040384%20bytes%2C%201%20range)%20...%3C%2FP%3E%3CP%3E-%20Connecting%20...%3C%2FP%3E%3CP%3E-%20Connecting%20via%20USB%20to%20probe%2F%20programmer%20device%200%3C%2FP%3E%3CP%3E-%20Probe%2F%20Programmer%20firmware%3A%20J-Link%20V9%20compiled%20Dec%2013%202022%2011%3A14%3A50%3C%2FP%3E%3CP%3E-%20Probe%2F%20Programmer%20S%2FN%3A%2069730348%3C%2FP%3E%3CP%3E-%20Device%20%22KW45B41Z83%22%20selected.%3C%2FP%3E%3CP%3E-%20Target%20interface%20speed%3A%204000%20kHz%20(Fixed)%3C%2FP%3E%3CP%3E-%20VTarget%20%3D%203.290V%3C%2FP%3E%3CP%3E-%20ConfigTargetSettings()%20start%3C%2FP%3E%3CP%3E-%20ConfigTargetSettings()%20end%20-%20Took%20499us%3C%2FP%3E%3CP%3E-%20InitTarget()%20start%3C%2FP%3E%3CP%3E-%20SWD%20selected.%20Executing%20JTAG%20-%26gt%3B%20SWD%20switching%20sequence.%3C%2FP%3E%3CP%3E-%20ROM%20entered%20ISP%20command%20handling%20loop.%20Re-enable%20the%20debug%20access.%3C%2FP%3E%3CP%3E-%20InitTarget()%20end%20-%20Took%20117ms%3C%2FP%3E%3CP%3E-%20Found%20SW-DP%20with%20ID%200x6BA02477%3C%2FP%3E%3CP%3E-%20DPv0%20detected%3C%2FP%3E%3CP%3E-%20CoreSight%20SoC-400%20or%20earlier%3C%2FP%3E%3CP%3E-%20AP%20map%20detection%20skipped.%20Manually%20configured%20AP%20map%20found.%3C%2FP%3E%3CP%3E-%20AP%5B0%5D%3A%20AHB-AP%20(IDR%3A%20Not%20set%2C%20ADDR%3A%200x00000000)%3C%2FP%3E%3CP%3E-%20Iterating%20through%20AP%20map%20to%20find%20AHB-AP%20to%20use%3C%2FP%3E%3CP%3E-%20AP%5B0%5D%3A%20Skipped%20ROMBASE%20read.%20CoreBaseAddr%20manually%20set%20by%20user%3C%2FP%3E%3CP%3E-%20AP%5B0%5D%3A%20Core%20found%3C%2FP%3E%3CP%3E-%20CPUID%20register%3A%200x410FD214.%20Implementer%20code%3A%200x41%20(ARM)%3C%2FP%3E%3CP%3E-%20Feature%20set%3A%20Mainline%3C%2FP%3E%3CP%3E-%20Cache%3A%20No%20cache%3C%2FP%3E%3CP%3E-%20Found%20Cortex-M33%20r0p4%2C%20Little%20endian.%3C%2FP%3E%3CP%3E-%20Cortex-M%20(ARMv8-M%20and%20later)%3A%20The%20connected%20J-Link%20(S%2FN%2069730348)%20uses%20an%20old%20firmware%20module%20that%20does%20not%20handle%20I%2FD-cache%20correctly.%20Proper%20debugging%20functionality%20cannot%20be%20guaranteed%20if%20cache%20is%20enabled%3C%2FP%3E%3CP%3E-%20FPUnit%3A%208%20code%20(BP)%20slots%20and%200%20literal%20slots%3C%2FP%3E%3CP%3E-%20Security%20extension%3A%20implemented%3C%2FP%3E%3CP%3E-%20Secure%20debug%3A%20enabled%3C%2FP%3E%3CP%3E-%20ROM%20table%20scan%20skipped.%20CoreBaseAddr%20manually%20set%20by%20user%3A%200x80030000%3C%2FP%3E%3CP%3E-%20SetupTarget()%20start%3C%2FP%3E%3CP%3E-%20SetupTarget()%20end%20-%20Took%207.11ms%3C%2FP%3E%3CP%3E-%20Executing%20init%20sequence%20...%3C%2FP%3E%3CP%3E-%20Executing%20Reset%20(0%2C%200%20ms)%3C%2FP%3E%3CP%3E-%20ResetTarget()%20start%3C%2FP%3E%3CP%3E-%20No%20valid%20application%20programmed.%20Skipping%20reset.%3C%2FP%3E%3CP%3E-%20ResetTarget()%20end%20-%20Took%201.18ms%3C%2FP%3E%3CP%3E-%20Device%20specific%20reset%20executed.%3C%2FP%3E%3CP%3E-%20Initialized%20successfully%3C%2FP%3E%3CP%3E-%20Target%20interface%20speed%3A%204000%20kHz%20(Fixed)%3C%2FP%3E%3CP%3E-%20Found%201%20JTAG%20device.%20Core%20ID%3A%200x6BA02477%20(None)%3C%2FP%3E%3CP%3E-%20Connected%20successfully%3C%2FP%3E%3CP%3E-%20Checking%20if%20selected%20data%20fits%20into%20selected%20flash%20sectors.%3C%2FP%3E%3CP%3E-%20Start%20of%20preparing%20flash%20programming%3C%2FP%3E%3CP%3E-%20End%20of%20preparing%20flash%20programming%3C%2FP%3E%3CP%3E-%20Start%20of%20determining%20dirty%20areas%20in%20flash%20cache%3C%2FP%3E%3CP%3E-%20End%20of%20determining%20dirty%20areas%3C%2FP%3E%3CP%3E-%20CPU%20speed%20could%20not%20be%20measured.%3C%2FP%3E%3CP%3E-%20Start%20of%20flash%20programming%3C%2FP%3E%3CP%3E-%20Programming%20range%20%3CFONT%20color%3D%22%230000FF%22%3E0x00000000%20-%200x00007FFF%3C%2FFONT%3E%20(%204%20Sectors%2C%2032%20KB)%3C%2FP%3E%3CP%3E-%20End%20of%20flash%20programming%3C%2FP%3E%3CP%3E-%20ERROR%3A%20Program%20failed%3C%2FP%3E%3CP%3E-%20Start%20of%20restoring%3C%2FP%3E%3CP%3E-%20%3CFONT%20color%3D%22%23FF0000%22%3EERROR%3A%20Failed%20to%20restore%20target.%20RAMCode%20never%20stops%3C%2FFONT%3E%3C%2FP%3E%3CP%3E-%20End%20of%20restoring%3C%2FP%3E%3CP%3E-%20ERROR%3A%20Failed%20to%20program%20and%20verify%20target%3C%2FP%3E%3CP%3EWARNING%3A%20Supply%20voltage%20too%20low%20or%20too%20high%2C%20disconnecting%20target!%20VTarget%20%3D%200.000V%3C%2FP%3E%3CP%3EDisconnecting%20...%3C%2FP%3E%3CP%3E-%20Disconnected%3C%2FP%3E%3CP%3E**********************************************************************************************%3C%2FP%3E%3CP%3EIt%20appears%20like%20the%20area%20we%20are%20attempting%20to%20program%20is%20%3CFONT%20color%3D%22%230000FF%22%3E0x00000000%20-%200x00007FFF%3C%2FFONT%3E%20%26amp%3B%20as%20per%20the%20document%20the%20NBU%20firmware%20is%20copied%20to%20%3CFONT%20color%3D%22%230000FF%22%3E0x7A000%3C%2FFONT%3E%20which%20is%20beyond%20this%20range.%3C%2FP%3E%3CP%3EPlease%20correct%20me%20if%20I'm%20wrong%20here.%3C%2FP%3E%3C%2FLINGO-BODY%3E