Hi,
I have custom software running with TiRTOS on a TM4C1264NCPDT and I want to run the ROM_updateUSB(0) from my code in order to get into DFU mode and do a firmware update.
There are several posts about this and this is the code I am using derived from these posts...
//-----------------------------------------------------------------------------------
void enterBootloader(void)
{
int ui32Addr;
ROM_IntMasterDisable();
ROM_SysTickIntDisable();
ROM_SysTickDisable();
ROM_SysCtlPeripheralDisable(SYSCTL_PERIPH_USB0);
HWREG(NVIC_DIS0) = 0xffffffff;
HWREG(NVIC_DIS1) = 0xffffffff;
HWREG(NVIC_DIS2) = 0xffffffff;
HWREG(NVIC_DIS3) = 0xffffffff;
HWREG(NVIC_DIS4) = 0xffffffff;
for(ui32Addr = NVIC_PRI0; ui32Addr <= NVIC_PRI34; ui32Addr+=4) {
HWREG(ui32Addr) = 0;
}
HWREG(NVIC_SYS_PRI1) = 0;
HWREG(NVIC_SYS_PRI2) = 0;
HWREG(NVIC_SYS_PRI3) = 0;
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOL); //
while(!ROM_SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOL))
{
}
ROM_GPIOPinTypeUSBAnalog(GPIO_PORTL_BASE, GPIO_PIN_6 | GPIO_PIN_7);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0);
while(!ROM_SysCtlPeripheralReady(SYSCTL_PERIPH_USB0))
{
}
ROM_SysCtlPeripheralReset(SYSCTL_PERIPH_USB0);
SysCtlUSBPLLEnable();
ROM_SysCtlDelay(40000000);
ROM_IntMasterEnable();
ROM_UpdateUSB(0);
while(1)
{
}
}
I am calling this from the USBCDCD thread (the command to go into bootloader is a serial port message from the host).
My problem is that this does not appear to run the bootloader in DFU mode until I power-cycle it.
Can anybody tell me what I am doing wrong please.
Thanks
Richard