Hello.
I need to be educated on this a bit.
I just bought a bunch of WeAct stm32F103CB BluePills whose internal LED is connected to pin PB2. I have an STLink and the STM32CubeProgrammer software installed. I couldn't find a hid_generic_pb2.bin file to flash so I just used the hid_generic_pc13.bin file that I have used for other variants of blue pills.
Everything seems to work fine. I can upload a sketch from the Arduino IDE using the HID Bootloader upload method connected via a USB cable and I can make the LED blink by specifying the PB2 pin. I can upload sketches repeatedly with no difficulty. The serial monitor works fine. So all's good, no?
So, am I missing anything by having used the _pc13.bin file that I used? What is the purpose of having all those different bin files? If it matters which bin file I use, how can I get one that's designed for the board with the LED on pin PB2?
A million thanks in advance.
Peter
WeAct stm32F103CB HID Bootloader question
Re: WeAct stm32F103CB HID Bootloader question
The only difference among these bin files is the pin definition of the on-board LED used by the HID bootloader to indicate its status.
If you don't care about the status indicator, you can use any of these bin files.
and replace the following lines
with these:
Recompile the HID Bootloader source code and use the hid_generic_pb12.bin file
If you don't care about the status indicator, you can use any of these bin files.
The easy way is to edit the file: STM32_HID_Bootloader/bootloader/F1/Inc/config.hhow can I get one that's designed for the board with the LED on pin PB2?
and replace the following lines
Code: Select all
#elif defined TARGET_GENERIC_F103_PB12
#define LED1_CLOCK RCC_APB2ENR_IOPBEN
#define LED1_BIT_0 SET_BIT(GPIOB->CRH, GPIO_CRH_CNF12_0 | GPIO_CRH_MODE12)
#define LED1_BIT_1 //CLEAR_BIT(GPIOB->CRH, GPIO_CRH_CNF12_1)
#define LED1_MODE
#define LED1_OFF WRITE_REG(GPIOB->BSRR, GPIO_BSRR_BS12)
#define LED1_ON WRITE_REG(GPIOB->BRR, GPIO_BRR_BR12)
Code: Select all
#elif defined TARGET_GENERIC_F103_PB12
#define LED1_CLOCK RCC_APB2ENR_IOPBEN
#define LED1_BIT_0 SET_BIT(GPIOB->CRH, GPIO_CRH_CNF2_0 | GPIO_CRH_MODE2)
#define LED1_BIT_1 //CLEAR_BIT(GPIOB->CRH, GPIO_CRH_CNF2_1)
#define LED1_MODE
#define LED1_OFF WRITE_REG(GPIOB->BSRR, GPIO_BSRR_BS2)
#define LED1_ON WRITE_REG(GPIOB->BRR, GPIO_BRR_BR2)
Vassilis Serasidis
https://www.serasidis.gr
https://www.serasidis.gr
Re: WeAct stm32F103CB HID Bootloader question
Thanks very much!