Skip to content

Commit b7096e5

Browse files
boards: pic32wm_bz6204_curiosity: add docs and openocd support
Added index.rst and openocd.cfg support for pic3wm_bz6204_curiosity Signed-off-by: Dinesh Arasu <[email protected]>
1 parent b818b14 commit b7096e5

File tree

3 files changed

+374
-0
lines changed

3 files changed

+374
-0
lines changed
61.1 KB
Loading
Lines changed: 348 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,348 @@
1+
.. zephyr:board:: pic32wm_bz6204_curiosity
2+
3+
Overview
4+
*********
5+
6+
The **PIC32-BZ6 Curiosity Board (EV31U42A)** is a versatile development platform designed to facilitate rapid prototyping and evaluation of the **PIC32WM-BZ6204UE** module.
7+
This module supports **Bluetooth® Low Energy (BLE)** and **IEEE® 802.15.4** wireless communications.
8+
9+
The board is targeted at **IoT**, **Home Automation**, and **Industrial Automation** applications such as smart door locks, alarm sensors, wall switches, and thermostats.
10+
11+
**Key Features:**
12+
13+
- On-board PIC32WM-BZ6204UE wireless module (BLE and 802.15.4)
14+
- Integrated PKOB4 programmer/debugger
15+
- Power options: USB Type-C, External 5V, or Li-ion/Li-Po battery
16+
- USB-UART converter for serial communication
17+
- Two mikroBUS™ sockets for expansion
18+
- XPRO and RMII headers for Ethernet and touch interface
19+
- User interface: RGB LED, user LED, two push buttons, and a reset button
20+
- Temperature sensor and external QSPI Flash memory
21+
- External antenna connector (2.4 GHz, 2 dBi)
22+
23+
24+
25+
Hardware
26+
********
27+
28+
Power Supply
29+
------------
30+
31+
The board supports multiple power sources:
32+
33+
1. **Debug USB (J100)** – via Type-C cable from PC
34+
2. **Target USB (J103)** – via Type-C cable
35+
3. **External 5 V (J201)** – through 1×2 header
36+
4. **Li-ion/Li-Po battery (J204)** – 4.2 V via JST PH 2-pin connector (recommended 400 mAh minimum)
37+
38+
**Power Selection Jumper (J202):**
39+
40+
- Pins 1–2 → External 5 V (J201)
41+
- Pins 3–4 → Debug USB (J100)
42+
- Pins 5–6 → Target USB (J103)
43+
44+
**Voltage Regulation:**
45+
46+
- 3.3 V buck regulator (U203, MIC33153) for PIC32WM-BZ6204UE
47+
- LDO (U204, MCP1727) optional for 3.3 V
48+
- LDO (U201) powers USB hub, PKOB4, and UART converter
49+
50+
**External Supply Header (J203):**
51+
52+
Allows direct 1.9–3.6 V input to the PIC32WM-BZ6204UE (requires changing resistor jumpers R213/R217).
53+
54+
USB and Connectivity
55+
--------------------
56+
57+
- Integrated **USB 2.0 hub controller (USB2512B)**
58+
- **USB Device/Host support** via Target USB Type-C connector (J103)
59+
- Host mode requires jumper configuration:
60+
- J106 → CC pin
61+
- J102 → Target USB VBUS select
62+
- J104 → VBUSON control (hard/soft enable)
63+
64+
Expansion and Interfaces
65+
------------------------
66+
67+
- **Two mikroBUS™ sockets (J903, J905)** for Click™ add-on boards
68+
Provide SPI, UART, I²C, PWM, Analog, Reset, Interrupt, and Power pins.
69+
- **PTA headers (J901, J902)** for co-existence control (e.g., Wi-Fi/Bluetooth)
70+
- **XPRO header (J900)** compatible with Microchip QT7/T9 Xplained Pro kits
71+
- **GPIO headers (J701, J702)** to access module I/O pins
72+
- **Graphics connector (J910)** for external GUI/Display adapter
73+
- **RMII headers (J906–J909)** for external Ethernet PHY
74+
75+
On-board Peripherals
76+
--------------------
77+
78+
- **Temperature sensor (U800, MCP9700A)** → PD4/AN10
79+
- **QSPI Flash (U801, SST26VF064B)** → 64 Mbit
80+
- **User LED (D801, Blue)** → PB7 (active low)
81+
- **RGB LED (D800)**:
82+
- Red: RPC7
83+
- Green: RPC10
84+
- Blue: RPE0
85+
- **Two user buttons:**
86+
- SW801 (BTN1) → RPB9
87+
- SW800 (BTN2) → RPE3
88+
- **Reset switch (SW802)** → NMCLR
89+
90+
91+
**Design Files:**
92+
`PIC32-BZ6 Curiosity Board Hardware Design Documentation <https://ww1.microchip.com/downloads/aemDocuments/documents/WSG/ProductDocuments/BoardDesignFiles/PIC32-BZ6-EA-Kit-Hardware-Design-Documentation.zip>`_
93+
94+
95+
Supported Features
96+
==================
97+
98+
.. zephyr:board-supported-hw::
99+
100+
For complete list of EV96B94A see `PIC32-BZ6 Curiosity Board User’s Guide <https://ww1.microchip.com/downloads/aemDocuments/documents/WSG/ProductDocuments/UserGuides/PIC32-BZ6-Curiosity-Board-User-Guide-DS00006006.pdf>`_
101+
102+
103+
Connections and IOs
104+
===================
105+
106+
GPIO Headers
107+
------------
108+
109+
**J701 (GPIO Header 1):**
110+
111+
::
112+
113+
1 - MIKRO1_RST / RPA15
114+
2 - AN0 / MIKRO1_AN / RPB10
115+
3 - GND
116+
4 - MIKRO2_AN / BAT_MON / RPB5
117+
5 - GREEN_LED / MIKRO2_RST / RPC10
118+
6 - GND
119+
7 - GMAC_GTX0 / RPC0
120+
8 - GMAC_GTX1 / RPE1
121+
9 - GND
122+
10 - GMAC_GREFCLKOUT / RPC1
123+
11 - COEX_RF_ACTIVE / QSPI_DATA1 / RPB12
124+
12 - QSPI_DATA3 / CAN1_RX / RPA2
125+
13 - QSPI_DATA2 / COEX_WLAN_ACT / RPB11
126+
14 - BAT_MON
127+
15 - QSPI_CS / RPB13
128+
16 - GND
129+
17 - GND
130+
18 - MIKRO2_INT / BTN2 / RPE3
131+
19 - RED_LED / RMII_INT / RPC7
132+
20 - RMII_EN / MIKRO2_PWM / RPC11
133+
21 - GND
134+
22 - GND
135+
23 - UART_CTS / RPB4
136+
24 - RPB6
137+
25 - UART_RTS / RPA3
138+
26 - CAN1_TX / MIKRO1_UART_TX / RPB2
139+
27 - MIKRO1_PWM / RPD1
140+
28 - MIKRO1_INT / RPE4
141+
29 - BLUE_LED / RPE0
142+
30 - RMII_RST / RPD0
143+
31 - GND
144+
32 - GND
145+
146+
**J702 (GPIO Header 2):**
147+
148+
::
149+
150+
1 - GMAC_GCRS_DV / RPE2
151+
2 - GMAC_GTXEN / RPC9
152+
3 - GMAC_GMDIO / RPD6
153+
4 - GMAC_GRXER / RPC8
154+
5 - GMAC_GRX1 / RPA13
155+
6 - GMAC_GMDC / RPD7
156+
7 - UART_TX / RPA5
157+
8 - GMAC_GRX0 / RPA14
158+
9 - GND
159+
10 - UART_RX / RPA6
160+
161+
162+
USB-UART Serial Converter (U101)
163+
--------------------------------
164+
165+
- **Device:** MCP2200 USB-UART converter
166+
- **Connections:**
167+
- TX → PA6 (UART RX)
168+
- RX → PA5 (UART TX)
169+
- RTS → PB4 (UART CTS) — requires R602 populated
170+
- CTS → PA3 (UART RTS) — requires R601 populated
171+
172+
mikroBUS™ Sockets (J903, J905)
173+
------------------------------
174+
175+
- Two mikroBUS™ sockets for Click™ boards or expansion modules
176+
- Provide SPI, UART, I²C, PWM, Analog, Reset, INT, 3.3 V/5 V, and GND
177+
- Shared/multiplexed pins require attention to resource conflicts
178+
179+
LEDs and Buttons
180+
----------------
181+
182+
- **User LED (D801):** Blue, active LOW, connected to PB7
183+
- **RGB LED (D800):**
184+
- Red → RPC7
185+
- Green → RPC10
186+
- Blue → RPE0
187+
- **Buttons:**
188+
- SW801 → RPB9 (BTN1)
189+
- SW800 → RPE3 (BTN2)
190+
- **Reset Button:** SW802 → NMCLR
191+
192+
193+
Temperature Sensor
194+
~~~~~~~~~~~~~~~~~~
195+
196+
- **U800 (MCP9700A)** connected to PD4 (AN10)
197+
- Enabled via jumper **J801**
198+
- Shared with XPRO CVD input
199+
200+
QSPI Flash
201+
~~~~~~~~~~
202+
203+
- **U801 (SST26VF064B, 64 Mbit)**
204+
- To enable QSPI:
205+
- Populate resistors R739, R742, R744, R746, R749, R752
206+
- Shares pins with other peripherals
207+
208+
209+
For detailed schematics, pin assignments, and signal descriptions, see the
210+
`PIC32-BZ6 Curiosity Board User’s Guide <https://ww1.microchip.com/downloads/aemDocuments/documents/WSG/ProductDocuments/UserGuides/PIC32-BZ6-Curiosity-Board-User-Guide-DS00006006.pdf>`_
211+
212+
Programming and Debugging
213+
*************************
214+
215+
This section describes how to flash and debug applications on the Microchip Wireless PIC32WM_BZ6 Curiosity Board Curiosity board using Zephyr.
216+
217+
**Supported Debuggers**
218+
219+
.. list-table::
220+
:header-rows: 1
221+
:widths: 20 20 20 20 20
222+
223+
* -
224+
- Flash
225+
- Debug
226+
- Debug Server
227+
- Debug Tool
228+
* - Segger
229+
- ✓
230+
- ✓
231+
- ✓
232+
- J-Link
233+
* - OpenOCD
234+
- ✓
235+
- ✓
236+
- ✓
237+
- PKOB4, PICkit Basic
238+
239+
Flashing
240+
========
241+
242+
Follow the steps below to build and flash your application:
243+
244+
1. Open a terminal and change to the Zephyr workspace directory:
245+
246+
.. code-block:: console
247+
248+
cd zephyr
249+
250+
2. Build the application using the following command:
251+
252+
.. code-block:: console
253+
254+
west build -p always -b pic32wm_bz6204_curiosity .\samples\basic\blinky\
255+
256+
3. After a successful build, connect the PIC32WM_BZ6 device to your machine.
257+
258+
4. Flash the device using the ``west flash`` command:
259+
260+
.. code-block:: console
261+
262+
west flash --hex-file build/zephyr/zephyr_signed.hex
263+
264+
5. Ensure the flash process completes successfully. You should see confirmation messages in the terminal.
265+
266+
Debugging
267+
=========
268+
269+
To debug the PIC32WM_BZ6 application using Visual Studio Code:
270+
271+
1. Ensure the application is built for the PIC32WM_BZ6 board.
272+
2. Install the ``cortex-debug`` extension in Visual Studio Code.
273+
3. Open the workspace and click the **Run and Debug** icon on the left sidebar.
274+
4. If ``launch.json`` and ``tasks.json`` files are already present, VS Code will automatically start the debug session.
275+
5. If prompted to create a new ``launch.json``, select the **Cortex Debug** debugger option.
276+
6. Replace the contents of ``launch.json`` with:
277+
278+
.. code-block:: json
279+
280+
{
281+
"version": "2.0.0",
282+
"configurations": [
283+
{
284+
"name": "Debug PIC32WM_BZ6",
285+
"type": "cortex-debug",
286+
"request": "attach",
287+
"servertype": "openocd",
288+
"cwd": "C:\\developers\\zephyr\\",
289+
"executable": "<path to zephyr project>/build/zephyr/zephyr.elf",
290+
"device": "PIC32WM",
291+
"configFiles": [
292+
"interface/cmsis-dap.cfg",
293+
"target/pic32wm.cfg"
294+
],
295+
"gdbPath": "<path to zephyr sdk>/arm-zephyr-eabi/bin/arm-zephyr-eabigdb.exe",
296+
"preLaunchTask": "flash_pic32wm_hex",
297+
"postRestartCommands": [
298+
"symbol-file <path to zephyr project>/build/zephyr/zephyr.elf",
299+
"monitor reset halt",
300+
"break main"
301+
],
302+
"showDevDebugOutput": "none"
303+
}
304+
]
305+
}
306+
307+
7. Create ``tasks.json`` inside ``.vscode`` with:
308+
309+
.. code-block:: json
310+
311+
{
312+
"version": "2.0.0",
313+
"tasks": [
314+
{
315+
"label": "flash_pic32wm_hex",
316+
"type": "shell",
317+
"command": "openocd",
318+
"args": [
319+
"-f", "interface/cmsis-dap.cfg",
320+
"-f", "target/pic32wm.cfg",
321+
"-c", "init",
322+
"-c", "reset halt",
323+
"-c", "program <path to zephyr project>/build/zephyr/zephyr_signed.hex reset exit"
324+
],
325+
"problemMatcher": [],
326+
"group": {
327+
"kind": "build",
328+
"isDefault": true
329+
}
330+
}
331+
]
332+
}
333+
334+
8. Connect the PIC32WM_BZ6 Curiosity board.
335+
9. Click the **Run and Debug** icon again and select the Debug PIC32WM_BZ6 debug option.
336+
10. Confirm that the debugger hits the breakpoint in ``main.c``. Press **Continue** to proceed.
337+
338+
References
339+
==========
340+
341+
- `PIC32-BZ6 Curiosity Board Product Page <https://www.microchip.com/en-us/development-tool/ea81w68a>`_
342+
- `PIC32-BZ6 Curiosity Board User Guide <https://ww1.microchip.com/downloads/aemDocuments/documents/WSG/ProductDocuments/UserGuides/PIC32-BZ6-Curiosity-Board-User-Guide-DS00006006.pdf>`_
343+
- `Hardware Design Files <https://ww1.microchip.com/downloads/aemDocuments/documents/WSG/ProductDocuments/BoardDesignFiles/PIC32-BZ6-EA-Kit-Hardware-Design-Documentation.zip>`_
344+
- `PIC32CX-BZ6 and PIC32WM-BZ6 Family Data Sheet <https://ww1.microchip.com/downloads/aemDocuments/documents/WSG/ProductDocuments/DataSheets/PIC32CX-BZ6-and-PIC32WM-BZ6-Family-Data-Sheet-00005998.pdf>`_
345+
- `mikroBUS Click Boards <https://www.mikroe.com/click>`_
346+
- `Microchip Support Portal <http://support.microchip.com/>`_
347+
- `Microchip Direct <https://www.microchipdirect.com/?srsltid=AfmBOop0KWt1byQZUafcD8wwzrgQX_iuCJLi6AmzTIzhI6Ez-D2IZr_M>`_
348+
- `Zephyr® for Microchip <https://www.microchip.com/en-us/tools-resources/develop/zephyr>`_
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2018 Bryan O'Donoghue
2+
# SPDX-License-Identifier: Apache-2.0
3+
source [find interface/cmsis-dap.cfg]
4+
transport select swd
5+
6+
# chip name
7+
set CHIPNAME pic32wm
8+
set ENDIAN little
9+
set CPUTAPID 0x04D8810B
10+
# set CPUTAPID 0x04D8904C
11+
12+
source [find target/pic32wm.cfg]
13+
14+
# reset_config none
15+
cortex_m reset_config sysresetreq
16+
17+
$_TARGETNAME configure -event gdb-attach {
18+
echo "Debugger attaching: halting execution"
19+
reset halt
20+
gdb_breakpoint_override hard
21+
}
22+
23+
$_TARGETNAME configure -event gdb-detach {
24+
echo "Debugger detaching: resuming execution"west flash
25+
resume
26+
}

0 commit comments

Comments
 (0)