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.

TM4C129ENCPDT: Flash based USB bootloader, unknown device

Part Number: TM4C129ENCPDT
Other Parts Discussed in Thread: EK-TM4C129EXL, , EK-TM4C1294XL, UNIFLASH

Hi,
We are trying to implement flash based USB bootloader on TM4C129ENCPDT (rev A2) controller. Ultimately this is going to be on our custom board, but for reference we have EK-TM4C129EXL launchpad.
Since the examples didn't have the exact boot loader for the board, the reference config is from dk-tm4c129/boot_emac_flash/bl_config.h, where the ethernet config (lines 856...904) was swapped out for usb ones (lines 916 ...1241). This was cross-referenced withdk-tm4c123g/boot_usb/bl_config.h.
Other sources are from /boot_loader/ for the code composer build - bl_usb.c and its dependencies, bl_startup_ccs.s and linker bl_link_ccs.cmd.  Code Composer is  v7.3.0.00019.
So far :
I added #define TARGET_IS_TM4C129_RA2 to the bl_config.h for revision specific configuration.
Project properties - ARM Linker - Advanced options - Runtime environment - initialization model - changed to --ram_model. This got rid of the linker warnings. Without this the USB was receiving periodic USB_IS_RESET messages (bl_usb.c line 463) from the host.
The project compiles with these settings without any warnings or errors. When debugging the code, it seems to run through usb initialization functions and then gets stuck in the UpdaterUSB while(g_ui32CommandFlags == 0) (bl_usb.c line 1811) loop. The windows (windows 7 and 10)  wont recognize the device :



The launchpad itself is switched to OTG power and debug usb cable is disconnected. I tried http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/602844/2217914 post #5 and this seemed to be working fine. This indicates that after erasing the flash, there seems to be some kind of rom based bootloader which works. I have attached the sample project used. For reference i have also read spmu301d (Tivaware Bootloader user's guide).

What am i missing here ?

Regards,

Keijo
Flash_boot_loader_dfu.zip

  • Changing to RAM runtime initialization is not correct for a program that runs from Flash. If I understand what you are trying to do, I think you are doing it the hard way. If you need a DFU boot loader, you can use the ROM based one (even with application code in the flash). See this demo program for an example:
    C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c1294xl\boot_demo1
  • Hi, thank you for the fast reply.

    We need to implement flash based bootloader, unless ROM based one can deal with decryption and CRC checking, for which i did not find any information.  Also as I understood, the actual flash-based bootloader will run from SRAM after ProcessorInit().

    The example you linked is working with /boot_serial/ FLASH-based bootloader, which has to be modified in order to work with USB - specifically the settings in bl_config.h, am i right ?

    Currently i took the /boot_serial/ project and modified the bl_config.h for usb. After loading this to 0x0000 and boot_demo1 to 0x4000 with UNIFLASH I see the led flashing which means boot_demo1 works. After button press the bootloader gets called and the usb device wont be recognized by windows, which is the same problem i had before. So this means buggy bl_config.h ? I attached it.6064.bl_config.h

    Regards,

    Keijo

  • OK, I understand the need for you to do a custom flash based USB boot loader.