-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bootloader cleanup list #22
Comments
Apologies I might missed the context, it looks like they already reset those values back here https://github.com/im-tomu/tomu-bootloader/blob/master/toboot/main.c#L285-L315 USB->GAHBCFG = _USB_GAHBCFG_RESETVALUE;
USB->GINTMSK = _USB_GINTMSK_RESETVALUE;
USB->DAINTMSK = _USB_DAINTMSK_RESETVALUE;
USB->DOEPMSK = _USB_DOEPMSK_RESETVALUE;
USB->DIEPMSK = _USB_DIEPMSK_RESETVALUE;
USB->CTRL = _USB_CTRL_RESETVALUE;
// Reset RTC settings.
RTC->IEN = _RTC_IEN_RESETVALUE;
RTC->COMP0 = _RTC_COMP0_RESETVALUE;
RTC->CTRL = _RTC_CTRL_RESETVALUE;
// Wait for LF peripheral syncronization.
while (RTC->SYNCBUSY & _RTC_SYNCBUSY_MASK)
;
while (CMU->SYNCBUSY & CMU_SYNCBUSY_LFACLKEN0)
;
// Switch to default cpu clock.
CMU->CMD = CMU_CMD_HFCLKSEL_HFRCO;
CMU->OSCENCMD = CMU_OSCENCMD_HFXODIS | CMU_OSCENCMD_AUXHFRCODIS | CMU_OSCENCMD_LFRCODIS | CMU_OSCENCMD_USHFRCODIS;
CMU->USBCRCTRL = _CMU_USBCRCTRL_RESETVALUE;
// Reset clock registers used
CMU->HFCORECLKEN0 = CMU_HFCORECLKEN0_LE;
CMU->HFPERCLKDIV = _CMU_HFPERCLKDIV_RESETVALUE;
CMU->HFPERCLKEN0 = _CMU_HFPERCLKEN0_RESETVALUE;
CMU->LFCLKSEL = _CMU_LFCLKSEL_RESETVALUE;
CMU->LFACLKEN0 = _CMU_LFACLKEN0_RESETVALUE;
GPIO->P[0].MODEL = _GPIO_P_MODEL_RESETVALUE;
GPIO->P[1].MODEL = _GPIO_P_MODEL_RESETVALUE;
wondering if the reset value is the same as the one exposed from pac. I'll check if we can just leak that out. |
All the ones I listed are not reset to _GPIO_P_MODEL_RESETVALUE theyre set to something else or not on that list. |
Right, I misread your notes. Some of them are not reset indeed. |
Some more research on these
|
This is bootloader setup
https://github.com/im-tomu/tomu-bootloader/blob/master/toboot/main.c
These things dont appear to get undone and need to be handled
Stuff that wasnt obvious but that doesnt need to be reset
heres the where I got the reset values, we may want to bring these in and make them available for free functions where we give back the peripheral?
https://docs.silabs.com/mcu/5.6/efm32hg/group-EFM32HG-GPIO-BitFields
The text was updated successfully, but these errors were encountered: