Skip to content

Commit e0da164

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 3429aeb commit e0da164

15 files changed

+542
-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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2024 Microchip
2+
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
6+
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")
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
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+
.. zephyr:board-supported-hw::
39+
40+
Pin Mapping
41+
===========
42+
43+
The Microchip PIC32CXSG41 Curiosity Ultra evaluation kit has 4 GPIO controllers. These
44+
controllers are responsible for pin muxing, input/output, pull-up, etc.
45+
46+
For more details please refer to `Microchip PIC32CX SG41-SG60-SG61 Family Datasheet`_.
47+
48+
.. image:: img/PIC32CXSG41-pinout1.webp
49+
:align: center
50+
:alt: PIC32CXSG41-CULT-pinout1
51+
52+
.. image:: img/PIC32CXSG41-pinout2.webp
53+
:align: center
54+
:alt: PIC32CXSG41-CULT-pinout2
55+
56+
.. image:: img/PIC32CXSG41-pinout3.webp
57+
:align: center
58+
:alt: PIC32CXSG41-CULT-pinout3
59+
60+
Default Zephyr Peripheral Mapping:
61+
----------------------------------
62+
63+
- SERCOM2 USART TX : PB13
64+
- SERCOM2 USART RX : PB12
65+
- GPIO/PWM LED1 : PC21
66+
- GPIO/PWM LED2 : PA16
67+
- GPIO SW1 : PD00
68+
- GPIO SW2 : PD01
69+
- GMAC RMII REFCK : PA14
70+
- GMAC RMII TXEN : PA17
71+
- GMAC RMII TXD0 : PA18
72+
- GMAC RMII TXD1 : PA19
73+
- GMAC RMII CRSDV : PC20
74+
- GMAC RMII RXD0 : PA13
75+
- GMAC RMII RXD1 : PA12
76+
- GMAC RMII RXER : PA15
77+
- GMAC MDIO MDC : PC11
78+
- GMAC MDIO MDIO : PC12
79+
- SERCOM0 SPI SCK : PB24
80+
- SERCOM0 SPI MOSI : PB25
81+
- SERCOM0 SPI MISO : PC25
82+
- SERCOM0 SPI SS : PC24
83+
- SERCOM7 I2C SDA : PD08
84+
- SERCOM7 I2C SCL : PD09
85+
- USB DP : PA25
86+
- USB DM : PA24
87+
88+
System Clock
89+
============
90+
91+
The PIC32CXSG41 MCU is configured to use the 32.768 kHz external oscillator
92+
with the on-chip PLL generating the 48 MHz system clock.
93+
94+
Serial Port
95+
===========
96+
97+
The PIC32CXSG41 MCU has 8 SERCOM based USARTs with one configured as USARTs in this BSP.
98+
- SERCOM4 is the default Zephyr console.
99+
100+
- SERCOM4 115200 8n1 connected to the onboard Microchip Embedded Debugger (EDBG).
101+
102+
The PIC32CXSG41 MCU has 8 SERCOM based SPIs.
103+
104+
The PIC32CXSG41 MCU has 5 SERCOM based I2Cs. On the Microchip PIC32CXSG41 Curiosity Ultra,
105+
SERCOM7 is connected to a AT24MAC402 EEPROM.
106+
107+
Programming and Debugging
108+
=========================
109+
110+
.. zephyr:board-supported-runners::
111+
112+
The Microchip PIC32CXSG41 Curiosity Ultra comes with a Microchip Embedded Debugger (EDBG).
113+
This provides a debug interface to the PIC32CXSG41 chip and is supported by OpenOCD.
114+
115+
Flashing
116+
========
117+
118+
#. Build the Zephyr kernel and the ``hello_world`` sample application:
119+
120+
.. zephyr-app-commands::
121+
:zephyr-app: samples/hello_world
122+
:board: pic32cxsg41_cult
123+
:goals: build
124+
:compact:
125+
126+
Connect the Microchip PIC32CXSG41 Curiosity Ultra to your host computer using the USB debug port.
127+
128+
Run your favorite terminal program to listen for output. Under Linux thet terminal should be.
129+
130+
.. code-block:: console
131+
132+
$ minicom -D /dev/ttyACM0 -o
133+
134+
The -o option tells minicom not to send the modem initialization string.
135+
Connection should be configured as follows:
136+
137+
- Speed: 115200
138+
- Data: 8 bits
139+
- Parity: None
140+
- Stop bits: 1
141+
142+
To flash an image:
143+
144+
.. zephyr-app-commands::
145+
:zephyr-app: samples/hello_world
146+
:board: pic32cxsg41_cult
147+
:goals: flash
148+
:compact:
149+
150+
You should see "Hello World! pic32cxsg41_cult" in your terminal.
151+
152+
Debugging
153+
=========
154+
155+
SVD files are included in hal_microchip/pic32c/pic32cxsg/include/pic32cxsg41/svd.
156+
157+
References
158+
**********
159+
160+
.. target-notes::
161+
162+
.. _Microchip website:
163+
https://www.microchip.com/en-us/development-tool/EV06X38A
164+
165+
.. _Microchip PIC32CX SG41-SG60-SG61 Family Datasheet:
166+
https://ww1.microchip.com/downloads/aemDocuments/documents/MCU32/ProductDocuments/DataSheets/PIC32CX-SG41-SG60-SG61-Family-Data-Sheet-DS60001715.pdf
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Copyright (c) 2024 Microchip
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <dt-bindings/pinctrl/pic32cx1025sg41128-pinctrl.h>
7+
8+
&pinctrl {
9+
pwm_default: pwm_default {
10+
group1 {
11+
pinmux = <PC18F_TCC0_WO2>;
12+
};
13+
};
14+
15+
gmac_rmii: gmac_rmii {
16+
group1 {
17+
pinmux = <PA14L_GMAC_GTXCK>,
18+
<PA17L_GMAC_GTXEN>,
19+
<PA18L_GMAC_GTX0>,
20+
<PA19L_GMAC_GTX1>,
21+
<PC20L_GMAC_GRXDV>,
22+
<PA13L_GMAC_GRX0>,
23+
<PA12L_GMAC_GRX1>,
24+
<PA15L_GMAC_GRXER>;
25+
};
26+
};
27+
28+
mdio_default: mdio_default {
29+
group1 {
30+
pinmux = <PC22L_GMAC_GMDC>,
31+
<PC23L_GMAC_GMDIO>;
32+
};
33+
};
34+
35+
sercom7_i2c_default: sercom7_i2c_default {
36+
group1 {
37+
pinmux = <PD8C_SERCOM7_PAD0>,
38+
<PD9C_SERCOM7_PAD1>;
39+
};
40+
};
41+
42+
sercom0_spi_default: sercom0_spi_default {
43+
group1 {
44+
pinmux = <PB24C_SERCOM0_PAD0>,
45+
<PB25C_SERCOM0_PAD1>,
46+
<PC25C_SERCOM0_PAD3>;
47+
};
48+
};
49+
50+
sercom4_uart_default: sercom4_uart_default {
51+
group1 {
52+
pinmux = <PB12C_SERCOM4_PAD0>,
53+
<PB13C_SERCOM4_PAD1>;
54+
};
55+
};
56+
57+
usb_dc_default: usb_dc_default {
58+
group1 {
59+
pinmux = <PA25H_USB_DP>,
60+
<PA24H_USB_DM>;
61+
};
62+
};
63+
};

0 commit comments

Comments
 (0)