commit 60ecea6f394a1e28e0333e43106137a3bec40cb0 Author: Matthias Blankertz Date: Fri Sep 26 17:43:57 2025 +0200 Basic board setup diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f8072e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +*~ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1 @@ + diff --git a/boards/other/pico_stm32/Kconfig.pico_stm32 b/boards/other/pico_stm32/Kconfig.pico_stm32 new file mode 100644 index 0000000..c0b15cf --- /dev/null +++ b/boards/other/pico_stm32/Kconfig.pico_stm32 @@ -0,0 +1,2 @@ +config BOARD_PICO_STM32 + select SOC_STM32F103X8 \ No newline at end of file diff --git a/boards/other/pico_stm32/board.cmake b/boards/other/pico_stm32/board.cmake new file mode 100644 index 0000000..a60cb6a --- /dev/null +++ b/boards/other/pico_stm32/board.cmake @@ -0,0 +1,4 @@ +board_runner_args(pyocd "--target=stm32f103c8") + +include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd-stm32.board.cmake) diff --git a/boards/other/pico_stm32/board.yml b/boards/other/pico_stm32/board.yml new file mode 100644 index 0000000..9e330e7 --- /dev/null +++ b/boards/other/pico_stm32/board.yml @@ -0,0 +1,7 @@ +board: + name: pico_stm32 + full_name: Pico STM32 + vendor: other + # stm32f103c8t6 + socs: + - name: stm32f103xb diff --git a/boards/other/pico_stm32/pico_stm32.dts b/boards/other/pico_stm32/pico_stm32.dts new file mode 100644 index 0000000..7eee08f --- /dev/null +++ b/boards/other/pico_stm32/pico_stm32.dts @@ -0,0 +1,76 @@ +/dts-v1/; + +#include +#include + +/ { + model = "Pico STM32 board"; + compatible = "other,pico-stm32"; + + chosen { + zephyr,console = &usart1; + zephyr,shell-uart = &usart1; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + }; + + leds: leds { + compatible = "gpio-leds"; + + green_led: led_2 { + gpios = <&gpioa 8 GPIO_ACTIVE_HIGH>; + label = "PA8"; + }; + }; + + aliases { + led0 = &green_led; + die-temp0 = &die_temp; + }; +}; + +&clk_lsi { + status = "okay"; +}; + +&clk_hse { + clock-frequency = ; /* 16 MHz quartz */ + status = "okay"; +}; + +&pll { + mul = <9>; + clocks = <&clk_hse>; + xtpre; + status = "okay"; +}; + +&rcc { + clocks = <&pll>; + clock-frequency = ; + ahb-prescaler = <1>; + apb1-prescaler = <2>; + apb2-prescaler = <1>; + adc-prescaler = <2>; +}; + +&usart1 { + pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; + pinctrl-names = "default"; + current-speed = <115200>; + status = "okay"; +}; + +&die_temp { + status = "okay"; +}; + +/* zephyr_udc0: &usb { */ +/* pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>; */ +/* pinctrl-names = "default"; */ +/* status = "okay"; */ + +/* cdc_acm_uart0: cdc_acm_uart0 { */ +/* compatible = "zephyr,cdc-acm-uart"; */ +/* }; */ +/* }; */ diff --git a/boards/other/pico_stm32/pico_stm32.yaml b/boards/other/pico_stm32/pico_stm32.yaml new file mode 100644 index 0000000..2e68d99 --- /dev/null +++ b/boards/other/pico_stm32/pico_stm32.yaml @@ -0,0 +1,19 @@ +identifier: pico_stm32 +name: Pico STM32 +type: mcu +arch: arm +toolchain: + - zephyr + - gnuarmemb +ram: 20 +flash: 128 +supported: + - gpio + - spi + - pwm + - watchdog + - adc + - dma + - nvs + - counter +vendor: other diff --git a/boards/other/pico_stm32/pico_stm32_defconfig b/boards/other/pico_stm32/pico_stm32_defconfig new file mode 100644 index 0000000..2122d9c --- /dev/null +++ b/boards/other/pico_stm32/pico_stm32_defconfig @@ -0,0 +1,13 @@ +# enable uart driver +CONFIG_SERIAL=y +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# enable GPIO +CONFIG_GPIO=y + +# USB console +#CONFIG_USB_DEVICE_STACK=y +#CONFIG_USB_CDC_ACM=y +#CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y diff --git a/boards/other/pico_stm32/support/openocd.cfg b/boards/other/pico_stm32/support/openocd.cfg new file mode 100644 index 0000000..6f65767 --- /dev/null +++ b/boards/other/pico_stm32/support/openocd.cfg @@ -0,0 +1,4 @@ +source [find interface/cmsis-dap.cfg] +transport select swd + +source [find target/stm32f1x.cfg] diff --git a/west.yml b/west.yml new file mode 100644 index 0000000..f687cec --- /dev/null +++ b/west.yml @@ -0,0 +1,19 @@ +--- +manifest: + remotes: + # Define the remote for the main Zephyr repository + - name: zephyrproject-rtos + url-base: https://github.com/zephyrproject-rtos + + projects: + # 1. Main Zephyr repository (required) + - name: zephyr + remote: zephyrproject-rtos + revision: v4.2.0 + + # This section instructs west to only pull in the modules + # required for the stm32 HAL, significantly reducing the clone size. + import: + name-allowlist: + - cmsis_6 + - hal_stm32 diff --git a/zephyr/module.yml b/zephyr/module.yml new file mode 100644 index 0000000..a1946a6 --- /dev/null +++ b/zephyr/module.yml @@ -0,0 +1,9 @@ +build: + # Path to the folder that contains the CMakeLists.txt file to be included by + # Zephyr build system. The `.` is the root of this repository. + cmake: . + settings: + # Additional roots for boards and DTS files. Zephyr will use the + # `/boards` for additional boards. The `.` is the root of this + # repository. + board_root: .