diff --git a/boards/silabs/dev_kits/sim3u1xx_dk/Kconfig.sim3u1xx_dk b/boards/silabs/dev_kits/sim3u1xx_dk/Kconfig.sim3u1xx_dk new file mode 100644 index 00000000000..e519114331b --- /dev/null +++ b/boards/silabs/dev_kits/sim3u1xx_dk/Kconfig.sim3u1xx_dk @@ -0,0 +1,6 @@ +# Copyright (c) 2024 GARDENA GmbH +# +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_SIM3U1XX_DK + select SOC_PART_NUMBER_SIM3U167AGQ diff --git a/boards/silabs/dev_kits/sim3u1xx_dk/board.cmake b/boards/silabs/dev_kits/sim3u1xx_dk/board.cmake new file mode 100644 index 00000000000..60f466d5539 --- /dev/null +++ b/boards/silabs/dev_kits/sim3u1xx_dk/board.cmake @@ -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) diff --git a/boards/silabs/dev_kits/sim3u1xx_dk/board.yml b/boards/silabs/dev_kits/sim3u1xx_dk/board.yml new file mode 100644 index 00000000000..c70d5420483 --- /dev/null +++ b/boards/silabs/dev_kits/sim3u1xx_dk/board.yml @@ -0,0 +1,9 @@ +# Copyright (c) 2024 GARDENA GmbH +# +# SPDX-License-Identifier: Apache-2.0 + +board: + name: sim3u1xx_dk + vendor: silabs + socs: + - name: sim3u167 diff --git a/boards/silabs/dev_kits/sim3u1xx_dk/doc/index.rst b/boards/silabs/dev_kits/sim3u1xx_dk/doc/index.rst new file mode 100644 index 00000000000..422bbfaa367 --- /dev/null +++ b/boards/silabs/dev_kits/sim3u1xx_dk/doc/index.rst @@ -0,0 +1,130 @@ +.. _sim3u1xx_dk: + +Silicon Labs SiM3U1xx 32-bit MCU USB Development Kit +#################################################### + +Overview +******** + +This is a `development kit`_ that is used to develop software for the SiM3U1xx MCUs. + +.. figure:: sim3u1xx_dk.webp + :align: center + +Hardware +******** + +- Silicon Labs SiM3U167-B-GM SoC +- CPU core: ARM Cortex®-M3 +- Flash memory: 256 kB +- RAM: 32 kB +- IO: + + - 2x user LEDs + - 2x user push buttons + - 2x power LEDs + - Reset push button + - Potentiometer + - Analog terminals + - Capacitive sensing slider and button + - USB virtual COM port + +For more information about the SiM3U167 SoC and the SiM3U1xx board, refer to these documents: + +- Silicon Labs SiM3U1xx_ +- Silicon Labs SiM3U167-B-GM_ +- Silicon Labs SiM3U1xx-B-DK_ +- Silicon Labs SiM3U1xx-B-DK MCU card `user's guide`_ +- Silicon Labs SiM3U1xx and SiM3C1xx Revision B Errata_ + +.. _SiM3U1xx: https://www.silabs.com/mcu/32-bit-microcontrollers/precision32-sim3u1xx +.. _SiM3U167-B-GM: https://www.silabs.com/mcu/32-bit-microcontrollers/precision32-sim3u1xx/device.sim3u167-b-gm +.. _SiM3U1xx-B-DK: https://www.silabs.com/development-tools/mcu/32-bit/sim3u1xx-development-kit +.. _user's guide: https://www.silabs.com/documents/public/user-guides/UPMU-M3U160.pdf +.. _Errata: https://www.silabs.com/documents/public/errata/SiM3U1xx-SiM3C1xxErrata.pdf + +Supported Features +================== + +The board configuration supports the following hardware features: + ++-----------+------------+-------------------------------------+ +| Interface | Controller | Driver/Component | ++===========+============+=====================================+ +| NVIC | on-chip | nested vector interrupt controller | ++-----------+------------+-------------------------------------+ +| SYSTICK | on-chip | systick | ++-----------+------------+-------------------------------------+ +| FLASH | on-chip | flash memory | ++-----------+------------+-------------------------------------+ +| GPIO | on-chip | gpio | ++-----------+------------+-------------------------------------+ +| UART | on-chip | serial port-polling; | +| | | serial port-interrupt | ++-----------+------------+-------------------------------------+ + +Connections and IOs +=================== + ++--------+--------------------------+----------------------------------------------------+ +| Pin | Name | Note | ++========+==========================+====================================================+ +| PB1.12 | TX (O) | Serial connection to host via USB virtual COM port | ++--------+--------------------------+ | +| PB1.13 | RX (I) | | ++--------+--------------------------+ | +| PB1.14 | RTS (O) | | ++--------+--------------------------+ | +| PB1.15 | CTS (I) | | ++--------+--------------------------+----------------------------------------------------+ +| PB2.8 | Push button switch (SW2) | | ++--------+--------------------------+----------------------------------------------------+ +| PB2.9 | Push button switch (SW3) | | ++--------+--------------------------+----------------------------------------------------+ +| PB2.10 | Red LED (DS3) | | ++--------+--------------------------+----------------------------------------------------+ +| PB2.11 | Yellow LED (DS4) | | ++--------+--------------------------+----------------------------------------------------+ +| PB1.5 | Potentiometer | | ++--------+--------------------------+----------------------------------------------------+ +| PB2.12 | Potentiometer bias | | ++--------+--------------------------+----------------------------------------------------+ + +Programming and Debugging +************************* + +Flashing +======== + +The sample application :ref:`hello_world` is used for this example. Build the Zephyr kernel and +application: + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: sim3u1xx_dk + :goals: build + +Connect the sim3u1xx_dk to your host computer using both USB port and you should see a USB serial +connection. + +Open a serial terminal (minicom, putty, etc.) with the following settings: + +- Speed: 115200 +- Data: 8 bits +- Parity: None +- Stop bits: 1 + +Reset the board and you'll see the following message on the corresponding serial port +terminal session: + +.. code-block:: console + + Hello World! sim3u1xx_dk/sim3u167 + +References +********** + +.. target-notes:: + +.. _development kit: + https://www.silabs.com/development-tools/mcu/32-bit/sim3u1xx-development-kit diff --git a/boards/silabs/dev_kits/sim3u1xx_dk/doc/sim3u1xx_dk.webp b/boards/silabs/dev_kits/sim3u1xx_dk/doc/sim3u1xx_dk.webp new file mode 100644 index 00000000000..56ad9e6877c Binary files /dev/null and b/boards/silabs/dev_kits/sim3u1xx_dk/doc/sim3u1xx_dk.webp differ diff --git a/boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk-pinctrl.dtsi b/boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk-pinctrl.dtsi new file mode 100644 index 00000000000..08d3b0176e7 --- /dev/null +++ b/boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk-pinctrl.dtsi @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2024 GARDENA GmbH + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + usart0_default: usart0_default { + group1 { + pinmux = , + ; + output-enable; + }; + group2 { + pinmux = , + ; + input-enable; + }; + }; +}; diff --git a/boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk.dts b/boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk.dts new file mode 100644 index 00000000000..f55f5a667f9 --- /dev/null +++ b/boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk.dts @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2024 GARDENA GmbH + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "sim3u1xx_dk-pinctrl.dtsi" +#include + +/ { + model = "Silicon Labs SiM3U1xx-B-DK"; + compatible = "gardena,sim3u1xx-dk", "silabs,sim3u167","silabs,sim3u"; + + aliases { + led0 = &led_yellow; + led1 = &led_red; + sw0 = &user_button_sw2; + sw1 = &user_button_sw3; + }; + + chosen { + zephyr,console = &usart0; + zephyr,flash = &flash0; + zephyr,shell-uart = &usart0; + zephyr,sram = &sram0; + }; + + leds { + compatible = "gpio-leds"; + + led_red: led_2_10 { + label = "Red LED (DS3)"; + gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>; + }; + led_yellow: led_2_11 { + label = "Yellow LED (DS4)"; + gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + + user_button_sw2: button_0 { + label = "Push button switch (SW2)"; + gpios = <&gpio2 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + zephyr,code = ; + }; + user_button_sw3: button_1 { + label = "Push button switch (SW3)"; + gpios = <&gpio2 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + zephyr,code = ; + }; + }; +}; + +&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"; +}; + +&gpio2 { + 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)>; + }; + }; +}; diff --git a/boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk.yaml b/boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk.yaml new file mode 100644 index 00000000000..6950fa4c470 --- /dev/null +++ b/boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk.yaml @@ -0,0 +1,20 @@ +# Copyright (c) 2024 GARDENA GmbH +# +# SPDX-License-Identifier: Apache-2.0 + +identifier: sim3u1xx_dk +name: Silicon Labs SiM3U development kit +type: mcu +arch: arm +ram: 32 +flash: 256 +toolchain: + - gnuarmemb + - xtools + - zephyr +supported: + - flash + - gpio + - nvs + - uart +vendor: gardena diff --git a/boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk_defconfig b/boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk_defconfig new file mode 100644 index 00000000000..e7d47535289 --- /dev/null +++ b/boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk_defconfig @@ -0,0 +1,9 @@ +# Enable UART driver +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# Enable GPIO +CONFIG_GPIO=y diff --git a/boards/silabs/dev_kits/sim3u1xx_dk/support/openocd.cfg b/boards/silabs/dev_kits/sim3u1xx_dk/support/openocd.cfg new file mode 100644 index 00000000000..87aca7aab60 --- /dev/null +++ b/boards/silabs/dev_kits/sim3u1xx_dk/support/openocd.cfg @@ -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 +}