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.

ROM BOOT LOADER on LM4F232 EvaBoard

I am working on EvaBoard with LX4F232H5QDFIGA3 and I need to lunch the bootloader with ROM_UpdateUSB(pucUSBBootROMinfo),

but at the moment my program doesn't work: help me to understand why?

The SW project is "boot_demo1" of Stellarisware revision 9107 with IAR compiler 6.50.1 .

1) I have modify ROM.h  putting

#define ROM_UpdateUSB                                                     \
        ((void (*)(unsigned char *pucDescriptorInfo))ROM_USBTABLE[58])

2) I have modify boot_demo1.icf linker file putting

...region FLASH = mem:[from 0x00000000 ...

intead of     ....from 0x00002800...

3) I have modify boot_demo1.c putting

 ROM_UpdateUSB(pucUSBBootROMInfo); instead of

(*((void (*)(void))(*(unsigned long *)0x2c)))();

4) I have modify boot_demo1.c putting

unsigned char pucStrings[]=
{
(1 * 2) + 2, // One Language (1 * 2) + 2
USB_DTYPE_STRING,
0x09, 0x04, // Language code for US English.
(17 * 2) + 2, // Size of Manufacturer String.
// "Texas Instruments"
USB_DTYPE_STRING,
'T', 0, 'e', 0, 'x', 0, 'a', 0, 's', 0, ' ', 0, 'I', 0, 'n', 0,
's', 0, 't', 0, 'r', 0, 'u', 0, 'm', 0, 'e', 0, 'n', 0, 't', 0,
's', 0,
(23 * 2) + 2, // Size of Product String.
USB_DTYPE_STRING,
// "Device Firmware Upgrade"
'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, ' ', 0, 'F', 0,
'i', 0, 'r', 0, 'm', 0, 'w', 0, 'a', 0, 'r', 0, 'e', 0, ' ', 0,
'U', 0, 'p', 0, 'g', 0, 'r', 0, 'a', 0, 'd', 0, 'e', 0,
(3 * 2) + 2, // Size of Serial Number.
USB_DTYPE_STRING,
// "1.0"
'1', 0, '.', 0, '0', 0
};
unsigned char pucUSBBootROMInfo[]=
{
0xbe, 0x1c, // Stellaris VID
0xff, 0x00, // Stellaris DFU PID
0x00, 0x02, // USB version 2.0
0x00, // 0mA of Bus power
0xC0, // Self powered using no bus power
pucStrings // Address of the string table
};

BUT IAR does ERROR:

because  " pucStrings "   isn't a unsigned char !!

I try to substitute the values of pucStrings  inside pucUSBBootROMInfo[] and IAR say OK.

Then I download the executable on F232 by IAR I-jet via JTAG and run in debug mode:

the program don't run in right way...!!

Where is the problem ?

tks

 

  • I add an important info:

    Emulating with I-jet, I see that when ROM_UpdateUSB() is called

    a RESET take place, and program restart !

    This happen also without I-jet, then I think that the call to ROM function doesn't work.

    Waiting an ROM USB bootloader example for LM4F family, I ask Why it doesn't work ?

    thanks

     

     

  • Marco,

    There is an errata for the USB boot loader in ROM on the LM4F232H5QD device for rev A1: "USB boot loader in ROM does not operate correctly".  This issue is fixed rev A3.  Try using the Flash-based USB boot loader instead, such as the boot_usb example in StellarisWare.  Sorry for any inconvenience this may have caused you.  As an aside, the latest version of StellarisWare is currently revision 9453.

    -Rebecca

  • Rebecca,

    the text on my chip is, as I wrote,  LX4F232H5QDFIGA3 .

    This means that my version is A3 ?

    I read the F232H5QD errata about not working ROM of A1 revision chip, but in A3 revision it shold be fixed.

    Is  this  correct ?

     

  • Marco,

    Sorry, I didn't see you had mentioned the rev in your original post.  You're correct, in rev A3, the ROM USB boot loader works correctly.

    When declaring pucUSBBootROMInfo[], it expects data and not pointers, which is why replacing "pucStrings" with the actual data (PID, VID, etc.) fixed the compiler issue.

    The ROM USB boot loader is a bit different from the Flash USB boot loader in that it expects the USB to be configured before it is called.  In boot_demo1.c, in SetupForUSB(), insert the following code:

    //
    // Enable the USB controller.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0);

    //
    // Set the USB pins to be controlled by the USB controller.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
    ROM_GPIOPinConfigure(GPIO_PG4_USB0EPEN);
    ROM_GPIOPinTypeUSBDigital(GPIO_PORTG_BASE, GPIO_PIN_4);
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOL);
    ROM_GPIOPinTypeUSBAnalog(GPIO_PORTL_BASE, GPIO_PIN_6 | GPIO_PIN_7);
    ROM_GPIOPinTypeUSBAnalog(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    I tried this on my end with an EK-LM4F120XL (rev A3 silicon and different USB pin configurations) and this worked.  Without the USB pin and clock initialization, the program would restart, like you had described.  Let me know if this works on your end.

    I also submitted the request to our software team for a ROM boot loader StellarisWare example.

    -Rebecca

  • Rebecca,

    I follow your instructions:

    now there isn't a RESET, I see program in 0x100706E ( ROM address ? ), in a waiting loop for something,

    but the USB communication don't start, I see nothing on D+ e D- USB wire.

    With Flash Bootloader I see the data flow on the USB wires.

    I think that something is still missing...

     

    waiting for help

     

  • Marco,

    Oops, for the the call to SysCtlUSBPLLEnable();.  This is required to turn on the USB PLL and is necessary before connecting to any external device.  See if this addition to SetupForUSB fixes your issue.

    -Rebecca

  • YES !

    Thank you, Rebecca, now the demo boot is working.

    Then I am trying to implement the ROM bootloader in an application with USB already working.

    I take USB bulk Stellarisware example, the USB is already active, when a key is pressed, I must invoke ROM bootloader,

    but don't work, a RESET take place.

    In the new application I call only the JumpToBootLoader(), that it disable all interrupt and then call ROM_UpdateUSB().

    Before call ROM_UpdateUSB() is necessary to stop the USB( that it is already connected )  ?

    Which commands are necessary to invoke correctly the ROM bootloader when USB is already active ?

    thks

  • Studying another time the docs about USB ROM command, I find that the ROM_USBDevDisconnect() is necessary.

    I put this command in SetUpForUSB() : the app now doesn't RESET , the USB restart connection, but some problem occours.

    The PC doesn't recognize the new device, and USB communication is terminated after 10 seconds.

    I don't think that the problem are on PC, because in boot demo all work, the PC has correct DFU drivers....

    some idea about the issue ?

    thks