2018-01-28 05:15:18 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Nathan Tsoi <nathan@vertile.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/dts-v1/;
|
2018-09-26 05:06:34 +02:00
|
|
|
#include <st/f0/stm32f051X8.dtsi>
|
2020-10-06 15:47:58 +02:00
|
|
|
#include <st/f0/stm32f051r8tx-pinctrl.dtsi>
|
2023-08-03 12:52:22 +02:00
|
|
|
#include <zephyr/dt-bindings/input/input-event-codes.h>
|
2018-01-28 05:15:18 +01:00
|
|
|
|
|
|
|
/ {
|
|
|
|
model = "STMicroelectronics STM32F0DISCOVERY board";
|
2020-09-25 14:57:24 +02:00
|
|
|
compatible = "st,stm32f058r8-discovery";
|
2018-01-28 05:15:18 +01:00
|
|
|
|
|
|
|
chosen {
|
|
|
|
zephyr,console = &usart1;
|
2018-11-27 12:11:04 +01:00
|
|
|
zephyr,shell-uart = &usart1;
|
2018-01-28 05:15:18 +01:00
|
|
|
zephyr,sram = &sram0;
|
|
|
|
zephyr,flash = &flash0;
|
2018-11-15 16:36:41 +01:00
|
|
|
zephyr,code-partition = &slot0_partition;
|
2018-01-28 05:15:18 +01:00
|
|
|
};
|
2017-11-24 10:08:03 +01:00
|
|
|
|
|
|
|
leds {
|
|
|
|
compatible = "gpio-leds";
|
2018-09-18 19:45:43 +02:00
|
|
|
green_led_3: led_3 {
|
2019-10-03 18:30:21 +02:00
|
|
|
gpios = <&gpioc 9 GPIO_ACTIVE_HIGH>;
|
2017-11-24 10:08:03 +01:00
|
|
|
label = "User LD3";
|
|
|
|
};
|
2018-09-18 19:45:43 +02:00
|
|
|
blue_led_4: led_4 {
|
2019-10-03 18:30:21 +02:00
|
|
|
gpios = <&gpioc 8 GPIO_ACTIVE_HIGH>;
|
2017-11-24 10:08:03 +01:00
|
|
|
label = "User LD4";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
gpio_keys {
|
|
|
|
compatible = "gpio-keys";
|
2018-09-21 01:25:55 +02:00
|
|
|
user_button: button {
|
2017-11-24 10:08:03 +01:00
|
|
|
label = "Key";
|
2019-10-03 18:30:21 +02:00
|
|
|
gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
|
2023-08-03 12:52:22 +02:00
|
|
|
zephyr,code = <INPUT_KEY_0>;
|
2017-11-24 10:08:03 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
aliases {
|
|
|
|
led0 = &green_led_3;
|
|
|
|
led1 = &blue_led_4;
|
|
|
|
sw0 = &user_button;
|
2022-07-19 10:33:14 +02:00
|
|
|
watchdog0 = &iwdg;
|
2017-11-24 10:08:03 +01:00
|
|
|
};
|
2018-01-28 05:15:18 +01:00
|
|
|
};
|
|
|
|
|
2022-12-02 18:38:52 +01:00
|
|
|
&clk_lsi {
|
|
|
|
status = "okay";
|
|
|
|
};
|
|
|
|
|
2021-04-30 17:32:23 +02:00
|
|
|
&clk_hse {
|
|
|
|
clock-frequency = <DT_FREQ_M(8)>;
|
|
|
|
status = "okay";
|
|
|
|
};
|
|
|
|
|
|
|
|
&pll {
|
|
|
|
prediv = <1>;
|
|
|
|
mul = <6>;
|
|
|
|
clocks = <&clk_hse>;
|
|
|
|
status = "okay";
|
|
|
|
};
|
|
|
|
|
|
|
|
&rcc {
|
|
|
|
clocks = <&pll>;
|
|
|
|
clock-frequency = <DT_FREQ_M(48)>;
|
|
|
|
ahb-prescaler = <1>;
|
|
|
|
apb1-prescaler = <1>;
|
|
|
|
};
|
|
|
|
|
2020-04-01 11:47:04 +02:00
|
|
|
/* Due to limited available memory, don't enable gpiod and gpiof */
|
|
|
|
&gpiod {status = "disabled";};
|
|
|
|
&gpiof {status = "disabled";};
|
|
|
|
|
2018-01-28 05:15:18 +01:00
|
|
|
&usart1 {
|
2020-10-06 15:47:58 +02:00
|
|
|
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
|
2021-09-07 16:38:13 +02:00
|
|
|
pinctrl-names = "default";
|
2018-01-28 05:15:18 +01:00
|
|
|
current-speed = <115200>;
|
2019-06-14 19:31:16 +02:00
|
|
|
status = "okay";
|
2018-01-28 05:15:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
&usart2 {
|
2020-10-06 15:47:58 +02:00
|
|
|
pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
|
2021-09-07 16:38:13 +02:00
|
|
|
pinctrl-names = "default";
|
2018-01-28 05:15:18 +01:00
|
|
|
current-speed = <115200>;
|
2019-06-14 19:31:16 +02:00
|
|
|
status = "okay";
|
2018-01-28 05:15:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
&flash0 {
|
|
|
|
partitions {
|
|
|
|
compatible = "fixed-partitions";
|
|
|
|
#address-cells = <1>;
|
|
|
|
#size-cells = <1>;
|
|
|
|
|
|
|
|
boot_partition: partition@0 {
|
|
|
|
label = "mcuboot";
|
2022-05-06 14:54:51 +02:00
|
|
|
reg = <0x00000000 DT_SIZE_K(8)>;
|
2018-01-28 05:15:18 +01:00
|
|
|
read-only;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The flash starting at offset 0x2000 and ending at
|
|
|
|
* offset 0x3999 is reserved for use by the application.
|
|
|
|
*/
|
|
|
|
|
|
|
|
slot0_partition: partition@4000 {
|
|
|
|
label = "image-0";
|
2022-05-06 14:54:51 +02:00
|
|
|
reg = <0x00004000 DT_SIZE_K(16)>;
|
2018-01-28 05:15:18 +01:00
|
|
|
};
|
2019-07-02 18:47:48 +02:00
|
|
|
slot1_partition: partition@8000 {
|
2018-01-28 05:15:18 +01:00
|
|
|
label = "image-1";
|
2022-05-06 14:54:51 +02:00
|
|
|
reg = <0x00008000 DT_SIZE_K(16)>;
|
2018-01-28 05:15:18 +01:00
|
|
|
};
|
2019-07-02 18:47:48 +02:00
|
|
|
scratch_partition: partition@c000 {
|
2018-01-28 05:15:18 +01:00
|
|
|
label = "image-scratch";
|
2022-05-06 14:54:51 +02:00
|
|
|
reg = <0x0000C000 DT_SIZE_K(16)>;
|
2018-01-28 05:15:18 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2019-02-01 16:12:50 +01:00
|
|
|
|
2019-04-04 09:46:31 +02:00
|
|
|
&iwdg {
|
2019-06-14 19:31:16 +02:00
|
|
|
status = "okay";
|
2019-02-01 16:12:50 +01:00
|
|
|
};
|
2022-12-02 18:38:52 +01:00
|
|
|
|
|
|
|
&rtc {
|
|
|
|
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
|
|
|
|
<&rcc STM32_SRC_LSI RTC_SEL(2)>;
|
|
|
|
status = "okay";
|
|
|
|
|
|
|
|
backup_regs {
|
|
|
|
status = "okay";
|
|
|
|
};
|
|
|
|
};
|