Skip to content

boards: peregrine: Introduce sam4l_wm400_cape #83310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions MAINTAINERS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5565,6 +5565,15 @@ Random:
labels:
- "area: Random"

Peregrine Platforms:
status: maintained
maintainers:
- nandojve
files:
- boards/peregrine/
labels:
- "platform: Peregrine"

# This area is to be converted to a subarea
Testing with Renode:
status: odd fixes
Expand Down
10 changes: 10 additions & 0 deletions boards/peregrine/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _boards-peregrine:

Peregrine
#########

.. toctree::
:maxdepth: 1
:glob:

**/*
22 changes: 22 additions & 0 deletions boards/peregrine/sam4l_wm400_cape/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2020-2025 Gerson Fernando Budke <nandojve@gmail.com>
# SPDX-License-Identifier: Apache-2.0

if BOARD_SAM4L_WM400_CAPE

if NETWORKING

config IEEE802154_RF2XX
default y
depends on IEEE802154

endif # NETWORKING

# By default the board uses BOSSA bootloader and require that to zephyr relocate
# the code_partition. This should be disabled when using the whole flash without
# bootloader.
config USE_DT_CODE_PARTITION
default y

source "boards/common/usb/Kconfig.cdc_acm_serial.defconfig"

endif # BOARD_SAM4L_WM400_CAPE
5 changes: 5 additions & 0 deletions boards/peregrine/sam4l_wm400_cape/Kconfig.sam4l_wm400_cape
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2020-2025 Gerson Fernando Budke <nandojve@gmail.com>
# SPDX-License-Identifier: Apache-2.0

config BOARD_SAM4L_WM400_CAPE
select SOC_SAM4LC4B
12 changes: 12 additions & 0 deletions boards/peregrine/sam4l_wm400_cape/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2020-2025 Gerson Fernando Budke <nandojve@gmail.com>
# SPDX-License-Identifier: Apache-2.0

board_runner_args(jlink "--device=atsam4lc4b")
board_runner_args(jlink "--speed=4000")
board_runner_args(jlink "--reset-after-load")
board_runner_args(jlink "-rtos GDBServer/RTOSPlugin_Zephyr")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

board_runner_args(bossac "--bossac-port=/dev/ttyACM0")
board_runner_args(bossac "--erase")
include(${ZEPHYR_BASE}/boards/common/bossac.board.cmake)
6 changes: 6 additions & 0 deletions boards/peregrine/sam4l_wm400_cape/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: sam4l_wm400_cape
full_name: SAM4L WM-400 Cape Board
vendor: peregrine
socs:
- name: sam4lc4b
Binary file not shown.
153 changes: 153 additions & 0 deletions boards/peregrine/sam4l_wm400_cape/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
.. zephyr:board:: sam4l_wm400_cape

Overview
********

The SAM4L WM-400 Cape is a full featured design to enable IEEE 802.15.4 low
power nodes. It is a Beaglebone Black cape concept with an Atmel AT86RF233
radio transceiver. User can develop Touch interface and have access to many
sensors and conectivity buses.

Hardware
********

- ATSAM4LC4B ARM Cortex-M4 Processor
- 12 MHz crystal oscillator
- 32.768 kHz crystal oscillator
- 1 RS-232 interface
- 1 RS-485 full duplex interface
- Micro-AB USB OTG host/device
- 1 user touch button and One user pushbutton
- 4 user LEDs
- 1 AT86RF233 IEEE 802.15.4 transceiver
- 1 MPL115A2 I²C Barometric Pressure/Temperature Sensor
- 1 VCNL4010 Proximity/Light Sensor
- 1 CC2D33S Advanced Humidity Temperature Sensor
- 1 NCP18WF104J03RB NTC Temperature Sensor
- 1 TEMT6000X01 Ambient Light Sensor

Supported Features
==================

The ``sam4l_wm400_cape`` board supports the following hardware features:

+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| NVIC | on-chip | nested vector interrupt controller |
+-----------+------------+-------------------------------------+
| SYSTICK | on-chip | systick |
+-----------+------------+-------------------------------------+
| COUNTER | on-chip | counter |
+-----------+------------+-------------------------------------+
| GPIO | on-chip | gpio |
+-----------+------------+-------------------------------------+
| HWINFO | on-chip | Unique 120 bit serial number |
+-----------+------------+-------------------------------------+
| RADIO | on-chip | ieee802154 |
+-----------+------------+-------------------------------------+
| SPI | on-chip | spi |
+-----------+------------+-------------------------------------+
| TRNG | on-chip | entropy |
+-----------+------------+-------------------------------------+
| TWIM | on-chip | i2c master port-interrupt |
+-----------+------------+-------------------------------------+
| USART | on-chip | serial port |
+-----------+------------+-------------------------------------+
| USB | on-chip | USB device |
+-----------+------------+-------------------------------------+

Other hardware features are not currently supported by Zephyr.

The default configuration can be found in the Kconfig
:zephyr_file:`boards/peregrine/sam4l_wm400_cape/sam4l_wm400_cape_defconfig`.

Connections and IOs
===================

For detailed information see `SAM4L WM-400 Cape`_ Information.

System Clock
============

The SAM4L MCU is configured to use the 12 MHz internal oscillator on the board
with the on-chip PLL to generate an 48 MHz system clock.

Serial Port
===========

The ATSAM4LC4B MCU has 4 USARTs. One of the USARTs (USART3) is shared between
RS-232 and RS-485 interfaces. The default console terminal is available at
RS-232 onboard port or via USB device.

Programming and Debugging
*************************

The SAM4L WM-400 Cape board has a 10-pin header to connect to a Segger JLink.
Using the JLink is possible to program and debug the SAM4LC4B chip. The board
came with a SAM-BA bootloader that only can be used to flash the software.

Flashing
========

#. For JLink instructions, see :ref:`jlink-debug-host-tools`.

#. Run your favorite terminal program to listen for output. Under Linux the
terminal should be :code:`/dev/ttyACM0`. For example:

.. code-block:: console

$ minicom -D /dev/ttyACM0 -o

The -o option tells minicom not to send the modem initialization
string. Connection should be configured as follows:

- Speed: 115200
- Data: 8 bits
- Parity: None
- Stop bits: 1

#. Connect the SAM4L WM-400 Cape board to your host computer using the
USB debug port. Then build and flash the :zephyr:code-sample:`hello_world`
application.

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: sam4l_wm400_cape
:goals: build flash

You should see ``Hello World! sam4l_wm400_cape`` in your terminal.

#. For SAM-BA bootloader instructions, see :ref:`atmel_sam_ba_bootloader`.

#. Connect the SAM4L WM-400 Cape board to your host computer using the
USB debug port pressing the S1 button. Then build and flash the
:zephyr:code-sample:`hello_world` application. After programming the board
the application will start automatically.

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: sam4l_wm400_cape
:goals: build flash
:flash-args: -r bossac


Debugging
=========

You can debug an application in the usual way. Here is an example for the
:zephyr:code-sample:`hello_world` application.

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: sam4l_wm400_cape
:maybe-skip-config:
:goals: debug

References
**********

.. target-notes::

.. _SAM4L WM-400 Cape:
https://gfbudke.wordpress.com/2014/04/30/modulo-wireless-ieee-802-15-4zigbee-wm-400-e-wm-400l-bbbs
60 changes: 60 additions & 0 deletions boards/peregrine/sam4l_wm400_cape/sam4l_wm400_cape-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright (c) 2022-2025 Gerson Fernando Budke <nandojve@gmail.com>
* SPDX-License-Identifier: Apache-2.0
*/

#include <dt-bindings/pinctrl/sam4lcXb-pinctrl.h>

&pinctrl {
spi0_default: spi0_default {
group1 {
pinmux = <PA21A_SPI_MISO>,
<PA22A_SPI_MOSI>,
<PA23A_SPI_SCK>,
<PA13C_SPI_NPCS1>,
<PA14C_SPI_NPCS2>;
};
};

twi1_default: twi1_default {
group1 {
pinmux = <PB1A_TWIMS1_TWCK>,
<PB0A_TWIMS1_TWD>;
};
};

usart0_default: usart0_default {
group1 {
pinmux = <PB14A_USART0_RXD>,
<PB15A_USART0_TXD>;
};
};

usart0_hw_ctrl_flow: usart0_hw_ctrl_flow {
group1 {
pinmux = <PB14A_USART0_RXD>,
<PB12A_USART0_RTS>;
bias-pull-up;
};

group2 {
pinmux = <PB15A_USART0_TXD>,
<PB11A_USART0_CTS>,
<PB13A_USART0_CLK>;
};
};

usart1_default: usart1_default {
group1 {
pinmux = <PA15A_USART1_RXD>,
<PA16A_USART1_TXD>;
};
};

usbc_default: usbc_default {
group1 {
pinmux = <PA25A_USBC_DM>,
<PA26A_USBC_DP>;
};
};
};
Loading
Loading