hi,
I was reading the thread, and I understood that you were trying to follow the steps mentioned in the AN14003, to generate a single binary to program the KW45 using SWD. Since this thread is a bit older, Were you successful in that?
I am trying to do the same here 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 this same thread, (I mean for generating the keys and the sb3 files). But I am getting issues when I merge the Binary files.
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.