Help me port a STM32CubeIDE project to Arduino with STM32duino core

Post here first, or if you can't find a relevant section!
Post Reply
razvitm
Posts: 38
Joined: Sat Apr 11, 2020 12:35 pm

Help me port a STM32CubeIDE project to Arduino with STM32duino core

Post by razvitm »

Hi,

I am still stuck with Arduino, haven't learned other IDEs, and the libraries I use are for Arduino, and I found a project that I want to run on a Black Pill, STM32F103C8T6 board, that I will modify to work with other hardware modules.
I installed STM32CubeIDE and run the project, it compiles without error and works.
Can someone please take the code from the project and turn it into an Arduino sketch for the latest STM32 core for arduino?

The project is at:
https://deepbluembedded.com/stm32-timer ... terfacing/

Thank you in advance!

P.S.
Or tell me how to do it...

Or point me to an example of encoder quadrature signals being hardware decoded with a STM32 in Arduino using STM32duino core...
razvitm
Posts: 38
Joined: Sat Apr 11, 2020 12:35 pm

Re: Help me port a STM32CubeIDE project to Arduino with STM32duino core

Post by razvitm »

From what I understand by reading the source code from this project, it declares functions to use the serial port and IO pins and Hardware Timer, but STM32duino already has these functions in the core.
Basically I need to set up one of the hardware timers in encoder mode and serial print the "distance". And do all this in Arduino with STM32duino latest core installed in boards manager.
Can anybody help me?
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Help me port a STM32CubeIDE project to Arduino with STM32duino core

Post by ag123 »

razvitm
Posts: 38
Joined: Sat Apr 11, 2020 12:35 pm

Re: Help me port a STM32CubeIDE project to Arduino with STM32duino core

Post by razvitm »

Yes, the core's hardware_timer doesn't support encoder mode.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Help me port a STM32CubeIDE project to Arduino with STM32duino core

Post by fpiSTM »

You can refers to this example which port an STM32Cube IDE project:

viewtopic.php?f=41&t=110


Some useful link:
https://github.com/stm32duino/wiki/wiki ... odule-only
https://github.com/stm32duino/wiki/wiki ... uild_opt.h
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Help me port a STM32CubeIDE project to Arduino with STM32duino core

Post by ag123 »

HardwareTimer API supports basic use of the hardware timers.
For more elaborate modes, you may need to assess the registers directly. I think it may be possible to use them HardwareTimer API and registers in combination.
Post Reply

Return to “General discussion”