boards: gardena: Add smart garden radio module

This adds support for the SiM3U/Si4467 based SoM used on the GARDENA
smart Gateway [1] (art. no 19000 and 19005).

[1] https://github.com/husqvarnagroup/smart-garden-gateway-public

Signed-off-by: Michael Zimmermann <michael.zimmermann@grandcentrix.net>
This commit is contained in:
Michael Zimmermann 2023-05-14 09:28:19 +02:00 committed by Carles Cufí
parent 9cc3364d3c
commit bd4212e458
11 changed files with 326 additions and 0 deletions

10
boards/gardena/index.rst Normal file
View File

@ -0,0 +1,10 @@
.. _boards-gardena:
GARDENA GmbH
############
.. toctree::
:maxdepth: 1
:glob:
**/*

View File

@ -0,0 +1,6 @@
# Copyright (c) 2024 GARDENA GmbH
#
# SPDX-License-Identifier: Apache-2.0
config BOARD_SGRM
select SOC_PART_NUMBER_SIM3U167BGM

View File

@ -0,0 +1,8 @@
# Copyright (c) 2024 GARDENA GmbH
#
# SPDX-License-Identifier: Apache-2.0
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
board_runner_args(jlink "--device=SiM3U167")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View File

@ -0,0 +1,10 @@
# Copyright (c) 2024 GARDENA GmbH
#
# SPDX-License-Identifier: Apache-2.0
board:
name: sgrm
full_name: Smart Garden Radio Module
vendor: gardena
socs:
- name: sim3u167

View File

@ -0,0 +1,113 @@
.. _gardena_sgrm:
GARDENA Smart Garden Radio Module
#################################
Overview
********
This is a SoM that is used as a radio module by the GARDENA smart gateway (manual_, `FOSS parts`_).
.. figure:: sgrm.webp
:align: center
:alt: GARDENA smart Gateway with radio module
.. _manual: https://www.gardena.com/tdrdownload//pub000070911/doc000120830
.. _FOSS parts: https://github.com/husqvarnagroup/smart-garden-gateway-public
Hardware
********
- Silicon Labs SiM3U167-B-GM_ SoC
- Silicon Labs Si4467_ transceiver (via SPI)
- Controls an RGB LED via high drive pins. It's expected to mirror the state of 3 low-drive pins
coming from the Linux SoC.
- UART is connected to the Linux SoC. Usually it's used for PPP, but it can also be used for
debugging when PPP is not active.
.. _SiM3U167-B-GM: https://www.silabs.com/mcu/32-bit-microcontrollers/precision32-sim3u1xx/device.SiM3U167-B-GQ?tab=specs
.. _Si4467: https://www.silabs.com/wireless/proprietary/ezradiopro-sub-ghz-ics/device.si4467?tab=specs
Supported Features
==================
The ``sgrm`` board target supports the following hardware features:
+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| NVIC | on-chip | nested vector interrupt controller |
+-----------+------------+-------------------------------------+
| SYSTICK | on-chip | systick |
+-----------+------------+-------------------------------------+
| DMA | on-chip | dma |
+-----------+------------+-------------------------------------+
| FLASH | on-chip | flash memory |
+-----------+------------+-------------------------------------+
| GPIO | on-chip | gpio |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial port-polling; |
| | | serial port-interrupt |
+-----------+------------+-------------------------------------+
Connections and IOs
===================
+--------+--------------------------+----------------------------------------------------+
| Pin | Name | Note |
+========+==========================+====================================================+
| PB0.0 | TX (O) | Serial connection to the Linux SoM |
+--------+--------------------------+ |
| PB0.1 | RX (I) | |
+--------+--------------------------+ |
| PB0.2 | RTS (O) | |
+--------+--------------------------+ |
| PB0.3 | CTS (I) | |
+--------+--------------------------+----------------------------------------------------+
| PB0.4 | LED red (I) | Controlled by the Linux SoM |
+--------+--------------------------+ |
| PB0.5 | LED green (I) | |
+--------+--------------------------+ |
| PB0.6 | LED blue (I) | |
+--------+--------------------------+----------------------------------------------------+
| PB0.13 | TX (O) | UART1 for debugging (no connection to Linux SoM) |
+--------+--------------------------+ |
| PB0.14 | RX (I) | |
+--------+--------------------------+----------------------------------------------------+
| PB4.0 | LED red (O) | Mirrors PB0.4 |
+--------+--------------------------+----------------------------------------------------+
| PB4.1 | LED green (O) | Mirrors PB0.5 |
+--------+--------------------------+----------------------------------------------------+
| PB4.2 | LED blue (O) | Mirrors PB0.6 |
+--------+--------------------------+----------------------------------------------------+
Programming and Debugging
*************************
Flashing
========
The easiest way is to do this via SSH from the Linux SoM that's connected to the SiM3U SoM.
On your building machine:
.. code-block:: shell
scp -O build/zephyr/zephyr.hex root@IP:/tmp/
On the gateway:
.. code-block:: shell
openocd -f board/gardena_radio.cfg -c 'program /tmp/zephyr.hex verify exit'
reset-rm
Debugging
=========
The easiest way is to do this via SSH from the Linux gateway as well:
.. code-block:: shell
openocd -f board/gardena_radio.cfg -c init

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2024 GARDENA GmbH
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/dt-bindings/pinctrl/si32-pinctrl.h>
&pinctrl {
usart0_default: usart0_default {
group1 {
pinmux = <SI32_MUX(USART0_TX, 0, 0)>,
<SI32_MUX(USART0_RTS, 0, 2)>;
output-enable;
};
group2 {
pinmux = <SI32_MUX(USART0_RX, 0, 1)>,
<SI32_MUX(USART0_CTS, 0, 3)>;
input-enable;
};
};
usart1_default: usart1_default {
group1 {
pinmux = <SI32_MUX(USART1_TX, 0, 13)>;
output-enable;
};
group2 {
pinmux = <SI32_MUX(USART1_RX, 0, 14)>;
input-enable;
};
};
};

View File

@ -0,0 +1,92 @@
/*
* Copyright (c) 2024 GARDENA GmbH
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <silabs/sim3u167.dtsi>
#include "sgrm-pinctrl.dtsi"
/ {
model = "GARDENA Smart Garden Radio Module";
compatible = "gardena,sgrm-sim3u167", "silabs,sim3u167","silabs,sim3u";
chosen {
zephyr,console = &usart1;
zephyr,flash = &flash0;
zephyr,shell-uart = &usart1;
zephyr,sram = &sram0;
zephyr,ppp-uart = &usart0;
};
};
&cpu0 {
clock-frequency = <76953600>;
};
&pll0 {
status = "okay";
};
&clk_ahb {
clocks = <&pll0>;
status = "okay";
};
&clk_apb {
divider = <2>;
status = "okay";
};
&usart0 {
current-speed = <500000>;
pinctrl-0 = <&usart0_default>;
pinctrl-names = "default";
hw-flow-control;
status = "okay";
};
&usart1 {
current-speed = <115200>;
pinctrl-0 = <&usart1_default>;
pinctrl-names = "default";
status = "okay";
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&gpio2 {
disable-pullups;
status = "okay";
};
&gpio3 {
status = "okay";
};
&flash0 {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
slot0_partition: partition@0 {
label = "image-0";
reg = <0x00000000 DT_SIZE_K(192)>;
};
storage_partition: partition@30000 {
label = "storage";
reg = <0x00030000 DT_SIZE_K(64)>;
};
};
};

View File

@ -0,0 +1,21 @@
# Copyright (c) 2024 GARDENA GmbH
#
# SPDX-License-Identifier: Apache-2.0
identifier: sgrm
name: GARDENA Smart Garden Radio Module
type: mcu
arch: arm
ram: 32
flash: 256
toolchain:
- gnuarmemb
- xtools
- zephyr
supported:
- dma
- flash
- gpio
- nvs
- uart
vendor: gardena

View File

@ -0,0 +1,9 @@
# Enable UART driver
CONFIG_SERIAL=y
# Enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# Enable GPIO
CONFIG_GPIO=y

View File

@ -0,0 +1,24 @@
# Copyright (c) 2024 GARDENA GmbH
#
# SPDX-License-Identifier: Apache-2.0
source [find interface/ftdi/olimex-arm-usb-ocd-h.cfg]
source [find interface/ftdi/olimex-arm-jtag-swd.cfg]
source [find target/sim3x.cfg]
# On SiM3U1xx, doing a chip reset also takes down the debug port. For this reason, we disable the
# chip reset and instead only reset the Cortex M via the AIRCR SYSRESETREQ bit, as suggested in the
# chip's errata: https://www.silabs.com/documents/public/errata/SiM3U1xx-SiM3C1xxErrata.pdf
cortex_m reset_config sysresetreq
$_TARGETNAME configure -event gdb-attach {
echo "Debugger attaching: halting execution"
reset halt
gdb_breakpoint_override hard
}
$_TARGETNAME configure -event gdb-detach {
echo "Debugger detaching: resuming execution"
resume
}