@@ -42,24 +42,60 @@ Programming & Debugging
42
42
43
43
.. zephyr :board-supported-runners ::
44
44
45
- Flash Using J-Link
46
- ==================
45
+ Setting Up the Debug Interface
46
+ ==============================
47
+
48
+ PyOCD Setup
49
+ ===========
50
+
51
+ 1. Install Device Pack
52
+
53
+ Add support for the PIC32CM family devices using the following command:
54
+
55
+ .. code-block :: console
56
+
57
+ pyocd pack install pic32cm
58
+
59
+ 2. Verify Device Support
60
+
61
+ Confirm that the target is recognized:
62
+
63
+ .. code-block :: console
64
+
65
+ pyocd list --targets
66
+
67
+ You should see an entry similar to:
68
+
69
+ .. code-block :: text
70
+
71
+ pic32cm5164jh01100 Microchip PIC32CM5164JH01100 PIC32CM-JH pack
47
72
48
- To flash the board using the J-Link debugger, follow the steps below:
73
+
74
+ 3. Connect the Board
75
+
76
+ Connect the DEBUG USB port on the board to your host machine to **power up the board **.
77
+
78
+
79
+ J-Link Setup
80
+ ============
49
81
50
82
1. Install J-Link Software
51
83
52
- - Download and install the `J-Link software `_ tools from Segger.
53
- - Make sure the installed J-Link executables (e.g., ``JLink ``, ``JLinkGDBServer ``)
54
- are available in your system's PATH.
84
+ Download and install the `J-Link software `_ tools from Segger.
85
+ Make sure the installed J-Link executables (e.g., ``JLink ``, ``JLinkGDBServer ``)
86
+ are available in your system's PATH.
55
87
56
88
2. Connect the Board
57
89
58
90
- Connect the `J32 Debug Probe `_ to the board's **CORTEX DEBUG ** header.
59
91
- Connect the other end of the J32 Debug Probe to your **host machine (PC) ** via USB.
60
92
- Connect the DEBUG USB port on the board to your host machine to **power up the board **.
61
93
62
- 3. Build the Application
94
+
95
+ Building and Flashing the Application
96
+ =====================================
97
+
98
+ 1. Build the Application
63
99
64
100
You can build a sample Zephyr application, such as **Blinky **, using the ``west `` tool.
65
101
Run the following commands from your Zephyr workspace:
@@ -70,17 +106,31 @@ To flash the board using the J-Link debugger, follow the steps below:
70
106
71
107
This will build the Blinky application for the ``pic32cm_jh01_cpro `` board.
72
108
73
- 4 . Flash the Device
109
+ 2 . Flash the Device
74
110
75
111
Once the build completes, flash the firmware using:
76
112
77
113
.. code-block :: console
78
114
79
115
west flash
80
116
81
- This uses the default ``jlink `` runner to flash the application to the board.
117
+ By default, this command uses the PyOCD runner to program the device.
118
+
119
+ If both J-Link and PyOCD debuggers are connected, you can explicitly select the desired runner as shown below:
120
+
121
+ .. code-block :: console
122
+
123
+ west flash --runner jlink
124
+
125
+ or
126
+
127
+ .. code-block :: console
128
+
129
+ west flash --runner pyocd
130
+
131
+ This ensures the application is flashed using the respective connected interface.
82
132
83
- 5 . Observe the Result
133
+ 3 . Observe the Result
84
134
85
135
After flashing, **LED0 ** on the board should start **blinking **, indicating that the
86
136
application is running successfully.
0 commit comments