FreeRTOS + genericSTM32F103C8 + arduino

Hello everyone! English is not my native language. The question is that I am trying to build some project with the STM32duino FreeRTOS (framework=arduino, board=genericSTM32F103C8). It will not build with errors. When I set board=blue pill or black pill this library builds normally. But in this case I lose the possibility to set pinMode(xx, PWM). PWM is the main tasks for my project. It turns out that I can use either a PWM or a RTOS. Is there an opportunity to build a project with libs for RTOS and for PWM? Thanks. PS: my MCU is STM32F103C8T6.

I’ve never heard of pinMode(xx, PWM). It’s certainly not part of the Arduino Core API (see Common.h). In the Arduino context, PWM is available but not selected by pinMode. Do you have any reference to it?

Do you have a real need for FreeRTOS, or is it just an option you are evaluating because you haven’t succeeded with other approaches?

Can you provide your code (incl. platformio.ini)? Can you provide the error messages you get? What board do you have?

@manuelbl I’d never heard of it also, but it is there in the Maple STM32 core… first I found reference to it in the Maple docs, and then there’s examples like this one… which also show an INPUT_ANALOG mode I hadn’t seen before. Looking at the implementation, there’s a quite a few … non-standard… pinModes in the Maple core… maybe the OP just needs to do a board_build.core = maple to force the Maple core to be used? Although I’m not sure why you’d need to use that when analogWrite() exists to do PWM.

Which errors? We’d need your project to help with that and descriptive errors.

I’d be suprised if PWM wasn’t available on both Arduino implementations, the STM32 one and Maple one.

1 Like

Thanks for your replies. I have solved the issue already. I use maple core. I need to use hardware timers as my pwm is working on frequency of 2.39 hz. The rtos library is compiled as well by using #include MapleFreeRTOS900.h instead of FreeRTOS.h