This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Start 4C1294 ROM USB Bootloader from code

How can I start the USB bootloader in ROM from code?

I have the bootloader configured to start when an input is low on startup but I would also like to allow the user to start it from a menu option.

I have tried  UpdaterUSB(0); without any luck.

Can somebody point me in the right direction?

Thanks in advance,

Paul.

  • Hi Paul,

    Have you had a look at the ROM Userguide (www.ti.com/.../spmu363) Dependent on which communication method you are using there is a function that can be called to update the firmware. For example, if you are using UART for the update the function is ROM_UpdateUART(); if you are using USB the function call is ROM_UpdateUSB? These functions are described in more detail within their respective sections in the ROM user guide.
  • It turns out that just UpdaterUSB is not enough. The hardware has to be initialized properly before calling that function.

    I've found another post that gives several suggestions:
    e2e.ti.com/.../1065612

    One of the things that appears to be important is to disable all the interrupts.

    The example includes code like this:

    HWREG(NVIC_DIS0) = 0xffffffff;
    HWREG(NVIC_DIS1) = 0xffffffff;
    HWREG(NVIC_DIS2) = 0xffffffff;
    HWREG(NVIC_DIS3) = 0xffffffff;
    HWREG(NVIC_DIS4) = 0xffffffff;

    However,I can't seem to find where NVIC_DIS0...4 is defined. Any idea where I can find this?

    Regards,
    Paul.

  • Hi Paul,

    The defines are part of the TivaWare install C:\ti\TivaWare_C_Series-2.1.1.71\inc\hw_nvic.h

    Generall, it is discouraged to use the direct register write methodology and we recommend using a driver library call instead. In the case of disabling all interrupts, I believe the bool ROM_IntMasterDisable() function would do the trick for you and be safer than a direct register write. Likewise, bool ROM_IntMasterEnable() would be used to enable all interrupts.
  • This is what seems to work for me:

    USBDCDTerm(0);
    MAP_IntMasterDisable();
    MAP_SysTickIntDisable();
    MAP_SysTickDisable();
    HWREG(NVIC_DIS0) = 0xffffffff;
    HWREG(NVIC_DIS1) = 0xffffffff;
    HWREG(NVIC_DIS2) = 0xffffffff;
    HWREG(NVIC_DIS3) = 0xffffffff;
    HWREG(NVIC_DIS4) = 0xffffffff;
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0);
    MAP_SysCtlPeripheralReset(SYSCTL_PERIPH_USB0);
    MAP_USBClockEnable(USB0_BASE, 8, USB_CLOCK_INTERNAL);
    MAP_SysCtlUSBPLLEnable();
    MAP_SysCtlDelay(MAP_SysCtlClockGet() / 3);
    MAP_IntMasterEnable();
    ROM_UpdateUSB(0);

    Regards,

    Paul.

  • Paul,

    Thanks for posting your solution. I am certain this will be helpful for others in your same situation in the future.