Skip to content

Commit c22e022

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 8f77445 commit c22e022

27 files changed

+677
-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: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
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`_.
100+
101+
.. image:: img/PIC32CXSG41-pinout1.jpg
102+
:align: center
103+
:alt: PIC32CXSG41-CULT-pinout1
104+
105+
.. image:: img/PIC32CXSG41-pinout2.jpg
106+
:align: center
107+
:alt: PIC32CXSG41-CULT-pinout2
108+
109+
.. image:: img/PIC32CXSG41-pinout3.jpg
110+
:align: center
111+
:alt: PIC32CXSG41-CULT-pinout3
112+
113+
Default Zephyr Peripheral Mapping:
114+
----------------------------------
115+
- SERCOM2 USART TX : PB13
116+
- SERCOM2 USART RX : PB12
117+
- GPIO/PWM LED1 : PC21
118+
- GPIO/PWM LED2 : PA16
119+
- GPIO SW1 : PD00
120+
- GPIO SW2 : PD01
121+
- GMAC RMII REFCK : PA14
122+
- GMAC RMII TXEN : PA17
123+
- GMAC RMII TXD0 : PA18
124+
- GMAC RMII TXD1 : PA19
125+
- GMAC RMII CRSDV : PC20
126+
- GMAC RMII RXD0 : PA13
127+
- GMAC RMII RXD1 : PA12
128+
- GMAC RMII RXER : PA15
129+
- GMAC MDIO MDC : PC11
130+
- GMAC MDIO MDIO : PC12
131+
- SERCOM0 SPI SCK : PB24
132+
- SERCOM0 SPI MOSI : PB25
133+
- SERCOM0 SPI MISO : PC25
134+
- SERCOM0 SPI SS : PC24
135+
- SERCOM7 I2C SDA : PD08
136+
- SERCOM7 I2C SCL : PD09
137+
- USB DP : PA25
138+
- USB DM : PA24
139+
140+
System Clock
141+
============
142+
143+
The PIC32CXSG41 MCU is configured to use the 32.768 kHz external oscillator
144+
with the on-chip PLL generating the 48 MHz system clock.
145+
146+
Serial Port
147+
===========
148+
149+
The PIC32CXSG41 MCU has 8 SERCOM based USARTs with one configured as USARTs in
150+
this BSP. SERCOM4 is the default Zephyr console.
151+
152+
- SERCOM4 115200 8n1 connected to the onboard Microchip Embedded Debugger (EDBG)
153+
154+
PWM
155+
===
156+
157+
The PIC32CXSG41 MCU has 5 TCC based PWM units with up to 6 outputs each and a period
158+
of 24 bits or 16 bits. If PWM TCC is enabled then LED0 is
159+
driven by TCC0 instead of by GPIO.
160+
161+
SPI Port
162+
========
163+
164+
The PIC32CXSG41 MCU has 8 SERCOM based SPIs.
165+
166+
I2C Port
167+
========
168+
169+
The PIC32CXSG41 MCU has 5 SERCOM based I2Cs. On the Microchip PIC32CXSG41 Curiosity Ultra,
170+
SERCOM7 is connected to a AT24MAC402 EEPROM.
171+
172+
Programming and Debugging
173+
*************************
174+
175+
The Microchip PIC32CXSG41 Curiosity Ultra comes with a Microchip Embedded Debugger (EDBG).
176+
This provides a debug interface to the PIC32CXSG41 chip and is supported by OpenOCD.
177+
178+
Flashing
179+
========
180+
181+
#. Build the Zephyr kernel and the ``hello_world`` sample application:
182+
183+
.. zephyr-app-commands::
184+
:zephyr-app: samples/hello_world
185+
:board: pic32cxsg41_cult
186+
:goals: build
187+
:compact:
188+
189+
#. Connect the Microchip PIC32CXSG41 Curiosity Ultra to your host computer using the USB debug
190+
port.
191+
192+
#. Run your favorite terminal program to listen for output. Under Linux the
193+
terminal should be :code:`/dev/ttyACM0`. For example:
194+
195+
.. code-block:: console
196+
197+
$ minicom -D /dev/ttyACM0 -o
198+
199+
The -o option tells minicom not to send the modem initialization
200+
string. Connection should be configured as follows:
201+
202+
- Speed: 115200
203+
- Data: 8 bits
204+
- Parity: None
205+
- Stop bits: 1
206+
207+
#. To flash an image:
208+
209+
.. zephyr-app-commands::
210+
:zephyr-app: samples/hello_world
211+
:board: pic32cxsg41_cult
212+
:goals: flash
213+
:compact:
214+
215+
You should see "Hello World! pic32cxsg41_cult" in your terminal.
216+
217+
Debugging
218+
=========
219+
220+
#.svd files are included in hal_microchip/pic32c/pic32cxsg/include/pic32cxsg41/svd
221+
222+
References
223+
**********
224+
225+
.. target-notes::
226+
227+
.. _Microchip website:
228+
https://www.microchip.com/en-us/development-tool/EV06X38A
229+
230+
.. _Microchip PIC32CX SG41-SG60-SG61 Family Datasheet:
231+
https://ww1.microchip.com/downloads/aemDocuments/documents/MCU32/ProductDocuments/DataSheets/PIC32CX-SG41-SG60-SG61-Family-Data-Sheet-DS60001715.pdf

0 commit comments

Comments
 (0)