Skip to content

Commit 92df3a3

Browse files
MyGh64605Michael Sherwood
authored andcommitted
boards: microchip Addition of pic32cxsg board
Addition of pic32cxsg SG41 Curiosity Ultra board Signed-off-by: Michael D Sherwood <[email protected]>
1 parent c558633 commit 92df3a3

27 files changed

+678
-139
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")
59.3 KB
Loading
70.7 KB
Loading
47.3 KB
Loading
84.5 KB
Loading
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
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 supports the following hardware
39+
40+
+---------------+------------+----------------------------+
41+
| Interface | Controller | Driver/Component |
42+
+===============+============+============================+
43+
| ADC | on-chip | adc |
44+
+---------------+------------+----------------------------+
45+
| DAC | on-chip | dac |
46+
+---------------+------------+----------------------------+
47+
| DMAC | on-chip | dma |
48+
+---------------+------------+----------------------------+
49+
| EEPROM | i2c | eeprom, EUI-48 MAC Address |
50+
+---------------+------------+----------------------------+
51+
| EIC | on-chip | interrupt_controller |
52+
+---------------+------------+----------------------------+
53+
| GMAC | on-chip | ethernet, mdio |
54+
+---------------+------------+----------------------------+
55+
| GPIO | on-chip | gpio |
56+
+---------------+------------+----------------------------+
57+
| MPU | on-chip | arch/arm |
58+
+---------------+------------+----------------------------+
59+
| NVIC | on-chip | arch/arm |
60+
+---------------+------------+----------------------------+
61+
| NVMCTRL | on-chip | flash |
62+
+---------------+------------+----------------------------+
63+
| PORT | on-chip | pinctrl |
64+
+---------------+------------+----------------------------+
65+
| RTC | on-chip | timer |
66+
+---------------+------------+----------------------------+
67+
| SERCOM I2C | on-chip | i2c |
68+
+---------------+------------+----------------------------+
69+
| SERCOM SPI | on-chip | spi |
70+
+---------------+------------+----------------------------+
71+
| SERCOM USART | on-chip | serial, console |
72+
+---------------+------------+----------------------------+
73+
| Serial Number | on-chip | hwinfo |
74+
+---------------+------------+----------------------------+
75+
| SYSTICK | on-chip | timer |
76+
+---------------+------------+----------------------------+
77+
| TC | on-chip | counter |
78+
+---------------+------------+----------------------------+
79+
| TCC | on-chip | counter, pwm |
80+
+---------------+------------+----------------------------+
81+
| TRNG | on-chip | entropy |
82+
+---------------+------------+----------------------------+
83+
| USB | on-chip | usb |
84+
+---------------+------------+----------------------------+
85+
| WDT | on-chip | watchdog |
86+
+---------------+------------+----------------------------+
87+
88+
Other hardware features are not currently supported by Zephyr.
89+
90+
The default configuration can be found in the Kconfig
91+
:zephyr_file:`boards/microchip/pic32cxsg41_cult/pic32cxsg41_cult_defconfig`.
92+
93+
Pin Mapping
94+
===========
95+
96+
The Microchip PIC32CXSG41 Curiosity Ultra evaluation kit has 4 GPIO controllers. These
97+
controllers are responsible for pin muxing, input/output, pull-up, etc.
98+
99+
For more details please refer to `Microchip PIC32CX SG41-SG60-SG61 Family Datasheet`_ and
100+
the `Microchip PIC32CXSG41 Curiosity Ultra Schematic`_.
101+
102+
.. image:: img/PIC32CXSG41-pinout1.jpg
103+
:align: center
104+
:alt: PIC32CXSG41-CULT-pinout1
105+
106+
.. image:: img/PIC32CXSG41-pinout2.jpg
107+
:align: center
108+
:alt: PIC32CXSG41-CULT-pinout2
109+
110+
.. image:: img/PIC32CXSG41-pinout3.jpg
111+
:align: center
112+
:alt: PIC32CXSG41-CULT-pinout3
113+
114+
Default Zephyr Peripheral Mapping:
115+
----------------------------------
116+
- SERCOM2 USART TX : PB13
117+
- SERCOM2 USART RX : PB12
118+
- GPIO/PWM LED1 : PC21
119+
- GPIO/PWM LED2 : PA16
120+
- GPIO SW1 : PD00
121+
- GPIO SW2 : PD01
122+
- GMAC RMII REFCK : PA14
123+
- GMAC RMII TXEN : PA17
124+
- GMAC RMII TXD0 : PA18
125+
- GMAC RMII TXD1 : PA19
126+
- GMAC RMII CRSDV : PC20
127+
- GMAC RMII RXD0 : PA13
128+
- GMAC RMII RXD1 : PA12
129+
- GMAC RMII RXER : PA15
130+
- GMAC MDIO MDC : PC11
131+
- GMAC MDIO MDIO : PC12
132+
- SERCOM0 SPI SCK : PB24
133+
- SERCOM0 SPI MOSI : PB25
134+
- SERCOM0 SPI MISO : PC25
135+
- SERCOM0 SPI SS : PC24
136+
- SERCOM7 I2C SDA : PD08
137+
- SERCOM7 I2C SCL : PD09
138+
- USB DP : PA25
139+
- USB DM : PA24
140+
141+
System Clock
142+
============
143+
144+
The PIC32CXSG41 MCU is configured to use the 32.768 kHz external oscillator
145+
with the on-chip PLL generating the 48 MHz system clock.
146+
147+
Serial Port
148+
===========
149+
150+
The PIC32CXSG41 MCU has 8 SERCOM based USARTs with one configured as USARTs in
151+
this BSP. SERCOM4 is the default Zephyr console.
152+
153+
- SERCOM4 115200 8n1 connected to the onboard Microchip Embedded Debugger (EDBG)
154+
155+
PWM
156+
===
157+
158+
The PIC32CXSG41 MCU has 5 TCC based PWM units with up to 6 outputs each and a period
159+
of 24 bits or 16 bits. If PWM TCC is enabled then LED0 is
160+
driven by TCC0 instead of by GPIO.
161+
162+
SPI Port
163+
========
164+
165+
The PIC32CXSG41 MCU has 8 SERCOM based SPIs.
166+
167+
I2C Port
168+
========
169+
170+
The PIC32CXSG41 MCU has 5 SERCOM based I2Cs. On the Microchip PIC32CXSG41 Curiosity Ultra,
171+
SERCOM7 is connected to a AT24MAC402 EEPROM.
172+
173+
Programming and Debugging
174+
*************************
175+
176+
The Microchip PIC32CXSG41 Curiosity Ultra comes with a Microchip Embedded Debugger (EDBG).
177+
This provides a debug interface to the PIC32CXSG41 chip and is supported by OpenOCD.
178+
179+
Flashing
180+
========
181+
182+
#. Build the Zephyr kernel and the ``hello_world`` sample application:
183+
184+
.. zephyr-app-commands::
185+
:zephyr-app: samples/hello_world
186+
:board: pic32cxsg41_cult
187+
:goals: build
188+
:compact:
189+
190+
#. Connect the Microchip PIC32CXSG41 Curiosity Ultra to your host computer using the USB debug
191+
port.
192+
193+
#. Run your favorite terminal program to listen for output. Under Linux the
194+
terminal should be :code:`/dev/ttyACM0`. For example:
195+
196+
.. code-block:: console
197+
198+
$ minicom -D /dev/ttyACM0 -o
199+
200+
The -o option tells minicom not to send the modem initialization
201+
string. Connection should be configured as follows:
202+
203+
- Speed: 115200
204+
- Data: 8 bits
205+
- Parity: None
206+
- Stop bits: 1
207+
208+
#. To flash an image:
209+
210+
.. zephyr-app-commands::
211+
:zephyr-app: samples/hello_world
212+
:board: pic32cxsg41_cult
213+
:goals: flash
214+
:compact:
215+
216+
You should see "Hello World! pic32cxsg41_cult" in your terminal.
217+
218+
Debugging
219+
=========
220+
221+
#.svd files are included in hal_microchip/pic32c/pic32cxsg/include/pic32cxsg41/svd
222+
223+
References
224+
**********
225+
226+
.. target-notes::
227+
228+
.. _Microchip website:
229+
https://www.microchip.com/en-us/development-tool/EV06X38A
230+
231+
.. _Microchip PIC32CX SG41-SG60-SG61 Family Datasheet:
232+
https://ww1.microchip.com/downloads/aemDocuments/documents/MCU32/ProductDocuments/DataSheets/PIC32CX-SG41-SG60-SG61-Family-Data-Sheet-DS60001715.pdf

0 commit comments

Comments
 (0)