Programming OpenCR1.0 on STM32CubeIDE

Hello!
I recently purchased the OpenCR1.0 and have been fiddling around with it using the Arduino env and it works great as expected! For a custom robot that I am building, I would like to program the firmware using the vanilla STM32 HAL library (without Arduino). I am able to program and upload fw using the arduino IDE but when I try to compile and upload the HAL version of blinky from the STM32CubeIDE, it compiles fine but throws an error saying “no ST-LINK detected! Please connect ST-LINK and restart the debug session.” when I try to debug/run. I am sure I am missing something in setting things up on the CubeIDE. Where can I find the “.ioc” config file for the board?

Any help on getting it to work on the CubeIDE with HAL would be greatly appreciated!

Thanks in advance

The error that you are getting sounds like the IDE expects you to also have the ST-LINK debugger connected, for some reason ST appears to not have bundled the debugger for the IDE in the IDE itself. I think It is included in the STM32CubeProg and it is also available as a standalone ST-LINK debugging tool, but I think the standalone version is technically depreciated?

As far as I can deduce, it looks like there isn’t an easy way to get a generic .ioc file for a particular board. However, I did stumble upon this .ioc for the correct board in a github. Maybe this will be a good base to start from?

2 Likes

I haven’t used STMCubeIDE but have programmed STM32 boards using SystemWorkbench IDE many times before.

Ardunio puts a bootloader program on the STM32 MCU that allows the Ardunio IDE to upload sketches over USB. When you use C IDE then you will need programmer to up load via the SW pins. I usually use a cheap Chinese ST -link see 1PCS ST LINK Stlink ST Link V2 Mini STM8 STM32 Simulator Download Programmierer Programmierung Mit Abdeckung A41 für arduino|Integrierte Schaltkreise| - AliExpress

Do beware once you upload via ST-link it will write over the Ardunio bootloader and if you want to go back to Ardunio then you need to reload the bootloader program with the ST-link

1 Like