Skip to content

Commit 64c2d78

Browse files
nandojvekartben
authored andcommitted
boards: arm: atmel: Add sam4l_wm400_cape board
Initial Version. Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
1 parent 945da7c commit 64c2d78

File tree

11 files changed

+492
-0
lines changed

11 files changed

+492
-0
lines changed

boards/peregrine/index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. _boards-peregrine:
2+
3+
Peregrine
4+
#########
5+
6+
.. toctree::
7+
:maxdepth: 1
8+
:glob:
9+
10+
**/*
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2020-2025 Gerson Fernando Budke <nandojve@gmail.com>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_SAM4L_WM400_CAPE
5+
6+
if NETWORKING
7+
8+
config IEEE802154_RF2XX
9+
default y
10+
depends on IEEE802154
11+
12+
endif # NETWORKING
13+
14+
# By default the board uses BOSSA bootloader and require that to zephyr relocate
15+
# the code_partition. This should be disabled when using the whole flash without
16+
# bootloader.
17+
config USE_DT_CODE_PARTITION
18+
default y
19+
20+
source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"
21+
22+
endif # BOARD_SAM4L_WM400_CAPE
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2020-2025 Gerson Fernando Budke <nandojve@gmail.com>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_SAM4L_WM400_CAPE
5+
select SOC_SAM4LC4B
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2020-2025 Gerson Fernando Budke <nandojve@gmail.com>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
board_runner_args(jlink "--device=atsam4lc4b")
5+
board_runner_args(jlink "--speed=4000")
6+
board_runner_args(jlink "--reset-after-load")
7+
board_runner_args(jlink "-rtos GDBServer/RTOSPlugin_Zephyr")
8+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
9+
10+
board_runner_args(bossac "--bossac-port=/dev/ttyACM0")
11+
board_runner_args(bossac "--erase")
12+
include(${ZEPHYR_BASE}/boards/common/bossac.board.cmake)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: sam4l_wm400_cape
3+
full_name: SAM4L WM-400 Cape Board
4+
vendor: peregrine
5+
socs:
6+
- name: sam4lc4b
Binary file not shown.
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
.. zephyr:board:: sam4l_wm400_cape
2+
3+
Overview
4+
********
5+
6+
The SAM4L WM-400 Cape is a full featured design to enable IEEE 802.15.4 low
7+
power nodes. It is a Beaglebone Black cape concept with an Atmel AT86RF233
8+
radio transceiver. User can develop Touch interface and have access to many
9+
sensors and conectivity buses.
10+
11+
Hardware
12+
********
13+
14+
- ATSAM4LC4B ARM Cortex-M4 Processor
15+
- 12 MHz crystal oscillator
16+
- 32.768 kHz crystal oscillator
17+
- 1 RS-232 interface
18+
- 1 RS-485 full duplex interface
19+
- Micro-AB USB OTG host/device
20+
- 1 user touch button and One user pushbutton
21+
- 4 user LEDs
22+
- 1 AT86RF233 IEEE 802.15.4 transceiver
23+
- 1 MPL115A2 I²C Barometric Pressure/Temperature Sensor
24+
- 1 VCNL4010 Proximity/Light Sensor
25+
- 1 CC2D33S Advanced Humidity Temperature Sensor
26+
- 1 NCP18WF104J03RB NTC Temperature Sensor
27+
- 1 TEMT6000X01 Ambient Light Sensor
28+
29+
Supported Features
30+
==================
31+
32+
The ``sam4l_wm400_cape`` board supports the following hardware features:
33+
34+
+-----------+------------+-------------------------------------+
35+
| Interface | Controller | Driver/Component |
36+
+===========+============+=====================================+
37+
| NVIC | on-chip | nested vector interrupt controller |
38+
+-----------+------------+-------------------------------------+
39+
| SYSTICK | on-chip | systick |
40+
+-----------+------------+-------------------------------------+
41+
| COUNTER | on-chip | counter |
42+
+-----------+------------+-------------------------------------+
43+
| GPIO | on-chip | gpio |
44+
+-----------+------------+-------------------------------------+
45+
| HWINFO | on-chip | Unique 120 bit serial number |
46+
+-----------+------------+-------------------------------------+
47+
| RADIO | on-chip | ieee802154 |
48+
+-----------+------------+-------------------------------------+
49+
| SPI | on-chip | spi |
50+
+-----------+------------+-------------------------------------+
51+
| TRNG | on-chip | entropy |
52+
+-----------+------------+-------------------------------------+
53+
| TWIM | on-chip | i2c master port-interrupt |
54+
+-----------+------------+-------------------------------------+
55+
| USART | on-chip | serial port |
56+
+-----------+------------+-------------------------------------+
57+
| USB | on-chip | USB device |
58+
+-----------+------------+-------------------------------------+
59+
60+
Other hardware features are not currently supported by Zephyr.
61+
62+
The default configuration can be found in the Kconfig
63+
:zephyr_file:`boards/peregrine/sam4l_wm400_cape/sam4l_wm400_cape_defconfig`.
64+
65+
Connections and IOs
66+
===================
67+
68+
For detailed information see `SAM4L WM-400 Cape`_ Information.
69+
70+
System Clock
71+
============
72+
73+
The SAM4L MCU is configured to use the 12 MHz internal oscillator on the board
74+
with the on-chip PLL to generate an 48 MHz system clock.
75+
76+
Serial Port
77+
===========
78+
79+
The ATSAM4LC4B MCU has 4 USARTs. One of the USARTs (USART3) is shared between
80+
RS-232 and RS-485 interfaces. The default console terminal is available at
81+
RS-232 onboard port or via USB device.
82+
83+
Programming and Debugging
84+
*************************
85+
86+
The SAM4L WM-400 Cape board has a 10-pin header to connect to a Segger JLink.
87+
Using the JLink is possible to program and debug the SAM4LC4B chip. The board
88+
came with a SAM-BA bootloader that only can be used to flash the software.
89+
90+
Flashing
91+
========
92+
93+
#. For JLink instructions, see :ref:`jlink-debug-host-tools`.
94+
95+
#. Run your favorite terminal program to listen for output. Under Linux the
96+
terminal should be :code:`/dev/ttyACM0`. For example:
97+
98+
.. code-block:: console
99+
100+
$ minicom -D /dev/ttyACM0 -o
101+
102+
The -o option tells minicom not to send the modem initialization
103+
string. Connection should be configured as follows:
104+
105+
- Speed: 115200
106+
- Data: 8 bits
107+
- Parity: None
108+
- Stop bits: 1
109+
110+
#. Connect the SAM4L WM-400 Cape board to your host computer using the
111+
USB debug port. Then build and flash the :zephyr:code-sample:`hello_world`
112+
application.
113+
114+
.. zephyr-app-commands::
115+
:zephyr-app: samples/hello_world
116+
:board: sam4l_wm400_cape
117+
:goals: build flash
118+
119+
You should see ``Hello World! sam4l_wm400_cape`` in your terminal.
120+
121+
#. For SAM-BA bootloader instructions, see :ref:`atmel_sam_ba_bootloader`.
122+
123+
#. Connect the SAM4L WM-400 Cape board to your host computer using the
124+
USB debug port pressing the S1 button. Then build and flash the
125+
:zephyr:code-sample:`hello_world` application. After programming the board
126+
the application will start automatically.
127+
128+
.. zephyr-app-commands::
129+
:zephyr-app: samples/hello_world
130+
:board: sam4l_wm400_cape
131+
:goals: build flash
132+
:flash-args: -r bossac
133+
134+
135+
Debugging
136+
=========
137+
138+
You can debug an application in the usual way. Here is an example for the
139+
:zephyr:code-sample:`hello_world` application.
140+
141+
.. zephyr-app-commands::
142+
:zephyr-app: samples/hello_world
143+
:board: sam4l_wm400_cape
144+
:maybe-skip-config:
145+
:goals: debug
146+
147+
References
148+
**********
149+
150+
.. target-notes::
151+
152+
.. _SAM4L WM-400 Cape:
153+
https://gfbudke.wordpress.com/2014/04/30/modulo-wireless-ieee-802-15-4zigbee-wm-400-e-wm-400l-bbbs
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Copyright (c) 2022-2025 Gerson Fernando Budke <nandojve@gmail.com>
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <dt-bindings/pinctrl/sam4lcXb-pinctrl.h>
7+
8+
&pinctrl {
9+
spi0_default: spi0_default {
10+
group1 {
11+
pinmux = <PA21A_SPI_MISO>,
12+
<PA22A_SPI_MOSI>,
13+
<PA23A_SPI_SCK>,
14+
<PA13C_SPI_NPCS1>,
15+
<PA14C_SPI_NPCS2>;
16+
};
17+
};
18+
19+
twi1_default: twi1_default {
20+
group1 {
21+
pinmux = <PB1A_TWIMS1_TWCK>,
22+
<PB0A_TWIMS1_TWD>;
23+
};
24+
};
25+
26+
usart0_default: usart0_default {
27+
group1 {
28+
pinmux = <PB14A_USART0_RXD>,
29+
<PB15A_USART0_TXD>;
30+
};
31+
};
32+
33+
usart0_hw_ctrl_flow: usart0_hw_ctrl_flow {
34+
group1 {
35+
pinmux = <PB14A_USART0_RXD>,
36+
<PB12A_USART0_RTS>;
37+
bias-pull-up;
38+
};
39+
40+
group2 {
41+
pinmux = <PB15A_USART0_TXD>,
42+
<PB11A_USART0_CTS>,
43+
<PB13A_USART0_CLK>;
44+
};
45+
};
46+
47+
usart1_default: usart1_default {
48+
group1 {
49+
pinmux = <PA15A_USART1_RXD>,
50+
<PA16A_USART1_TXD>;
51+
};
52+
};
53+
54+
usbc_default: usbc_default {
55+
group1 {
56+
pinmux = <PA25A_USBC_DM>,
57+
<PA26A_USBC_DP>;
58+
};
59+
};
60+
};

0 commit comments

Comments
 (0)