STM32FX BSP questions

Mr. Andrei Chichak groups at
Fri Jul 24 00:28:24 UTC 2015

There is a bit of weirdness in the way that ST generates code from Cube. First, they create a main.c file for you with a main() routine. Nice, but it conflicts with the way that RTEMS uses Init() as a user entry point.

Next, they put all of the highest level code into a directory called Src. Thanks, so much for having file naming standards. ST kinda just walks over the customers there. The header files for their code is kept in a directory called Inc. They really want you to build your system into their framework rather than giving you a library to link against.

The code and include directories are generated in the same directory as your Cube .ioc project descriptor file. So if you like to keep your hardware related files away from your software related files, since EE’s tend to blow away things in SVN that don’t belong to them and would rather leave Altium files littered about instead (not being bitter or anything), ST kinda just walks over the customers there.

I don’t know where the libraries should go, but there is also example code in with their library code, so you will have to pick and choose which directories to compile into libraries and which to leave out.

I know this didn’t help, but there it is.


> On 2015-July-23, at 7:26 AM, jay.doyle <jay.doyle at> wrote:
> All,
> I have a few basic questions that I was wondering if someone could give me some pointers on.
> My colleagues and I are working on a new RTEMS BSP to support various Cortex-M series processors in the STM32F series.  ST provides a nice hardware abstraction layer that is common for all their processors in this series and we would like to write our BSP around this HAL so that the same code can be used to generate BSPs for multiple processors in the same series.  We know for sure that we will need BSPs for at least a Cortex M4 and M7 processor in the series.  Given that goal, what would be the best way to structure the project with regards to the location of common coded used for different processors in the same family?  For instance, should that go into a new folder in arm/shared (e.g., arm/shared/stm32fxxx) and have separate BSP directories (e.g., arm/stm32f4x, arm/stm32f7x, etc)  or should everything be placed into one BSP directory (arm/stm32fxxxx)?  Are there any other BSPs that have the same goal that I could as a reference?
> Second, I have implemented the console driver for the STM32F4 processor using termios and everything works fine, but I'm concerned about the overhead of using termios on UARTs that we might use for something other than just a serial console (for example, we might want to use a UART to dump some logger or trace data periodically.)  Is there a good way to have a low-overhead, serial port driver that appears in the file system that we can write to using file descriptors?  Are there any good examples in other BSPs that you can point to?
> Thanks!
> --
> Jay Doyle
> Embedded Systems Software Engineer
> jay.doyle at
> _______________________________________________
> devel mailing list
> devel at

More information about the devel mailing list