• Support
  • dtsi support for STM32F101C8

Hello, I need to use zephyr for the microcontroller stm32f101c8t6tr but it seems that it’s not fully supported by zephyr since I didn’t find its dtsi file.

Alternatively, I created my stm32f101X8.dtsi file taking as a reference other stm32 files in the project, but I would like to know if it’s correct, or if you could share a better example it would be greatly appreciated. Also additional considerations for adapting zephyr to work with this mcu.

/////////////// start of stm32f101X8.dtsi file ///////////////

#include <mem.h>
#include <st/f1/stm32f1.dtsi>

/ {
	sram0: memory@20000000 {
		reg = <0x20000000 DT_SIZE_K(10)>;
	};

	soc {
		compatible = "st,stm32f101", "st,stm32f1", "simple-bus";

        /delete-node/ timers1;

		flash-controller@40022000 {
			flash0: flash@8000000 {
				reg = <0x08000000 DT_SIZE_K(64)>;
				erase-block-size = <DT_SIZE_K(1)>;
			};
		};

        spi2: spi@40003800 {
			compatible = "st,stm32-spi";
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0x40003800 0x400>;
			clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00004000>;
			interrupts = <36 5>;
			status = "disabled";
		};

		adc1: adc@40012400 {
            compatible = "st,stm32f1-adc", "st,stm32-adc";
            reg = <0x40012400 0x400>;
            clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00000200>;
            interrupts = <18 0>;  // Interrupción del ADC, verifica el número correcto
            status = "okay";
            #io-channel-cells = <1>;
            resolutions = <12>;
            sampling-times = <2 8 14 29 42 56 72 240>;
            st,adc-sequencer = <FULLY_CONFIGURABLE>;
		};
		
	};
};


/////////////// end of stm32f101X8.dtsi file ///////////////

@burgueishon its not only just a dtsi file but also all the other supporting files for your board. You can search for other boards that may use the a similar board (F101 series) and do a bit of copy and paste.

Ahh. Searching the Zephyr repo for SOC_STM32F10 the smallest flash area that I could find was this guy: https://www.st.com/en/evaluation-tools/stm32vldiscovery.html

Looks like they’re using a 128KB part whereas yours is 64KB. (64 may not be enough for the full fledged RTOS) I’d recommend a larger part if you can swing it.

As far as I can tell Zephyr only supports the series in zephyr/soc/st/stm32/stm32f1x/Kconfig.soc. This includes the F100XX, F103, 105 and 107 but not the 101.

A simple code search in the Zephyr repo was all that was needed to find this info out.

Sorry I don’t have better news for you.

@jaredwolff, I modified Kconfig.soc to include the following code:

config SOC_STM32F101X8
bool “STM32F101X8”
select SOC_STM32F10X_DENSITY_DEVICE

then, I added the previously shared file stm32f101X8.dtsi,

Also, in my custom board .dts I have these includes:
#include <st/f1/stm32f101X8.dtsi>
#include <st/f1/stm32f101c(8-b)tx-pinctrl.dtsi>

with these changes, I was able to make the blinky project work for the stm32f101, but I am concerned that I could have other issues with other peripherals. Do you see any risks, or do you have any other recommendations?

    burgueishon with these changes, I was able to make the blinky project work for the stm32f101, but I am concerned that I could have other issues with other peripherals. Do you see any risks, or do you have any other recommendations?

    Seems like there is support for your chip in the HAL layer for STM32. If it’s working thus far I don’t see why not. Depending on how big your application is though you may not have enough space to have two MCUBoot slots.

      13 days later

      jaredwolff Hey, an update on this topic… I found out that I am running out of RAM with my current application-> currently used 86% of 10KB… Is there any recommended specification from Zephyr about the minimum recommended memory?

      Terms and Conditions | Privacy Policy