diff --git a/platforms/nuttx/src/px4/nxp/imx9/board_reset/board_reset.cpp b/platforms/nuttx/src/px4/nxp/imx9/board_reset/board_reset.cpp index 32b90f23c926..a4559e5941fc 100644 --- a/platforms/nuttx/src/px4/nxp/imx9/board_reset/board_reset.cpp +++ b/platforms/nuttx/src/px4/nxp/imx9/board_reset/board_reset.cpp @@ -41,11 +41,22 @@ #include #include #include +#include "imx9_pmic.h" extern "C" void __start(void); static void board_reset_enter_bootloader() { + /* WDOG_B pin is unused in current HW design. + * Related configuration bits (WDOG_B_CFG) from PMIC RESET_CTRL + * register are borrowed for stay in bootloader reason delivery. + * + * stay in bootloader: WDOG_B_CFG 11b + */ + + imx9_pmic_set_reset_ctrl(IMX9_PMIC_RESET_CTRL_DEFAULT | + IMX9_PMIC_RESET_CTRL_WDOG_COLD_RESET_MASK); + /* Reset the whole SoC */ up_systemreset(); @@ -53,6 +64,15 @@ static void board_reset_enter_bootloader() static void board_reset_enter_bootloader_and_continue_boot() { + /* WDOG_B pin is unused in current HW design. + * Related configuration bits (WDOG_B_CFG) from PMIC RESET_CTRL + * register are borrowed for stay in bootloader reason delivery. + * + * With PMIC register power on value system will boot normally. + */ + + imx9_pmic_set_reset_ctrl(IMX9_PMIC_RESET_CTRL_DEFAULT); + /* Reset the whole SoC */ up_systemreset();