Skip to content

Commit

Permalink
AP_Bootloader: add SD card support to bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Feb 28, 2023
1 parent 3b230c4 commit d904599
Show file tree
Hide file tree
Showing 6 changed files with 422 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Tools/AP_Bootloader/AP_Bootloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <AP_HAL_ChibiOS/hwdef/common/watchdog.h>
#include "support.h"
#include "bl_protocol.h"
#include "flash_from_sd.h"
#include "can.h"
#include <stdio.h>
#if EXT_FLASH_SIZE_MB
Expand Down Expand Up @@ -181,6 +182,12 @@ int main(void)
}
#endif

#if AP_BOOTLOADER_FLASH_FROM_SD_ENABLED
if (flash_from_sd()) {
jump_to_app();
}
#endif

#if defined(BOOTLOADER_DEV_LIST)
while (true) {
bootloader(timeout);
Expand Down
7 changes: 7 additions & 0 deletions Tools/AP_Bootloader/AP_Bootloader_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#include "hwdef.h"

#ifndef AP_BOOTLOADER_FLASH_FROM_SD_ENABLED
#define AP_BOOTLOADER_FLASH_FROM_SD_ENABLED 0
#endif
Loading

0 comments on commit d904599

Please sign in to comment.