Greetings!
I am currently trying to get the bootloader USB DFU on our project board to proc when the flash is erased/empty.
I tested this functionality out on a LaunchPad Tiva C series and it worked. The flash was empty, BOOTCFG was set at default to satisfy condition 3;
3. If the EN bit is set or the status doesn't match the specified polarity, the data at address
0x0000.0004 is read, and if the data at this address is 0xFFFF.FFFF, the ROM is mapped to
address 0x0000.0000 and execution continues out of the ROM Boot Loader.
;There is an external clock set at 16MHz, USB header is properly attached and plugged in to a PC.
The eval board comes right up as a DFU device and I can flash it. On our project board nothing comes up on the PC.
Things I have done:
- I checked the boot loader code between the eval board and project board and there are differences, but what those differences do I haven't figured out yet.
- When the boot loader runs on the eval board it sets the USB registers. When the boot loader on our project board runs the USB registers are not set from other then their default value.
- I can get the USB DFU to proc on our project board by uploading a small app that purposefully procs the USB DFU Boot loader. See code below.
#include <stdint.h> #include <stdbool.h> #include "inc/tm4c1233h6pm.h" #include "inc/hw_types.h" #include "inc/hw_memmap.h" #include "driverlib/sysctl.h" #include "driverlib/gpio.h" #include "inc/hw_nvic.h" //added by MS #include "driverlib/rom.h" //added by MS #include "driverlib/rom_map.h" //added by MS //***************************************************************************** // //! \addtogroup example_list //! <h1>Blinky (blinky)</h1> //! //! A simple app that procs the USB DFU // //***************************************************************************** //***************************************************************************** // // Proc USB DFU // //***************************************************************************** int main(void) { // Enable lazy stacking for interrupt handlers. This allows floating-point // instructions to be used within interrupt handlers, but at the expense of // extra stack usage. // ROM_FPULazyStackingEnable(); // // Set the clocking to run from the PLL at 50MHz // MAP_SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ | SYSCTL_INT_OSC_DIS); // // Configure the required pins for USB operation. // MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); MAP_GPIOPinTypeUSBAnalog(GPIO_PORTD_BASE, GPIO_PIN_5 | GPIO_PIN_4); #define SYSTICKS_PER_SECOND 100 uint32_t ui32SysClock = MAP_SysCtlClockGet(); MAP_SysTickPeriodSet(MAP_SysCtlClockGet() / SYSTICKS_PER_SECOND); MAP_SysTickIntEnable(); MAP_SysTickEnable(); // Disable all interrupts MAP_IntMasterDisable(); MAP_SysTickIntDisable(); MAP_SysTickDisable(); HWREG(NVIC_DIS0) = 0xffffffff; HWREG(NVIC_DIS1) = 0xffffffff; // 1. Enable USB PLL // 2. Enable USB controller MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0); MAP_SysCtlPeripheralReset(SYSCTL_PERIPH_USB0); MAP_SysCtlUSBPLLEnable(); // 3. Enable USB D+ D- pins // 4. Activate USB DFU MAP_SysCtlDelay(ui32SysClock / 3); MAP_IntMasterEnable(); // Re-enable interrupts at NVIC level ROM_UpdateUSB(0); // 5. Should never get here since update is in progress }
Any input and or advice on how to get our USB DFU to proc would be greatly appreciated.
-Matt
Edit: spelling