PIC32CK SG01 Curiosity Nano
Overview
The PIC32CK SG01 Curiosity Nano + Touch Evaluation Kit is a hardware platform to evaluate the Microchip PIC32CK SG microcontrollers, and the evaluation kit part number is EV33V87A. This kit provides a comprehensive set of features that allow users to explore the PIC32CK SG peripherals and gain insight into integrating the device into their own designs.
Hardware
64-pin TQFP PIC32CK2051SG01064 microcontroller
Arm® Cortex®-M33 Microcontroller
HSM with TrustZone® technology
32.768 kHz crystal oscillator
2048 KiB flash memory and 512 KiB of RAM
One user LED (Yellow)
One green board power LED
One mechanical user push button
One touch button
One USB interfaces (Type-C)
Virtual COM port (VCOM)
One logic analyzer DGI GPIO
Programming and debugging of on-board PIC32CK SG through Serial Wire Debug (SWD) and on-board nano debugger
Adjustable target voltage (1.8-3.6V, up to 500mA) controlled by the on-board debugger
Supported Features
The pic32ck_sg01_cnano board supports the hardware features listed below.
- on-chip / on-board
- Feature integrated in the SoC / present on the board.
- 2 / 2
-
Number of instances that are enabled / disabled.
Click on the label to see the first instance of this feature in the board/SoC DTS files. -
vnd,foo -
Compatible string for the Devicetree binding matching the feature.
Click on the link to view the binding documentation.
pic32ck_sg01_cnano/pic32ck2051sg01064 target
On-target memory for this board target: 512 KiB of RAM, 2 MiB of Flash.
Type |
Location |
Description |
Compatible |
|---|---|---|---|
CPU |
on-chip |
ARM Cortex-M33 CPU1 |
|
Clock control |
on-chip |
Microchip PIC32CK SG/GC Clock1 |
|
on-chip |
PIC32CK_SG_GC Crystal Oscillator (XOSC)1 |
||
on-chip |
PIC32CK_SG_GC Internal Oscillator (OSC48M)1 |
||
on-chip |
PIC32CK_SG_GC PLL clock1 |
||
on-chip |
PIC32CK_SG_GC RTC clock1 |
||
on-chip |
PIC32CK_SG_GC External Crystal Oscillator (XOSC32K)1 |
||
on-chip |
PIC32CK_SG_GC Generic clock generator1 |
||
on-chip |
PIC32CK_SG_GC Generic clock peripheral1 |
||
on-chip |
PIC32CK_SG_GC Main clock domains1 |
||
on-chip |
PIC32CK_SG_GC MCLK peripheral1 |
||
GPIO & Headers |
on-chip |
||
Input |
on-board |
Group of GPIO-bound input keys1 |
|
Interrupt controller |
on-chip |
ARMv8-M NVIC (Nested Vectored Interrupt Controller)1 |
|
LED |
on-board |
Group of GPIO-controlled LEDs1 |
|
MMU / MPU |
on-chip |
ARMv8-M MPU (Memory Protection Unit)1 |
|
MTD |
on-chip |
Flash node2 |
|
Pin control |
on-chip |
Microchip PORT Pinctrl container node1 |
|
SRAM |
on-chip |
Generic on-chip SRAM1 |
|
Timer |
on-chip |
ARMv8-M System Tick1 |
Connections and IOs
The PIC32CK SG01 Curiosity Nano User Guide has detailed information about board connections.
Programming & Debugging
The pic32ck_sg01_cnano board supports the runners and associated west commands listed below.
| flash | debug | rtt | debugserver | attach | reset | |
|---|---|---|---|---|---|---|
| jlink | ✅ | ✅ (default) | ✅ | ✅ | ✅ | ✅ |
| mplab_ipe | ✅ (default) |
Flash Using MPLAB IPE
For instructions on flashing using MPLAB IPE see Flashing with Microchip MPLAB IPE.
Flash Using J-Link
To flash the board using the J-Link debugger, follow the steps below:
Install J-Link Software
Download and install the J-Link software tools from Segger.
Make sure the installed J-Link executables (e.g.,
JLink,JLinkGDBServer) are available in your system’s PATH.
Connect the Board
Connect the J-Link debugger to the board’s CORTEX DEBUG header.
Connect the other end of the J-Link debugger to your host machine (PC) via USB.
Connect the DEBUG USB port on the board to your host machine to power up the board.
Build the Application
You can build a sample Zephyr application, such as Blinky, using the
westtool. Run the following commands from your Zephyr workspace:west build -b pic32ck_sg01_cnano -p samples/basic/blinkyThis will build the Blinky application for the
pic32ck_sg01_cnanoboard.Flash the Device
Once the build completes, flash the firmware using:
west flash --runner jlinkThis uses the
jlinkrunner to flash the application to the board.Observe the Result
After flashing, LED0 on the board should start blinking, indicating that the application is running successfully.
Debug Using J-Link: GDB Command-Line
To debug the board using the J-Link debugger, follow the steps below:
Build the Application
You can build a sample Zephyr application, such as Blinky, using the
westtool. Run the following commands from your Zephyr workspace:west build -b pic32ck_sg01_cnano -p samples/basic/blinkyThis will build the Blinky application for the
pic32ck_sg01_cnanoboard.Debug the Application
To debug the application, run the following command from your Zephyr workspace:
west debugNote
Debugging with J-Link GDB Server: Halting at `main` and Setting Breakpoints(gdb) break main (gdb) break main.c:42 # Optional: set breakpoint at line 42 in main.c (gdb) continue # Start execution, halts at first breakpoint (gdb) info breakpoints # List all breakpoints (gdb) delete 1 # Delete breakpoint number 1 (gdb) delete # Delete all breakpoints (gdb) clear main.c:42 # Clear breakpoint at specific location (gdb) continue # Resume execution
Debug Using J-Link: VSCode
To debug using VSCode, create or edit the .vscode/launch.json file in your project directory with the following configuration:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug (J-Link, PIC32CK2051SG01064)",
"type": "cortex-debug",
"request": "launch",
"servertype": "jlink",
"device": "PIC32CK2051SG01064",
"interface": "swd",
"runToEntryPoint": "main",
"showDevDebugOutput": "none",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/zephyr/build/zephyr/zephyr.elf",
/* J-Link settings */
"serverpath": "C:/Program Files/SEGGER/JLink_Vxxx/JLinkGDBServerCL.exe",
"serverArgs": [
"-singlerun",
"-if", "swd",
"-speed", "4000",
"-device", "PIC32CK2051SG",
"-port", "50000"
],
/* Zephyr SDK toolchain paths */
"gdbPath": "***/zephyr-sdk-x.xx.x/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb.exe",
"objdumpPath": "***/zephyr-sdk-x.xx.x/arm-zephyr-eabi/bin/arm-zephyr-eabi-objdump.exe",
}
]
}
Note
serverpath: Specify the full path to the J-Link GDB Server executable if it is not in your system’s PATH.
gdbPath: Specify the full path to the GDB executable if it is not in your system’s PATH.
objdumpPath: Specify the full path to the objdump executable if it is not in your system’s PATH.
Debugging Steps in VSCode
Start the J-Link GDB Server as shown above.
Open the samples/basic/blinky/src/main.c in VSCode.
Set breakpoints in your source files by clicking next to the line numbers.
Press F5 or click the green “Start Debugging” button in VSCode.
The debugger will connect, load your program, and halt at main.
Use the VSCode debug controls to continue, step, or inspect variables.
References
- PIC32CK SG Product Page:
- PIC32CK SG/SG Product Family Page:
https://www.microchip.com/en-us/products/microcontrollers/32-bit-mcus/pic32-sam/pic32ck-sg-gc