WeActStudio / WeAct_HID_Bootloader_F4x1

WeAct_HID_Bootloader_F4x1 base on STM32_HID_Bootloader
36 stars 12 forks source link

Which file is the bootloader ? And how to use the WeAct_HID_Bootloader_F4x1 ? #2

Open eagl1 opened 1 year ago

eagl1 commented 1 year ago

Hi,

I don't know what to do exactly ? Do I have to open the folder in STM32CubeIDE ?

Which file to upload to the microcontroller ?

rena2019 commented 1 year ago

Under Windows you can build the hex file with the following steps:

  1. Open command prompt (cmd.exe), cd to project folder and extend your path with GNU build tools, e.g.: set PATH=D:\STM32CubeIDE_1.10.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127\tools\bin;D:\STM32CubeIDE_1.10.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.0.202111181127\tools\bin;%PATH%
  2. fix Makefile by removing line 45: Core/Src/key.c \
  3. build hex file with: make ... text data bss dec hex filename 20624 468 6544 27636 6bf4 build/WeAct_HID_Bootloader_F4x1.elf arm-none-eabi-objcopy -O ihex build/WeAct_HID_Bootloader_F4x1.elf build/WeAct_HID_Bootloader_F4x1.hex arm-none-eabi-objcopy -O binary -S build/WeAct_HID_Bootloader_F4x1.elf build/WeAct_HID_Bootloader_F4x1.bin
  4. flash hex file with DAPLink and openocd: D:\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.openocd.win32_2.2.300.202301161003\tools\bin\openocd.exe -s D:/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.debug.openocd_2.0.600.202303311036/resources/openocd/st_scripts -s D:/STM32CubeIDE/plugins/com.st.stm32cube.ide.mpu.debug.openocd_2.0.500.202301161420/resources/openocd/st_scripts -c "source [find interface/cmsis-dap.cfg]" -c "transport select swd" -c "source [find target/stm32f4x.cfg]" -c "program build/WeAct_HID_Bootloader_F4x1.elf verify reset exit"

...but it seems that the bootloader does not work???? No USB events ?????