1 # TODO if the files order is different (these 2 SRC sections exchanged), the bootloader hangs for 20s in USB init. Why?
3 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
8 ../../common/arm/stm32/f4/system_stm32f4xx.c
9 ../../../${STM32LIB_DIR}/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_stm32f40_41xxx.s
10 ../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
11 ../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
12 ../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
13 ../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_i2c.c
14 ../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/misc.c
19 ../../common/arm/stm32/f2/system_stm32f2xx.c
20 ../../../${STM32LIB_DIR}/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s
21 ../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c
22 ../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c
23 ../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c
24 ../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_i2c.c
25 ../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/misc.c
31 ../../../gui/${GUI_DIR}/lcd.cpp
32 ../../../gui/${GUI_DIR}/fonts.cpp
34 ../../../strhelpers.cpp
35 ../../../${STM32USB_DIR}/STM32_USB_OTG_Driver/src/usb_core.c
36 ../../../${STM32USB_DIR}/STM32_USB_OTG_Driver/src/usb_dcd.c
37 ../../../${STM32USB_DIR}/STM32_USB_OTG_Driver/src/usb_dcd_int.c
38 ../../../${STM32USB_DIR}/STM32_USB_Device_Library/Core/src/usbd_core.c
39 ../../../${STM32USB_DIR}/STM32_USB_Device_Library/Core/src/usbd_ioreq.c
40 ../../../${STM32USB_DIR}/STM32_USB_Device_Library/Core/src/usbd_req.c
41 ../../../${STM32USB_DIR}/STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c
42 ../../../${STM32USB_DIR}/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c
43 ../../../${STM32USB_DIR}/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c
44 ../../../${STM32USB_DIR}/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c
45 ../../../${FATFS_DIR}/ff.c
46 ../../../${FATFS_DIR}/option/ccsbcs.c
48 ../backlight_driver.cpp
53 ../../common/arm/stm32/usbd_usr.cpp
54 ../../common/arm/stm32/usbd_storage_msd.cpp
55 ../../common/arm/stm32/delays.cpp
56 ../../common/arm/stm32/usbd_desc.c
57 ../../common/arm/stm32/usb_bsp.c
58 ../../common/arm/stm32/usb_driver.cpp
64 remove_definitions(-DLUA -DDEBUG)
65 add_definitions(-DBOOT)
67 set(CMAKE_EXE_LINKER_FLAGS "-mcpu=${MCU} -mthumb -nostartfiles -lm -T${RADIO_SRC_DIRECTORY}/targets/taranis/stm32_ramboot.ld -Wl,-Map=bootloader.map,--cref,--no-warn-mismatch,--gc-sections")
69 add_executable(bootloader ${BOOTLOADER_SRC})
70 add_dependencies(bootloader ${BITMAPS_TARGET} firmware_translations)
73 TARGET bootloader POST_BUILD
74 COMMAND arm-none-eabi-objcopy -O binary bootloader.elf bootloader.bin
76 if(PYTHONINTERP_FOUND)
78 TARGET bootloader POST_BUILD
79 COMMAND ${PYTHON_EXECUTABLE} ${RADIO_DIRECTORY}/util/bin2lbm.py bootloader.bin bootloader.lbm
83 PrintTargetReport("bootloader")