Microchip Explorer 16/32
Vendor: Microchip Technology
MCU: various 16-bit/32-bit PIC MCUs
Sample firmware
explorer_PIC32MZEF2.hex
Program PIC32MZ (ICSP)
Connection
Pin |
Explorer16/32 |
J-Link |
Pin |
---|---|---|---|
1 |
|
|
15 |
2 |
|
|
1 |
3 |
|
|
4 |
4 |
|
|
7 |
5 |
|
|
9 |
6 |
NC |
NC |
NC |
YAML test plan
Using the agentCfg command introduced in PLT-OS v2.0 :
---
title: "Program PIC32MZ using Segger J-Link Commander"
suite:
- title: Defines
ident: TPM
steps:
- command: define FIRMWARE.hex "explorer_PIC32MZEF2.hex"
- command: define SBC.uart "UART2"
- title: New SBC Session
steps:
- command: agentCfg PROGSBC %SBC.uart%
with:
- "%FIRMWARE.hex%"
- title: "Program PIC32MZ with J-Link Commander"
steps:
- command: uart %SBC.uart%
send: |
cd /run/pltagent/mnt/
/opt/SEGGER/JLink/JLinkExe -device PIC32MZ -if 2-wire-JTAG-PIC32 -speed 12000 ; echo prog:$?:DONE
eoe 1
r
loadfile %FIRMWARE.hex%
r
q
extract: "prog:(\\d+):DONE"
extractKey: RETVAL
timeout: 2m
- command: eval "RETVAL == '0'"
fail: 'J-Link Commander error; check UART logs'
For older PLT-OS versions:
---
title: "Program PIC32MZ using Segger J-Link Commander"
suite:
- title: Defines
ident: TPM
steps:
- command: define FIRMWARE.hex "explorer_PIC32MZEF2.hex"
- command: define SBC.uart "UART2"
- command: define SBC.vidpid "6666:8001"
- title: "New SBC Session"
steps:
- command: usb detect
id: "%SBC.vidpid%"
- command: uartCfg %SBC.uart% 115200
id: "%SBC.vidpid%"
- command: sleepms 500
- command: uart %SBC.uart%
send: "\x03\r\n\x03\r\n\x04\x04"
- command: uart %SBC.uart%
send: "\r\n\x04"
expect: "pltagent:PASS"
timeout: 30s
- title: "Write firmware to ramdisk"
steps:
- command: uart %SBC.uart%
send: "\r\npltagent-msc-present\r\n"
expect: "pltagent-msc-present:PASS"
timeout: 5s
- command: usb storage mount ramdisk
id: "%SBC.vidpid%"
- command: usb storage write ramdisk %FIRMWARE.hex%
- command: usb storage unmount ramdisk
- command: uart %SBC.uart%
send: "\r\npltagent-msc-mount\r\n"
expect: "pltagent-msc-mount:PASS"
timeout: 5s
- title: "Program PIC32MZ with J-Link Commander"
steps:
- command: uart %SBC.uart%
send: |
cd /run/pltagent/mnt/
/opt/SEGGER/JLink/JLinkExe -device PIC32MZ -if 2-wire-JTAG-PIC32 -speed 12000 ; echo prog:$?:DONE
eoe 1
r
loadfile %FIRMWARE.hex%
r
q
extract: "prog:(\\d+):DONE"
extractKey: RETVAL
timeout: 2m
- command: eval "RETVAL == '0'"
fail: 'J-Link Commander error; check UART logs'
References