We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
With STM Cube MX I have generated a template code for my STM32F103C8.
If in MDK-ARM uVision I write a simple Blink program and flash it to my device with boot0 to high, I can upload the code without errors. However, it does not start until I manually remove the boot0 pin, put it to 0, and press reset (if with boot0=1 I start a debug session after flashing, nothing happens on the device). Only then I see the result of my code. In this mode, I am unable to flash any program, so I have to manually put it back to boot0=1 again.
How can I program my device and run it immediately, without changing pins every time?
Kind regards,
Max
Make sure you don't have any settings in CubeMX disabling the debug/SWD connectivity, or reconfigure PA13 / PA14
Another alternative is to use a debugger script to start the chip and change the SCB VTOR to 0x08000000, and pulls the SP/PC settings before transferring control.
Thank you so much. The tutorial I was following indeed did not mention that in CubeMX, I need to go to Sys -> Debug = Serial Wire (it is None by default). With this, I can flash my programs with boot0=0, press reset and see it running.