Skip to content

Commit

Permalink
add gardena_rm_sim3u
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Zimmermann <[email protected]>
  • Loading branch information
M1cha committed Nov 10, 2023
1 parent cea8a8d commit 6a108cd
Show file tree
Hide file tree
Showing 11 changed files with 254 additions and 0 deletions.
5 changes: 5 additions & 0 deletions boards/arm/gardena_rm_sim3u/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2023 GARDENA GmbH
#
# SPDX-License-Identifier: Apache-2.0

zephyr_library()
8 changes: 8 additions & 0 deletions boards/arm/gardena_rm_sim3u/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2023 GARDENA GmbH
#
# SPDX-License-Identifier: Apache-2.0

config BOARD_GARDENA_RM_SIM3U
bool "GARDENA SiM3U radio module"
depends on SOC_SERIES_SIM3U
select SOC_PART_NUMBER_SIM3U167_B_GM
10 changes: 10 additions & 0 deletions boards/arm/gardena_rm_sim3u/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2023 GARDENA GmbH
#
# SPDX-License-Identifier: Apache-2.0

if BOARD_GARDENA_RM_SIM3U

config BOARD
default "gardena_rm_sim3u"

endif # BOARD_GARDENA_RM_SIM3U
5 changes: 5 additions & 0 deletions boards/arm/gardena_rm_sim3u/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2023 GARDENA GmbH
#
# SPDX-License-Identifier: Apache-2.0

include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions boards/arm/gardena_rm_sim3u/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
.. _boardname_linkname:

GARDENA SiM3U radio module
##########################

Overview
********

This is a SoM that is used as a radio module by the GARDENA smart Gateway.

.. figure:: gardena_rm_sim3u.jpg
:align: center
:alt: GARDENA SiM3U radio module

Hardware
********

- SIM3U167-B-GM SoC
- SPI Silicon Labs Si4467 transceiver
- 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.

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

- USART: polling and interrupt mode


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:: console
scp -O build/zephyr/zephyr.hex root@IP:/tmp/
On the gateway:

.. code-block:: console
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:: console
openocd -f board/gardena_radio.cfg -c init
References
**********

.. _User manual:
https://www.gardena.com/tdrdownload//pub000070911/doc000120830

.. _SoC product page:
https://www.silabs.com/mcu/32-bit-microcontrollers/precision32-sim3u1xx/device.SiM3U167-B-GQ?tab=specs

.. _Yocto source code and documentation:
https://github.com/husqvarnagroup/smart-garden-gateway-public
23 changes: 23 additions & 0 deletions boards/arm/gardena_rm_sim3u/gardena_rm_sim3u-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2023 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;
};
};
};

84 changes: 84 additions & 0 deletions boards/arm/gardena_rm_sim3u/gardena_rm_sim3u.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* Copyright (c) 2023 GARDENA GmbH
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <silabs/sim3u167bgm.dtsi>
#include "gardena_rm_sim3u-pinctrl.dtsi"

/ {
model = "GARDENA SiM3U radio module";
compatible = "gardena,rm_sim3u", "silabs,sim3u";

chosen {
zephyr,console = &usart0;
zephyr,shell-uart = &usart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
};

&cpu0 {
clock-frequency = <76953600>;
};

&pll0 {
status = "okay";
};

&clk_ahb {
clocks = <&pll0>;
status = "okay";
};

&clk_apb {
divider = <2>;
status = "okay";
};

&usart0 {
current-speed = <115200>;
pinctrl-0 = <&usart0_default>;
pinctrl-names = "default";
hw-flow-control;
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(1664)>;
};

storage_partition: partition@250000 {
label = "storage";
reg = <0x00030000 DT_SIZE_K(64)>;
};
};
};
16 changes: 16 additions & 0 deletions boards/arm/gardena_rm_sim3u/gardena_rm_sim3u.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2023 GARDENA GmbH
#
# SPDX-License-Identifier: Apache-2.0

identifier: gardena_rm_sim3u
name: GARDENA SiM3U radio module
type: mcu
arch: arm
ram: 32
flash: 256
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- gpio
11 changes: 11 additions & 0 deletions boards/arm/gardena_rm_sim3u/gardena_rm_sim3u_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CONFIG_SOC_SERIES_SIM3U=y

# enable uart driver
CONFIG_SERIAL=y

# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# enable GPIO
CONFIG_GPIO=y
21 changes: 21 additions & 0 deletions boards/arm/gardena_rm_sim3u/support/openocd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2023 GARDENA GmbH
#
# SPDX-License-Identifier: Apache-2.0

source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg]
source [find interface/ftdi/olimex-arm-jtag-swd.cfg]

source [find target/sim3x.cfg]

reset_config none separate

$_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
}

0 comments on commit 6a108cd

Please sign in to comment.