Some more of my experiments:
1.I'm flashing it through ST-LINK
2.I select "USB CDC Serial"
the test program
Code: Select all
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}
Variant №1
I do not make any changes or additions, everything is by default
When connected, the Error - USB device is not connected (the device descriptor request fails) and the LED lights up very slowly - every 3 seconds
Variant №2
Only the hal_conf_extra file is connected.h with the string #define HSE_VALUE 8000000U
When connected, the Error - USB device is not connected (the device descriptor request fails) and the LED lights тnormal - every 1 seconds
Variant №3
I only make changes to the file variant_BLACKPILL_F411CE.cpp
RCC_OscInitStruct.PLL.PLLM = 8;
RCC_OscInitStruct.PLL.PLLN = 192;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 4;
The COM port appears in the Windows Device Manager and the LED lights up very slowly - every 3 seconds
Variant №4
the hal_conf_extra file is connected.h with the string #define HSE_VALUE 8000000U
and
make changes to the file variant_BLACKPILL_F411CE.cpp
RCC_OscInitStruct.PLL.PLLM = 8;
RCC_OscInitStruct.PLL.PLLN = 192;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 4;
The COM port appears in the Windows Device Manager and the LED lights normal - every 1 seconds
The exchange with the serial port is normal, data is sent to the serial monitor (Serial.println("Test");)
Is there any way to optimize variant №4?