Skip to content

Commit

Permalink
boards: Add mboot target to CUSTOM_PYBD_SF2.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Dec 22, 2021
1 parent 789d9ed commit 330065e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions boards/CUSTOM_PYBD_SF2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,12 @@ firmware:
BOARD_DIR=$(BOARD_DIR) \
BUILD=$(BUILD)

mboot:
$(Q)$(MAKE) -C $(MICROPY_TOP)/ports/stm32/mboot \
PROJECT_TOP=$(abspath ../..) \
BOARD=$(BOARD) \
BOARD_DIR=$(BOARD_DIR) \
BUILD=$(BUILD)-mboot

deploy:
$(PYTHON) $(MICROPY_TOP)/tools/pydfu.py -u $(BUILD)/firmware.dfu
4 changes: 4 additions & 0 deletions boards/CUSTOM_PYBD_SF2/board_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// Use PYBD_SF2 implementation, but add extra initialisation.
#include "boards/PYBD_SF2/board_init.c"

#if !BUILDING_MBOOT

void board_early_init_custom(void) {
// Call PYBD_SF2's board init function.
board_early_init();
Expand All @@ -23,3 +25,5 @@ int board_run_boot_py(boardctrl_state_t *state) {
mp_printf(&mp_plat_print, "Starting custom board\n");
return boardctrl_run_boot_py(state);
}

#endif

0 comments on commit 330065e

Please sign in to comment.