Skip to content

Commit fb11141

Browse files
committed
boards: microchip Addition of pic32cxsg board
Addition of pic32cxsg SG41 Curiosity Ultra board Signed-off-by: Michael D Sherwood <[email protected]>
1 parent 2ea732a commit fb11141

16 files changed

+588
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# PIC32CX SG41 Curiosity Ultra board configuration
2+
#
3+
# Copyright (c) 2024 Microchip
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if ETH_SAM_GMAC
7+
8+
# Read MAC address from AT24MAC402 EEPROM
9+
10+
config ETH_SAM_GMAC_MAC_I2C_INT_ADDRESS
11+
default 0x9A
12+
13+
config ETH_SAM_GMAC_MAC_I2C_INT_ADDRESS_SIZE
14+
default 1
15+
16+
config ETH_SAM_GMAC_MAC_I2C_EEPROM
17+
default y
18+
select I2C
19+
20+
endif # ETH_SAM_GMAC
21+
22+
if NETWORKING
23+
24+
config NET_L2_ETHERNET
25+
default y
26+
27+
endif # NETWORKING
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 Microchip
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_PIC32CXSG41_CULT
5+
select SOC_PIC32CX1025SG41128
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 Microchip
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
5+
board_finalize_runner_args(jlink "--device=pic32cx1025sg41128")
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: pic32cxsg41_cult
3+
full_name: PIC32CX SG41 Curiosity Ultra Evaluation Kit
4+
vendor: microchip
5+
socs:
6+
- name: pic32cx1025sg41128
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 Microchip
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
5+
board_finalize_runner_args(jlink "--device=pic32cx1025sg41128")
222 KB
Loading
152 KB
Loading
123 KB
Loading
314 KB
Loading
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
.. zephyr:board:: pic32cxsg41_cult
2+
3+
Overview
4+
********
5+
6+
The PIC32CX SG41 Curiosity Ultra evaluation kit is ideal for evaluation and
7+
prototyping with the PIC32CX SG Cortex®-M4F processor-based
8+
microcontrollers. The kit includes Microchip’s Embedded Debugger (EDBG),
9+
which provides a full debug interface without the need for additional
10+
hardware.
11+
12+
Hardware
13+
********
14+
15+
- PIC32CX1025SG41 ARM Cortex-M4F processor at 120 MHz
16+
- 32.768 kHz crystal oscillator
17+
- 12 MHz crystal oscillator
18+
- 1024 KiB flash memory and 256 KiB of RAM
19+
- Two yellow user LEDs
20+
- Two mechanical user push buttons
21+
- One reset button
22+
- On-board USB based EDBG unit with serial console
23+
- Embedded Debugger MCU (PKoB4)
24+
- 64 Mbit QSPI Flash
25+
- AT24MAC402 serial EEPROM with EUI-48™ MAC address
26+
- Ethernet transceiver 10/100 Mbps Ethernet MAC,
27+
compatible with the IEEE 802.3 standard.
28+
- Arduino Uno header connectors
29+
- X32 Audio Interface Headers
30+
- mikroBUS header connectors
31+
- DAC Output header
32+
- USB interface, host, and device
33+
- SD/SDIO card connector
34+
35+
Supported Features
36+
==================
37+
38+
The pic32cxsg41_cult board configuration supports the following hardware
39+
features:
40+
41+
+---------------+------------+----------------------------+
42+
| Interface | Controller | Driver/Component |
43+
+===============+============+============================+
44+
| ADC | on-chip | adc |
45+
+---------------+------------+----------------------------+
46+
| DAC | on-chip | dac |
47+
+---------------+------------+----------------------------+
48+
| DMAC | on-chip | dma |
49+
+---------------+------------+----------------------------+
50+
| EEPROM | i2c | eeprom, EUI-48 MAC Address |
51+
+---------------+------------+----------------------------+
52+
| EIC | on-chip | interrupt_controller |
53+
+---------------+------------+----------------------------+
54+
| GMAC | on-chip | ethernet, mdio |
55+
+---------------+------------+----------------------------+
56+
| GPIO | on-chip | gpio |
57+
+---------------+------------+----------------------------+
58+
| MPU | on-chip | arch/arm |
59+
+---------------+------------+----------------------------+
60+
| NVIC | on-chip | arch/arm |
61+
+---------------+------------+----------------------------+
62+
| NVMCTRL | on-chip | flash |
63+
+---------------+------------+----------------------------+
64+
| PORT | on-chip | pinctrl |
65+
+---------------+------------+----------------------------+
66+
| RTC | on-chip | timer |
67+
+---------------+------------+----------------------------+
68+
| SERCOM I2C | on-chip | i2c |
69+
+---------------+------------+----------------------------+
70+
| SERCOM SPI | on-chip | spi |
71+
+---------------+------------+----------------------------+
72+
| SERCOM USART | on-chip | serial, console |
73+
+---------------+------------+----------------------------+
74+
| Serial Number | on-chip | hwinfo |
75+
+---------------+------------+----------------------------+
76+
| SYSTICK | on-chip | timer |
77+
+---------------+------------+----------------------------+
78+
| TC | on-chip | counter |
79+
+---------------+------------+----------------------------+
80+
| TCC | on-chip | counter, pwm |
81+
+---------------+------------+----------------------------+
82+
| TRNG | on-chip | entropy |
83+
+---------------+------------+----------------------------+
84+
| USB | on-chip | usb |
85+
+---------------+------------+----------------------------+
86+
| WDT | on-chip | watchdog |
87+
+---------------+------------+----------------------------+
88+
89+
Other hardware features are not currently supported by Zephyr.
90+
91+
The default configuration can be found in the Kconfig
92+
:zephyr_file:`boards/microchip/pic32cxsg41_cult/pic32cxsg41_cult_defconfig`.
93+
94+
Pin Mapping
95+
===========
96+
97+
The Microchip PIC32CXSG41 Curiosity Ultra evaluation kit has 4 GPIO controllers. These
98+
controllers are responsible for pin muxing, input/output, pull-up, etc.
99+
100+
For more details please refer to `Microchip PIC32CX SG41/SG60/SG61 Family Datasheet`_ and
101+
the `Microchip PIC32CXSG41 Curiosity Ultra Schematic`_.
102+
103+
.. image:: img/PIC32CXSG41-pinout1.jpg
104+
:align: center
105+
:alt: PIC32CXSG41-CULT-pinout1
106+
107+
.. image:: img/PIC32CXSG41-pinout2.jpg
108+
:align: center
109+
:alt: PIC32CXSG41-CULT-pinout2
110+
111+
.. image:: img/PIC32CXSG41-pinout3.jpg
112+
:align: center
113+
:alt: PIC32CXSG41-CULT-pinout3
114+
115+
Default Zephyr Peripheral Mapping:
116+
----------------------------------
117+
- SERCOM2 USART TX : PB13
118+
- SERCOM2 USART RX : PB12
119+
- GPIO/PWM LED1 : PC21
120+
- GPIO/PWM LED2 : PA16
121+
- GPIO SW1 : PD00
122+
- GPIO SW2 : PD01
123+
- GMAC RMII REFCK : PA14
124+
- GMAC RMII TXEN : PA17
125+
- GMAC RMII TXD0 : PA18
126+
- GMAC RMII TXD1 : PA19
127+
- GMAC RMII CRSDV : PC20
128+
- GMAC RMII RXD0 : PA13
129+
- GMAC RMII RXD1 : PA12
130+
- GMAC RMII RXER : PA15
131+
- GMAC MDIO MDC : PC11
132+
- GMAC MDIO MDIO : PC12
133+
- SERCOM0 SPI SCK : PB24
134+
- SERCOM0 SPI MOSI : PB25
135+
- SERCOM0 SPI MISO : PC25
136+
- SERCOM0 SPI SS : PC24
137+
- SERCOM7 I2C SDA : PD08
138+
- SERCOM7 I2C SCL : PD09
139+
- USB DP : PA25
140+
- USB DM : PA24
141+
142+
System Clock
143+
============
144+
145+
The PIC32CXSG41 MCU is configured to use the 32.768 kHz external oscillator
146+
with the on-chip PLL generating the 48 MHz system clock.
147+
148+
Serial Port
149+
===========
150+
151+
The PIC32CXSG41 MCU has 8 SERCOM based USARTs with one configured as USARTs in
152+
this BSP. SERCOM4 is the default Zephyr console.
153+
154+
- SERCOM4 115200 8n1 connected to the onboard Microchip Embedded Debugger (EDBG)
155+
156+
PWM
157+
===
158+
159+
The PIC32CXSG41 MCU has 5 TCC based PWM units with up to 6 outputs each and a period
160+
of 24 bits or 16 bits. If :code:`CONFIG_PWM_PIC32CXSG_TCC` is enabled then LED0 is
161+
driven by TCC0 instead of by GPIO.
162+
163+
SPI Port
164+
========
165+
166+
The PIC32CXSG41 MCU has 8 SERCOM based SPIs.
167+
168+
I2C Port
169+
========
170+
171+
The PIC32CXSG41 MCU has 5 SERCOM based I2Cs. On the Microchip PIC32CXSG41 Curiosity Ultra,
172+
SERCOM7 is connected to a AT24MAC402 EEPROM.
173+
174+
Programming and Debugging
175+
*************************
176+
177+
The Microchip PIC32CXSG41 Curiosity Ultra comes with a Microchip Embedded Debugger (EDBG).
178+
This provides a debug interface to the PIC32CXSG41 chip and is supported by OpenOCD.
179+
180+
Flashing
181+
========
182+
183+
#. Build the Zephyr kernel and the ``hello_world`` sample application:
184+
185+
.. zephyr-app-commands::
186+
:zephyr-app: samples/hello_world
187+
:board: pic32cxsg41_cult
188+
:goals: build
189+
:compact:
190+
191+
#. Connect the Microchip PIC32CXSG41 Curiosity Ultra to your host computer using the USB debug
192+
port.
193+
194+
#. Run your favorite terminal program to listen for output. Under Linux the
195+
terminal should be :code:`/dev/ttyACM0`. For example:
196+
197+
.. code-block:: console
198+
199+
$ minicom -D /dev/ttyACM0 -o
200+
201+
The -o option tells minicom not to send the modem initialization
202+
string. Connection should be configured as follows:
203+
204+
- Speed: 115200
205+
- Data: 8 bits
206+
- Parity: None
207+
- Stop bits: 1
208+
209+
#. To flash an image:
210+
211+
.. zephyr-app-commands::
212+
:zephyr-app: samples/hello_world
213+
:board: pic32cxsg41_cult
214+
:goals: flash
215+
:compact:
216+
217+
You should see "Hello World! pic32cxsg41_cult" in your terminal.
218+
219+
Debugging
220+
=========
221+
222+
.svd files are included in hal_microchip/pic32c/pic32cxsg/include/pic32cxsg41/svd
223+
224+
References
225+
**********
226+
227+
.. target-notes::
228+
229+
.. _Microchip website:
230+
https://www.microchip.com/en-us/development-tool/EV06X38A
231+
232+
.. _PIC32CX SG41/SG60/SG61 Family Datasheet:
233+
https://ww1.microchip.com/downloads/aemDocuments/documents/MCU32/ProductDocuments/DataSheets/PIC32CX-SG41-SG60-SG61-Family-Data-Sheet-DS60001715.pdf

0 commit comments

Comments
 (0)