Microchip PIC32CK Product Lifecycle

From SEGGER Knowledge Base
Jump to navigation Jump to search

The PIC32CK series of devices optionally includes ARM TrustZone features and comes with enhanced device lifecycle management. SEGGER implemented support for these features via a dedicated utility called Device Provisioner. For more information about this, please refer to the Device Provisioner article. PIC32CK lifecycle management features are implemented in the PCode_DevPro_Microchip_PIC32CK.pex script file.

Important information

  • Programming of the non-secure flash memory region is possible only if the device has valid secure firmware that performs memory configuration.
  • Debug access level (DAL) can only be set to a lower value. In most cases, it can be set back to 2 using the Erase operation with the parameter Type=ERASE_ALL

Usage

DevPro -operation [operation_name] -if SWD -speed 4000 [-SetConfigVal parameter_name=value] -ScriptFile PCode_DevPro_Microchip_PIC32CK_.pex
Operation Parameters Values Description
GetDAL - - Displays the current DAL level.
SetDAL Value Required DAL value. Must be lower than the current one. Sets the DAL level. Changing DAL may restrict access to memory and debug features.
ProgNS Address Non-secure address. The non-secure address range is configured by secure firmware. Programs non-secure memory using the BootROM API.
BinFile A path to a non-secure binary file.
Erase Type ERASE_NS Erases device memory using the BootROM API.
ERASE_S
ERASE_ALL
Key Optional key value for authorizing the erase command. [1]
  1. If the user does not specify the key value, it will be read from the device’s internal memory. The key value must be provided in hexadecimal format as four 32-bit values with a 0x prefix, and each value must contain exactly 8 hexadecimal digits. Example: 0x12345678, 0x90ABCDEF, 0x00000055, 0x00000000

Examples

Get DAL

Example
DevPro.exe -operation GetDAL -if SWD -speed 4000 -ScriptFile "PCode_DevPro_Microchip_PIC32CK.pex"
SEGGER Device Provisioner V9.49
Compiled Jun  3 2026 16:29:06
Command line: -operation GetDAL -if SWD -speed 4000 -ScriptFile PCode_DevPro_Microchip_PIC32CK.pex
Firmware: J-Link V12 compiled May 26 2026 15:13:57
S/N: 602000001

J-Link log: Device DAL: 0x00000001

Set DAL

Example
DevPro.exe -operation SetDAL -SetConfigVal "Value=1" -if SWD -speed 4000 -ScriptFile "PCode_DevPro_Microchip_PIC32CK.pex"
SEGGER Device Provisioner V9.49
Compiled Jun  3 2026 16:29:06
Command line: -operation SetDAL -SetConfigVal Value=1 -if SWD -speed 4000 -ScriptFile PCode_DevPro_Microchip_PIC32CK.pex
Firmware: J-Link V12 compiled May 26 2026 15:13:57
S/N: 602000001

J-Link log: Version: V1.00.0
J-Link log: Device DAL: 0x00000001
J-Link log: DAL value set successfully.

ProgNS

Example
DevPro.exe -operation ProgNS -if SWD -speed 4000 -SetConfigVal "Address=0x0C100000" -SetConfigVal "BinFile=C:\Microchip_PIC32CK\test_data.bin" -ScriptFile PCode_DevPro_Microchip_PIC32CK.pex
SEGGER Device Provisioner V9.49
Compiled Jun  3 2026 16:29:06
Command line: -operation ProgNS -if SWD -speed 4000 -SetConfigVal Address=0x0C100000 -SetConfigVal BinFile=C:\Microchip_PIC32CK\test_data.bin -ScriptFile PCode_DevPro_Microchip_PIC32CK.pex
Firmware: J-Link V12 compiled May 26 2026 15:13:57
S/N: 602000001

J-Link log: Version: V1.00.0
J-Link log: Programming non-secure memory at address: 0x0C100000
J-Link log: Programming non-secure memory at address: 0x0C101000
J-Link log: Programming non-secure memory at address: 0x0C102000
J-Link log: Programming non-secure memory at address: 0x0C103000
J-Link log: ProgNS completed successfully.

Erase with custom password

Example
DevPro.exe -operation Erase -if SWD -speed 4000 -SetConfigVal "Type=ERASE_ALL" -SetConfigVal "Key=0x01234567, 0x01234567, 0x01234567, 0x01234567" -ScriptFile "PCode_DevPro_Microchip_PIC32CK.pex"
SEGGER Device Provisioner V9.49
Compiled Jun  3 2026 16:29:06
Command line: -operation Erase -if SWD -speed 4000 -SetConfigVal Type=ERASE_ALL -SetConfigVal Key=0x01234567, 0x01234567, 0x01234567, 0x01234567 -ScriptFile PCode_DevPro_Microchip_PIC32CK.pex
Firmware: J-Link V12 compiled May 26 2026 15:13:57
S/N: 602000001

J-Link log: Version: V1.00.0
J-Link log: Using key:
J-Link log: 67 45 23 01 67 45 23 01 67 45 23 01 67 45 23 01
J-Link log: Device DAL: 0x00000002

Erase with password from memory

Example
DevPro.exe -operation Erase -if SWD -speed 4000 -SetConfigVal "Type=ERASE_ALL" -ScriptFile "PCode_DevPro_Microchip_PIC32CK.pex"
SEGGER Device Provisioner V9.49
Compiled Jun  3 2026 16:29:06
Command line: -operation Erase -if SWD -speed 4000 -SetConfigVal Type=ERASE_ALL -ScriptFile PCode_DevPro_Microchip_PIC32CK.pex
Firmware: J-Link V12 compiled May 26 2026 15:13:57
S/N: 602000001

J-Link log: Version: V1.00.0
J-Link log: Device DAL: 0x00000002
J-Link log: Using key:
J-Link log: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
J-Link log: Device DAL: 0x00000002