What happens if in GPIO you configure the OTG1 with the purpose that it cannot be used for programming (by code, or in someway you program that OTG1 couldn't be used) and the boot mode is set to serial downloader (by hardware)?
This considering that BT_FUSE_SEL=0.
who has the highest priority? who do it listen to?
Thank you, I hope anyone knows about it.
Solved! Go to Solution.
Hi vanessa_dis,
Sorry for let you misunderstand me.
No, I don't mean that the changing GPIO has more priority than boot mode in the serial downloader.
let's know how to enter the serial downloader mode at first, just when you configure the BOOT_MODE[1:0]=01, then POR or reset happens you will enter the serial download mode, please note, in the serial download mode, customer can't control the pin functions directly, as the ROM already configure it, your PC will still can recognize the USB HID, then you can use the USB HID to download the app code. But if it is the internal boot mode, I main, you already enter the internal boot mode, then the pins, even the BOOT_MODE pins can be controlled by the user. So you can use the app code to change the pin function or even try to disable the USB clock, eg, CCGR6[CG0].
In conclusion, during the reset which will select the boot mode, external related pin signals will determine the boot mode, and in serial download mode, you can't disable USB, in internal boot mode, you can control the code to change the pin mode.
Wish it helps you!
If you still have questions about it, please kindly let me know.
Best Regards,
kerry
Hi @vanessa_dis
Please check the BOOT_MODE pin:
You can find it is not your OTG pins.
So, I don't think modify the OTG pin to the GPIO will trigger the serial download mode.
Do you meet the program issue now after modifying the function to GPIO?
BTW, I think you also can use the API uninit to disable the USB functions.
More details, please check your another post.
Any updated question, just kindly let me know.
Best Regards,
Kerry
Thank you Kerry for your answer
Are you sure about "I don't think modify the OTG pin to the GPIO will trigger the serial download mode"? So, you say that changing GPIO has more priority than boot mode in serial downloader?
I say this because what I understood Boot mode decide between GPIO, fuses or serial downloader, so I thought that boot mode had more priority than gpio configuration
Hi vanessa_dis,
Sorry for let you misunderstand me.
No, I don't mean that the changing GPIO has more priority than boot mode in the serial downloader.
let's know how to enter the serial downloader mode at first, just when you configure the BOOT_MODE[1:0]=01, then POR or reset happens you will enter the serial download mode, please note, in the serial download mode, customer can't control the pin functions directly, as the ROM already configure it, your PC will still can recognize the USB HID, then you can use the USB HID to download the app code. But if it is the internal boot mode, I main, you already enter the internal boot mode, then the pins, even the BOOT_MODE pins can be controlled by the user. So you can use the app code to change the pin function or even try to disable the USB clock, eg, CCGR6[CG0].
In conclusion, during the reset which will select the boot mode, external related pin signals will determine the boot mode, and in serial download mode, you can't disable USB, in internal boot mode, you can control the code to change the pin mode.
Wish it helps you!
If you still have questions about it, please kindly let me know.
Best Regards,
kerry
Thank you very much for your time Kerry