I am new to STM32 but I have experience with C and other MCUs families.
I need to make it work with Arduino IDE, now using Arduino IDE version 1.8.15
If I want to run this basic code on my Blue Pill board with STM32F103C8T6, I am having trouble to use the native USB connection to program and also to Serial.print to the IDE console terminal.
Code: Select all
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println("Hello");
delay(1000);
}
- Board: Generic STM32F1 series
- Board port number: "BluePill F103C8"
- U(S)ART support "Enabled" (Generic serial)
- USB support (if available): "CDC (generic Serial)
- USB speed (if available): "Low/Full Speed"
- Optimize: "Smallest (-Os default)
- Upload method: HID Bootloader 2.0
- Port: COM12
- Get Board Info: working fine
With this configuration I am unable to program my BluePill. This is what I get:
Note: My BluePill has been previously programmed via USB but with STM32F1xx/GD32F1xx boards by stmduino> Trying to open the [COM12]...
> Toggling DTR...
> Searching for [1209:BEBA] device...
##########
Error - [1209:BEBA] device is not found> Searching for [COM12] ...
Error - [1209:BEBA] device is not found> Searching for [COM12] ...
> Finish
In this case, the settings change as follows:
- Board: "Generic STM32F103C8 series"
- Variant: STM32F103C8 (20K RAM; 64K Flash)
- Upload method "STM32duino bootloader"
- CPU speed (MHz): 72 MHz (Normal)
- Optimize: "Smallest (default)"
- Port: COM12
- Get board info: working fine
This means that the bootloader works. But I am working in a project that need a timer interrupt event.
The timer functions compile if I use the first setting configuration by STMicroelectronics, but I am unable to program.
If I don't use the timer library, and using the second configuration by stmduino, I am able to program the BluePill using the classic USB connection.
I need help to know how the STMicroelectronics libraries can be used and still program the board via USB from the Arduino IDE.
Thank you