Skip to content

Commit

Permalink
v6x-rt: Add reboot to isp support
Browse files Browse the repository at this point in the history
  • Loading branch information
PetervdPerk-NXP committed Jan 4, 2024
1 parent c379542 commit a94a661
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions boards/px4/fmu-v6xrt/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,8 @@

/* This board provides the board_on_reset interface */

#define BOARD_HAS_ISP_BOOTLOADER 1

#define BOARD_HAS_ON_RESET 1

#define PX4_GPIO_INIT_LIST { \
Expand Down
2 changes: 2 additions & 0 deletions platforms/nuttx/src/px4/nxp/imxrt/board_reset/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ px4_add_library(arch_board_reset
board_reset.cpp
)

target_link_libraries(arch_board_reset PRIVATE arch_board_romapi)

# up_systemreset
if (NOT DEFINED CONFIG_BUILD_FLAT)
target_link_libraries(arch_board_reset PRIVATE nuttx_karch)
Expand Down
9 changes: 9 additions & 0 deletions platforms/nuttx/src/px4/nxp/imxrt/board_reset/board_reset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
#include <arm_internal.h>
#include <hardware/rt117x/imxrt117x_snvs.h>


#include <px4_arch/imxrt_flexspi_nor_flash.h>
#include <px4_arch/imxrt_romapi.h>

#define BOOT_RTC_SIGNATURE 0xb007b007
#define PX4_IMXRT_RTC_REBOOT_REG 3
#define PX4_IMXRT_RTC_REBOOT_REG_ADDRESS IMXRT_SNVS_LPGPR3
Expand All @@ -64,6 +68,11 @@ int board_reset(int status)
{
if (status == REBOOT_TO_BOOTLOADER) {
board_reset_enter_bootloader();

} else if (status == REBOOT_TO_ISP) {
uint32_t arg = 0xeb100000;
ROM_API_Init();
ROM_RunBootloader(&arg);
}

#if defined(BOARD_HAS_ON_RESET)
Expand Down

0 comments on commit a94a661

Please sign in to comment.