This HID bootloader does not load the Arduino sketch, why

Bootloader for STM32F103 and STM32F4xx micro-controllers
No special driver is required. Support for Windows, Linux and Mac Operating System
Rekog
Posts: 13
Joined: Mon Jun 28, 2021 6:10 pm

Re: This HID bootloader does not load the Arduino sketch, why

Post by Rekog »

So what's the address, according to the source it's at 0x08000000

Code: Select all

#define FLASH_BASE            ((uint32_t)0x08000000) /*!< FLASH base address in the alias region */
#define BOOTLOADER_SIZE	(2 * 1024)						// Bootloader size
#define USER_PROGRAM	(FLASH_BASE + BOOTLOADER_SIZE)	// HID Bootloader takes 2 kb flash

funct_ptr UserProgram = (funct_ptr)*(volatile uint32_t*)(USER_PROGRAM);
FLASH_BASE start at 0x08000000, we add the bootloader there so it takes FLASH_BASE + BOOTLOADER_SIZE, then we add the Arduino sketch aka USER_PROGRAM after that.
FLASH.png
FLASH.png (11.86 KiB) Viewed 5636 times
This configuration is perfectly working and makes the board recognizable by Windows when I only let the bootloader in the device memory, but when I add the USER_PROGRAM, the board start to be unrecognizable.
Rekog
Posts: 13
Joined: Mon Jun 28, 2021 6:10 pm

Re: This HID bootloader does not load the Arduino sketch, why

Post by Rekog »

Finally I am able to achieve what I want with STM32CubeIDE and STM32CubeProg
https://www.st.com/en/development-tools ... beide.html
https://www.st.com/en/development-tools ... eprog.html

Far simple to use than Arduino IDE.
robinkyle11
Posts: 1
Joined: Wed Jan 05, 2022 3:44 pm

Re: This HID bootloader does not load the Arduino sketch, why

Post by robinkyle11 »

I used, HID bootloader 2.0.

The board is a STM32F103C8Tb.

I do not use USB serial in the sketch as you can see.

I just try to turn on/off a digital port.

This board do accept the upload of HID bootloader, also my customized HID bootloader, but it doesn't accept my Arduino sketch.

I wonder how can I program it if what Arduino generate isn't compatible with my board.

Ive compared the device memory bootloader section before and after the Arduino upload.

And it's the same, despite the device become unrecognizable after the upload, make no sense at all.
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: This HID bootloader does not load the Arduino sketch, why

Post by GonzoG »

If you do not enable CDC or HID for USB then it will be unrecognizable because you haven't put any USB support in the program.
To fully use HID bootloader you need to enable CDC so your board will be recognized as a COM port.

Without CDC support you need to manually reset board into bootloader.
Post Reply

Return to “STM32 HID bootloader”