From bf90d1514bb3eb8e3e9cfcb61ba7874b9159b565 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Thu, 10 Dec 2020 17:06:00 -0800 Subject: [PATCH] works on new board --- firmware/bootloader/bootloader.cpp | 13 ++++++------- firmware/bootloader/build_bootloader.sh | 2 +- firmware/wideband_layout.ld | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/firmware/bootloader/bootloader.cpp b/firmware/bootloader/bootloader.cpp index dcdca8c..683f5e5 100644 --- a/firmware/bootloader/bootloader.cpp +++ b/firmware/bootloader/bootloader.cpp @@ -175,13 +175,6 @@ THD_FUNCTION(BootloaderThread, arg) RunBootloaderLoop(); } -/* - * Threads creation table, one entry per thread. - */ -THD_TABLE_BEGIN - THD_TABLE_THREAD(0, "bootloader", waBootloaderThread, BootloaderThread, nullptr) -THD_TABLE_END - /* * Application entry point. */ @@ -189,12 +182,18 @@ int main(void) { halInit(); chSysInit(); + chThdCreateStatic(waBootloaderThread, sizeof(waBootloaderThread), NORMALPRIO, BootloaderThread, nullptr); + // PB5 is blue LED palSetPadMode(GPIOB, 5, PAL_MODE_OUTPUT_PUSHPULL); + // PB6 is green LED + palSetPadMode(GPIOB, 6, PAL_MODE_OUTPUT_PUSHPULL); + palTogglePad(GPIOB, 6); for (size_t i = 0; i < 20; i++) { palTogglePad(GPIOB, 5); + palTogglePad(GPIOB, 6); chThdSleepMilliseconds(40); } diff --git a/firmware/bootloader/build_bootloader.sh b/firmware/bootloader/build_bootloader.sh index b6ffc79..38873a2 100755 --- a/firmware/bootloader/build_bootloader.sh +++ b/firmware/bootloader/build_bootloader.sh @@ -5,6 +5,6 @@ make clean && make -j4 # convert bootloader bin output to a linkable .o file # first pad the binary out with 0xFF -arm-none-eabi-objcopy -I binary -O binary --gap-fill 0xFF --pad-to 0x1000 build/wideband_bootloader.bin build/wideband_bootloader.padded.bin +arm-none-eabi-objcopy -I binary -O binary --gap-fill 0xFF --pad-to 0x1800 build/wideband_bootloader.bin build/wideband_bootloader.padded.bin # then convert it to a .o file arm-none-eabi-objcopy -I binary -O elf32-littlearm -B arm --rename-section .data=.bl build/wideband_bootloader.padded.bin build/wideband_bootloader.o diff --git a/firmware/wideband_layout.ld b/firmware/wideband_layout.ld index ae08f09..73e70b9 100644 --- a/firmware/wideband_layout.ld +++ b/firmware/wideband_layout.ld @@ -2,7 +2,7 @@ * STM32F042x6 memory setup. */ -blsize = 4k; +blsize = 6k; MEMORY {