Page 2 of 2

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

Posted: Thu Jul 08, 2021 6:57 pm
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 6578 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.

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

Posted: Sat Jul 10, 2021 9:17 am
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.

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

Posted: Wed Jan 05, 2022 3:47 pm
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.

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

Posted: Wed Jan 05, 2022 7:58 pm
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.