feat: basic H7 support (#5228)

Co-authored-by: Malte Langermann <malte@langermann.net>
Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
Co-authored-by: Richard Li <richard.li@ces.hk>
This commit is contained in:
Raphael Coeffic
2024-07-05 19:28:44 +10:00
committed by GitHub
co-authored by Malte Langermann 3djc raphaelcoeffic Richard Li
parent 2110f1b938
commit 6f8a5313d5
517 changed files with 461229 additions and 395603 deletions
@@ -21,7 +21,6 @@ set(BOOTLOADER_SRC
../flash_driver.cpp
../watchdog_driver.cpp
../abnormal_reboot.cpp
init.c
boot.cpp
bin_files.cpp
)
@@ -138,7 +137,7 @@ add_executable(bootloader EXCLUDE_FROM_ALL ${BOOTLOADER_SRC})
add_dependencies(bootloader ${BITMAPS_TARGET})
target_link_options(bootloader PRIVATE
-lm -nostartfiles -T${LINKER_DIR}/bootloader.ld
-lm -T${LINKER_DIR}/bootloader.ld
-Wl,-Map=bootloader.map,--cref,--no-warn-mismatch,--gc-sections
--specs=nano.specs
)
@@ -19,8 +19,11 @@
* GNU General Public License for more details.
*/
#if !defined(SIMU)
#include "stm32_hal_ll.h"
#include "stm32_timer.h"
#endif
#include "hal/usb_driver.h"
#if defined(BLUETOOTH)
@@ -178,10 +181,9 @@ int menuFlashFile(uint32_t index, event_t event)
void flashWriteBlock()
{
uint32_t blockOffset = 0;
while (BlockCount) {
#if !defined(SIMU)
while (BlockCount) {
flashWrite((uint32_t *)firmwareAddress, (uint32_t *)&Block_buffer[blockOffset]);
#endif
blockOffset += FLASH_PAGESIZE;
firmwareAddress += FLASH_PAGESIZE;
if (BlockCount > FLASH_PAGESIZE) {
@@ -191,6 +193,7 @@ void flashWriteBlock()
BlockCount = 0;
}
}
#endif // SIMU
}
#if defined(EEPROM)
@@ -225,7 +228,7 @@ void bootloaderInitApp()
// wait a bit for the inputs to stabilize...
if (!WAS_RESET_BY_WATCHDOG_OR_SOFTWARE()) {
for (uint32_t i = 0; i < 150000; i++) {
__ASM volatile ("nop");
__ASM volatile("nop");
}
}
@@ -590,6 +593,3 @@ int bootloaderMain()
return 0;
}
#if !defined(SIMU) && (defined(PCBHORUS) || defined(PCBFLYSKY))
void *__dso_handle = nullptr;
#endif
@@ -1,9 +0,0 @@
void _init (void)
{
}
void _fini(void)
{
}