3 years, 2 months ago.

Is it possible to export an STM32Cube project (C) into the Mbed Online Compiler?


I'm trying to use an ADC from an STM32F767ZI board. The thing is that the Mbed API AnalogIn is too limited for the things I want to do, so I used the STM32Cube to make an ADC project using the HAL libraries where I can configure the peripheral as I want.

Now I would like to use a serial port and timers to debug my program and the Mbed API is good enough and easy to use them. The question is, can I export my "stm32cube project" into the Mbed compiler and create serial and timer objects?

I first tried to copy and paste the code with a blink led using hal to the Mbed compiler and it doesn't work, so I first need to know how to export it before use objects from the Mbed API.

Do you know how I could do it?

Or maybe I could write the HAL functions and initialitzations directly in a Mbed cpp file, could I? If so, do I need to configure the clocks?

Thank you so much :)

1 Answer

3 years, 2 months ago.

Hello Sergi ,

To build this program I used STM32Cube to generage the code and then I combined it with mbed. Maybe it can help you.

Accepted Answer

Thank you! Showing examples is always a good way to teach :)

The problem was with the SystemClock_Config, the STM32Cube configures the clocks in the main file and it seems that this configuration was conflicting with the Mbed libraries.

I just deleted the SystemClock_Config from the code and it works fine!

posted by Sergi Hernández 27 Mar 2018