Skip to main content
KGupt.1
Associate III
January 11, 2021
Question

Bare Metal Programming on STM32WB55 or STM32F10

  • January 11, 2021
  • 6 replies
  • 2026 views

I want To do Bare Metal Programming on STM32 using STM32CubeIDE.

have (STM32WB55 and STM32F103).

what all header files and source files are required to use peripheral registers and make own Device driver. For E.g: in AVR 8 bit MCU for doing bare metal we simply have to add iom328.h or iom2560.h header file that will include all the peripheral registers of the MCU and we can easily make LL.

Same way out what are the Header files required for doing it with STM32

CMSIS: is like Initialize our processor and includes its registers.

So what all header files to be included for programming STM32F103 and STM32WB55

This topic has been closed for replies.

6 replies

waclawek.jan
Super User
January 11, 2021

The appropriate one from https://github.com/STMicroelectronics/STM32CubeF1/tree/master/Drivers/CMSIS/Device/ST/STM32F1xx/Include, and those from https://github.com/STMicroelectronics/STM32CubeF1/tree/master/Drivers/CMSIS/Include which are included from the above, directly or indirectly.

You don't really need system_stm32f1xx.h, I usually replace it with an empty file.

You'll need also a startup file and a linker script, if the IDE won't supply those (I don't use Cube).

JW

KGupt.1
KGupt.1Author
Associate III
January 12, 2021

So Just. h file of the MCU which I am using

and the .h file of the Processor which is in My MCU.

These two are required to use internal registers?

One more thing .... .h file of the MCU contains the memory mapping of the peripheral registers.

but I can't get what does .h file of the CMSIS does? like does it initialize my processor?

Radosław
Associate II
January 12, 2021

CMSIS is for core support, h file from cube are for peripherals.

CMSIS package include tamplates for startup and linker script.

This will be all .h files. You don't need any *.c file.

waclawek.jan
Super User
January 12, 2021

> These two are required to use internal registers?

The "processor" .h in fact consists of two or three .h mutually calling each other - just try and you'll find out quickly.

You can look inside the files to find out what do they contain.

For "processor initializing" you'll need a startup file - usually a .s (assembler) file which does the usual registers clear required by C, and contains the vector table. Look at the examples which come with Cube.

JW

Tesla DeLorean
Guru
January 12, 2021

This has a lot of I want a manual transmission, how does the clutch work, feel to it....

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
KGupt.1
KGupt.1Author
Associate III
January 18, 2021

So Directly I just need to include all the Header files which are over their in CMSIS folder as it contains all the .h files for my core(cmsis_armcc.h,cmsis_gcc.h, etc ) and also STM32f103.h file and system_startup

0693W000007BbOyQAK.png