Hey @jeremyzhou
Is it possible to exit serial download mode by using sdphost's write-register command ?
First, I've already upload bootable image into SPI flash through blhost.
After I send blhost --reset command , the device seems boot abnormally.
It boot into serial download mode again. However, if I re-plug in the power , or press the POR reset button. It can boot normally into my application.
I'd like to know what's wrong with this condition ?
BR,
Eric
Solved! Go to Solution.
Hi,
Thanks for sharing the detailed steps and I replicated the phenomenon on my side too.
According to the testing, we can jump to conclusion that the BOOT_MODE is initialized by sampling the BOOT_MODE0 and BOOT_MODE1 inputs on the rising edge of the POR_B.
Hope this is clear.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
1) I'd like to know what's wrong with this condition?
-- I think the source code of handling the Reset command can give us the answer.
//! @brief Reset command handler.
void handle_reset(uint8_t *packet, uint32_t packetLength)
{
command_packet_t *commandPacket = (command_packet_t *)packet;
send_generic_response(kStatus_Success, commandPacket->commandTag);
// Wait for the ack from the host to the generic response
g_bootloaderContext.activePeripheral->packetInterface->finalize(g_bootloaderContext.activePeripheral);
// Prepare for shutdown.
shutdown_cleanup(kShutdownType_Reset);
#if defined(BL_FEATURE_6PINS_PERIPHERAL) && BL_FEATURE_6PINS_PERIPHERAL
shutdown_cleanup(kShutdownType_Cleanup);
#endif // BL_FEATURE_6PINS_PERIPHERAL
NVIC_SystemReset();
// Does not get here.
assert(0);
}
After going through the code, we can find that the handle_reset function will execute the NVIC_SystemReset() to trigger a reset event, then MCU will boot from the mode which is determined by either boot pins or fuse set, and I think it can explain the phenomenon you encountered.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi @jeremyzhou
OK, I seem to know the problem. First, I forced BOOT_CFG Pin = 01 to enter sdp mode.
After that, upload flashloader image and run. At this moment, even though I change pin setting to internal boot mode
while flashloader is still running. BOOT_CFG Pin setting will be only latch once after power-on reset.
Also, Blhost --reset command is not equal power-on reset. So, it will always boot into serial download mode.
Am I right ?
BR,
Eric
Hi,
Thanks for your reply.
1) Am I right?
-- No, I'm afraid not, I think the --reset command to force the MCU exit the Serial Download if the BOOT CFG pins were set to internal boot mode before.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi @jeremyzhou
My verification steps as below: ( using IMXRT1050-EVKB)
1. Modify SW7 to 0001 (Set as serial download).
2. Use MCUBootUtility upload flashloader.
3. Use MCUBootUtility upload bootable image into nor-flash.
4. Modify SW7 to 0010 (Set as internal boot).
5. Press "reset device" button on MCUBootUtility --> this will trigger sending blhost --reset command
After these steps, mcu still stuck in serial download mode.
At this moment, you could try using this command "sdphost -t 50000 -u 0x1FC9,0x0130 -- read-register 1074757660 32 4"
This register represent SRC_SBMR2 which include BootMode Pin setting.
It always shows BootMode = 01, that means mcu didn't latch new setting when we sending blhost--reset
command through usb.
I've tried over 30 times or more..., the results were all the same. BOOT_CFG Pin setting will be only latch once after POR_B hardware reset triggered. Otherwise it won't be changed.
You could try by yourself.
BR,
Eric
Hi,
Thanks for sharing the detailed steps and I replicated the phenomenon on my side too.
According to the testing, we can jump to conclusion that the BOOT_MODE is initialized by sampling the BOOT_MODE0 and BOOT_MODE1 inputs on the rising edge of the POR_B.
Hope this is clear.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------