Skip to content

Commit 16f2b2f

Browse files
cyliangtwkartben
authored andcommitted
boards: nuvoton: add support for numaker m5531
Add new development board numaker_m5531 for m5531h2l. Signed-off-by: cyliang tw <[email protected]>
1 parent f33104e commit 16f2b2f

File tree

13 files changed

+312
-0
lines changed

13 files changed

+312
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
#
3+
# Nuvoton NuMaker M5531 board configuration
4+
#
5+
# Copyright (c) 2025 Nuvoton Technology Corporation.
6+
7+
if BOARD_NUMAKER_M5531
8+
9+
if NETWORKING
10+
11+
config NET_L2_ETHERNET
12+
default y if !MODEM
13+
14+
endif # NETWORKING
15+
16+
endif # BOARD_NUMAKER_M5531
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
#
3+
# Nuvoton NuMaker M5531 board configuration
4+
#
5+
# Copyright (c) 2025 Nuvoton Technology Corporation.
6+
7+
config BOARD_NUMAKER_M5531
8+
select SOC_M55M1XXX
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
board_runner_args(pyocd "--target=m55m1h2ljae")
4+
5+
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
6+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: numaker_m5531
3+
full_name: NUMAKER M5531
4+
vendor: nuvoton
5+
socs:
6+
- name: m55m1xxx
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
.. zephyr:board:: numaker_m5531
2+
3+
Overview
4+
********
5+
6+
The NuMaker M5531 is an Internet of Things (IoT) application focused platform
7+
specially developed by Nuvoton. The NuMaker-M5531 is based on the NuMicro® M5531
8+
series MCU with ARM® -Cortex®-M55 core.
9+
10+
Features
11+
========
12+
- 32-bit Arm Cortex®-M55 M5531H2LJAE MCU
13+
- Core clock up to 220 MHz
14+
- 2 MB embedded Dual Bank Flash and 1344 KB SRAM
15+
- 128 KB DTCM and 64 KB ITCM
16+
- USB 2.0 Full-Speed OTG / Device
17+
- USB 1.1 Host
18+
- Arduino UNO compatible interface
19+
- One push-button is for reset
20+
- Two LEDs: one is for power indication and the other is for user-defined
21+
- On-board NU-Link2 ICE debugger/programmer with SWD connector
22+
23+
More information about the board can be found at the `NuMaker M5531 User Manual`_.
24+
25+
Supported Features
26+
==================
27+
28+
.. zephyr:board-supported-hw::
29+
30+
The on-board 12-MHz crystal allows the device to run at its maximum operating speed of 220 MHz.
31+
32+
More details about the supported peripherals are available in `M5531 TRM`_
33+
34+
Building and Flashing
35+
*********************
36+
37+
.. zephyr:board-supported-runners::
38+
39+
Flashing
40+
========
41+
42+
Here is an example for the :zephyr:code-sample:`hello_world` application.
43+
44+
On board debugger Nu-link2 can emulate UART0 as a virtual COM port over usb,
45+
To enable this, set ISW1 DIP switch 1-3 (TXD RXD VOM) to ON.
46+
Connect the NuMaker-M5531 to your host computer using the USB port, then
47+
run a serial host program to connect with your board. For example:
48+
49+
.. code-block:: console
50+
51+
$ minicom -D /dev/ttyACM0
52+
53+
.. zephyr-app-commands::
54+
:zephyr-app: samples/hello_world
55+
:board: numaker_m5531
56+
:goals: flash
57+
58+
Debugging
59+
=========
60+
61+
Here is an example for the :zephyr:code-sample:`hello_world` application.
62+
63+
.. zephyr-app-commands::
64+
:zephyr-app: samples/hello_world
65+
:board: numaker_m5531
66+
:goals: debug
67+
68+
Step through the application in your debugger.
69+
70+
References
71+
**********
72+
73+
.. target-notes::
74+
75+
.. _NuMaker M5531 User Manual:
76+
https://www.nuvoton.com/products/microcontrollers/arm-cortex-m55-mcus/m5531-series/
77+
.. _M5531 TRM:
78+
https://www.nuvoton.com/products/microcontrollers/arm-cortex-m55-mcus/m5531-series/
89 KB
Loading
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2025 Nuvoton Technology Corporation.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include "pinctrl/m55m1h2l-pinctrl.h"
8+
9+
&pinctrl {
10+
uart0_default: uart0_default {
11+
group0 {
12+
pinmux = <PB12MFP_UART0_RXD>,
13+
<PB13MFP_UART0_TXD>;
14+
};
15+
};
16+
17+
/* TX/RX/RTS/CTS/RST --> D1/D0/A2/A3/D2 --> PB3/PB2/PB8/PB9/PC9 */
18+
uart1_default: uart1_default {
19+
group0 {
20+
pinmux = <PB9MFP_UART1_nCTS>,
21+
<PB8MFP_UART1_nRTS>,
22+
<PB2MFP_UART1_RXD>,
23+
<PB3MFP_UART1_TXD>,
24+
<PC9MFP_GPIO>;
25+
};
26+
};
27+
28+
/* USBD multi-function pins for VBUS, D+, D-, and ID pins */
29+
usbd_default: usbd_default {
30+
group0 {
31+
pinmux = <PA12MFP_USB_VBUS>,
32+
<PA13MFP_USB_D_MINUS>,
33+
<PA14MFP_USB_D_PLUS>,
34+
<PA15MFP_USB_OTG_ID>;
35+
};
36+
};
37+
};
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/*
2+
* Copyright (c) 2025 Nuvoton Technology Corporation.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <nuvoton/m5531h2l.dtsi>
10+
#include "numaker_m5531-pinctrl.dtsi"
11+
#include <zephyr/dt-bindings/input/input-event-codes.h>
12+
13+
/ {
14+
model = "Nuvoton NuMaker M5531 board";
15+
compatible = "nuvoton,numaker-m5531";
16+
17+
aliases {
18+
led0 = &green_led;
19+
led1 = &yellow_led;
20+
sw0 = &btn0;
21+
sw1 = &btn1;
22+
};
23+
24+
chosen {
25+
zephyr,console = &uart0;
26+
zephyr,shell-uart = &uart0;
27+
zephyr,sram = &sram0;
28+
zephyr,dtcm = &dtcm;
29+
zephyr,itcm = &itcm;
30+
zephyr,flash = &flash0;
31+
zephyr,code-partition = &slot0_partition;
32+
zephyr,canbus = &canfd0;
33+
};
34+
35+
leds {
36+
compatible = "gpio-leds";
37+
38+
green_led: led_0 {
39+
gpios = <&gpiod 5 GPIO_ACTIVE_LOW>;
40+
label = "User LD0";
41+
};
42+
43+
yellow_led: led_1 {
44+
gpios = <&gpiod 6 GPIO_ACTIVE_LOW>;
45+
label = "User LD1";
46+
};
47+
};
48+
49+
gpio_keys {
50+
compatible = "gpio-keys";
51+
52+
btn0: btn0 {
53+
label = "BTN0";
54+
gpios = <&gpioi 11 GPIO_ACTIVE_LOW>;
55+
zephyr,code = <INPUT_KEY_0>;
56+
};
57+
58+
btn1: btn1 {
59+
label = "BTN1";
60+
gpios = <&gpioh 1 GPIO_ACTIVE_LOW>;
61+
zephyr,code = <INPUT_KEY_1>;
62+
};
63+
};
64+
};
65+
66+
&gpiod {
67+
status = "okay";
68+
};
69+
70+
&gpioh {
71+
status = "okay";
72+
};
73+
74+
&gpioi {
75+
status = "okay";
76+
};
77+
78+
&flash0 {
79+
partitions {
80+
compatible = "fixed-partitions";
81+
#address-cells = <1>;
82+
#size-cells = <1>;
83+
84+
boot_partition: partition@0 {
85+
label = "mcuboot";
86+
reg = <0x0 0x8000>;
87+
};
88+
89+
slot0_partition: partition@8000 {
90+
label = "image-0";
91+
reg = <0x8000 0xf8000>;
92+
};
93+
94+
slot1_partition: partition@100000 {
95+
label = "image-1";
96+
reg = <0x100000 0xf8000>;
97+
};
98+
99+
storage_partition: partition@1f8000 {
100+
label = "storage";
101+
reg = <0x1f8000 0x8000>;
102+
};
103+
};
104+
};
105+
106+
&sram0 {
107+
reg = <0x20100000 DT_SIZE_K(1344)>;
108+
};
109+
110+
&uart0 {
111+
current-speed = <115200>;
112+
pinctrl-0 = <&uart0_default>;
113+
pinctrl-names = "default";
114+
status = "okay";
115+
};
116+
117+
/* On enabled, usbd is required to be clocked in 48MHz. */
118+
zephyr_udc0: &usbd {
119+
pinctrl-0 = <&usbd_default>;
120+
pinctrl-names = "default";
121+
status = "okay";
122+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) 2025 Nuvoton Technology Corporation.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
identifier: numaker_m5531
5+
name: NUVOTON NUMAKER-M5531 Kit
6+
type: mcu
7+
arch: arm
8+
toolchain:
9+
- zephyr
10+
- gnuarmemb
11+
ram: 1536
12+
flash: 2048
13+
supported:
14+
- gpio
15+
vendor: nuvoton
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
CONFIG_GPIO=y
4+
5+
# Enable system clock controller driver
6+
CONFIG_CLOCK_CONTROL=y
7+
CONFIG_CLOCK_CONTROL_NUMAKER_SCC=y
8+
9+
# Enable UART driver
10+
CONFIG_SERIAL=y
11+
CONFIG_UART_INTERRUPT_DRIVEN=y
12+
13+
# Console
14+
CONFIG_CONSOLE=y
15+
CONFIG_UART_CONSOLE=y

0 commit comments

Comments
 (0)