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.

F28M36 boot from Ethernet

Other Parts Discussed in Thread: UNIFLASH, CONTROLSUITE

Hi guys,

Currently we are developing a pcb board with F28M36 microcontroller. In the future this pcb will be boxed and we won't be able to open it in order to update the firmware. Although, we will have Ethernet interface. The first problem is that I didn't know any software that is able to program the device over Ethernet interface. Does such kind of software exists?
On the other hand, I don't know how can we change the boot mode without using a special boot loader software or building a circuit that would change the boot selector pins state?

Thanks in advance!

Tamas 

  • Hi Tamas,

    Here are various ways by which you can load/update your firmware:

    3286.Flash Programming Solutions.pdf

    Regards,

    Gautam

  • Hi Gautam,

    I'm curious whether the programming is possible over Ethernet without writing my own bootloader. I know, that for serial programming there are some tools e.g. UniFlash, but for Ethernet?

    Thanks in advance!

    Regards,

    Tamas

  • Tamas,

    as of now I don't think we have any solution like Uniflash-over-UART, that would work over Ethernet. We talked about expanding the Uniflash support to Ethernet but I'm not sure when that would hit the market.

    Customers could develop their own firmware upgrade solution with the help of TI provided documentation. Basically you would need to build a kernel (with Flash API) that gets loaded over the boot interface and this kernel once downloaded and started would take over the boot peripheral and gets the application image that needs to be programmed onto the Silicon. Then you would need to figure out how the same can be done for the control subsystem, M3 would get the C-Kernel from M3 Ethernet interface and sends it over to C28x using any of the boot modes and SERPLOOP interface or shared RAMs?

    To aid the kernel development and testing you can use LM flash Flashprogrammer as explained in the device TRM, towards the end of the boot ROM chapter.

    One other thing to work here is the HOST utility/program that would send the application/kernels to the device, LMFlash programmer can be used initially but I'm not sure if it would completely solve the problem so you might want to look at writing something similar to LMFlash programmer.

    On the other question, you would have to switch the boot mode pins to let the device boot from EMAC vs boot-to-flash. Or let the device always boot to flash and let the application in flash decide to call back to EMAC boot loader function in ROM. This depends on your application needs and how would the device know that it needs a firmware upgrade?

    hope this helps.

     

    Best Regards

    Santosh

     

     

  • Hi Santosh,

    First we have to design the circuit diagram. Since the pcb won't be easily accessible, we have to ensure that the firmware programming is possible without changing the state of the boot mode pins.

    The best boot interface would be the Ethernet, but we can use the UART as well. Our application code can handle both, so if the user sends down a special message to indicate that the firmware should be upgraded, the application code can act as it is required.

    Do you mean under call back to EMAC that the application code can jump to the EMAC boot entry point without reading the value of the 4 boot pins? If so and it is possible with the UART as well we can use Uniflash until the Ethernet programmer is not available, otherwise I would place a small circuit that can set the boot pins before the microcontroller performs the reset.

    Best regards

    Tamas 

  • Tamas,

    yes it is possible for application to call back the ROM loaders, you would need to know where the symbols are present in the device ROM. ROM symbols library for your device can be found in controlSuite at C:\ti\controlSUITE\libs\utilities\boot_rom\F28M36x

    you will have to do below in the application, while including the ROM API symbols library in the project.

    if(UART0 BOOT) // this will start the serial boot on the device

    {

    ConfigureDevice();    

    PickInterface();    

    Update();

    }

    else if (Ethernet)  // this will start the EMAC boot.

    {

       EnetConfig();    

       SelectEnet();

       Update(); 

    }

     

    Now while calling the ROM functions from application the stack is as set by the application. I would suggest first to test this and see if the application works fine because you need to be careful of where the application is running from and where the new application image is being downloaded at...things like that.

    if you go through the other route of resetting and setting the boot mode pins for FW upgrade you wouldn't have to worry about the above.

     

    Best Regards

    Santosh

     

  • Tamas,

    also refer to the boot ROM chapter in the device TRM to be aware of the device boot modes, IOs used, reserved RAM/Flash/OTP locations.

    Best Regards

    Santosh

     

  • Santosh,

    Your answer was quite helpful. However, I have problems with adding mbootROM_BootROMSymbols.lib to my project. Its format is in COFF but my project use ELF libraries. Does this library available in ELF as well? Or do you have any idea regarding to this linking issue?

    Best regards

    Tamas

  • Tamas,

    could you post the error from console, would you be able to make your project to build COFF file instead of ELF?

    Best Regards

    santosh

  • Santosh,

    I used just an example project (enet_lwip)

    The first build error I have received:

    <Linking>
    "C:\\Users\\markust\\AppData\\Local\\Temp\\029963", line 25: fatal error:

       object files have incompatible formats
    >> Compilation failure
       ("../mbootROM_BootROMSymbols.lib<F28M36x_REVA_M3_bootROM_Master__out_EnetCon
       fig_tmp.obj>" = TI-COFF, "./ustdlib.obj" = ELF)

    Then I changed the output format of the project to COFF and I bumped into the following error due to the lwip.cmd:
    <Linking>
    error: --retain=g_pfnVectors not supported when producing TI-COFF output files

    Do you have any idea?

    Best regards

    Tamas

  • Tamas,

    put back the output to generate ELF as it was before and use the attached symbols.lib instead of the one from controlsuite.

    I believe I missed the " --abi=eabi" compiler option while generating the symbols library. Apologize for the confusion, I will get the controlSuite updated for proper lib files in the next release

    3660.mbootROM_BootROMSymbols.lib

     

  • Santosh,

    Thank you for the attached library. Finally, I could build my project with it. However, I had to configure the link order because I also use driverlib.lib and some names were redefined in the ROMBoot.lib.

    I have tried the following code in the enet_lwip project:

    if(EMAC_UPDATE_CMD_RECEIVED)
    { 
        EnetConfig();
        SelectEnet();
        Update();
    }

    I was just monitoring the network traffic and waiting for a BOOTP broadcast message, but it didn't arrive.
    The enet_lwip is running from the Flash. Do you have any idea why doesn't it behave as I expect?

    BR
    Tamas

  • Tamas,

    Hmm...could you let the device boot into the default ROM EMAC boot mode and observe the network traffic? Make sure you have widows firewall or antivirus disabled so the packets wont be dropped by these.

     

    Best Regards

    santosh

     

  • Santosh,

    When I use the boot mode selection pins and set them to boot from Ethernet interface I receive broadcast messages from the MCU on port BOOTP. So I think, that my firewall is not a problem.
    Unfortunately, I can't really debug the program because I can't step over the SelectEnet() function.

    Best regards,

    Tamas

  • Tamas,

    thanks...for checking that. Other thing is that in your app, did you make sure you have reserved the boot ROM reserved RAM as mentioned in the device TRM? The functions use some global variables for the state machine.

    Can you check if your company is under NDA with TI, the ROM sources for F28M36x are currently being released only for customers who are under NDA. We are working towards releasing ROM sources for mass market but it will take some time.

     

    Best regards

    Santosh

     

  • also make sure you do the call back to ROM handlers before you do any other system initialization (like PLL or other clock configurations). Boot ROM assumes the M3SYSDIVSEL is at /1 and PLL is bypassed so EMAC is configured assuming the clock is 20 MHz.

    Best Regards

    Santosh

     

  • Hi Santosh,

    Unfortunately, the EMAC boot still doesn't work.

    Now, I placed the three EMAC boot ROM library function at the beginning of the main function. So I don't do any system initialization. But I also tried with initializing the clock to bypass PLL and M3SYSDIVSEL at /1. I have changed the BOOT_RSVD and C2 memory sections in the cmd file.:

        RESETISR (RX)    : origin = 0x00200030, length = 0x0008
        INTVECS (RX)     : origin = 0x00201000, length = 0x0258
        FLASHLOAD (RX)   : origin = 0x00201258, length = 0x2D58
        FLASH (RX)       : origin = 0x00204000, length = 0x7BFD0   
         C0 (RWX)         : origin = 0x20000000, length = 0x2000
        C1 (RWX)         : origin = 0x20002000, length = 0x2000
        BOOT_RSVD (RX)   : origin = 0x20004000, length = 0x0584
        C2 (RWX)         : origin = 0x20004584, length = 0x037C

    However, I think that to see the BOOTP broadcast messages, the correct MEMORY configuration is not really required because the RAM writing just starts after somebody has responded to these messages. Is it correct?

    I am waiting for the answer regarding the NDA. If we don't have, could you please give me a contact where can we ask for one?

    Thank you in advance!

    Best regards,
    Tamas

  • Tamas,

     

    what is the bootROM version that you have on the device (32 bit value at location 0x01000258)? I'll try to reproduce the problem on my desk as well and let you know.

    But get me the ROM version you have on your device, the ROM changed between REV0 and REVA, so lets make sure incase you have any REV0 devices, which aren't shipping anymore.

     

    Best Regards

    Santosh

  • Tamas,

    which EMAC Boot mode your are trying 0x4 or 0xC? If you are using the GPIO used in boot mode 0x4, then you would need to initialize another global variable in bootROM reserved RAM before calling the EnetConfig function in ROM.

    0x20004534 is the location which stores mbrom_bmode variable, this must be initialized to 0x4 or 0xC depending on the EMAC boot mode GPIO you use to boot.

    #define ROM_EnetConfig (void (*)(void))(0x01001bc1)

    #define ROM_SelectEnet (void (*)(void))(0x01006641)

    #define ROM_Update (void (*)(void))(0x01000bf9)

    #define Boot_mode_var_used_by_rom *(volatile unsigned long*)0x20004534

    Note that above addresses are for REVA and beyond.

     

    also note that the PLL configs are not reset by a debugger reset, but only by XRSn. So make sure you debug after an XRSn or power up if you have previously used PLL. if you have some application in flash which configures PLL and the device is set to boot-to-flash, by the time you connect debugger the application must have already run after the power up so make sure you erase flash before you debug this code. If you are running this test from flash then that's fine.

     

    Best Regards

    Santosh

     

  • Santosh,

    The BootRom version:

    • Revision No = 0x0100
    • Release Date = 0x1211

    My device is REV0. Thus, as you mentioned, the above defined functions won't work in my case. However, EnetConfig(), SelectEnet() and Update() functions from bootROM library should work on REV0 devices as well. Am I right?

    I have tried both the 0x4 and 0xC boot mode, but when I start the device with 0x4 configured GPIOs the BOOTP broadcasting doesn't work at all. Maybe it is just a special case because I use cCard.

    And I always run my tests from Flash to avoid the chance of misconfigured clock frequency.

    Best regards

    Tamas

  • Tamas,

    yes that's REV0.

    The ROM symbols changed between REV0 and REVA. Attached is the REV0 M-BootROM symbols library, the symbols are at

    0x01006539   SelectEnet

    0x01001bc1   EnetConfig

    0x01000bf9   Update

    0x20004534   mbrom_bmode

     

    Try with these symbols, with bootmode 0x4 and 0xC.

    4213.mbootROM_BootROMSymbols_REV0.lib

     

    Best Regards

    Santosh

  • Hi Santosh,

    Now the EMAC boot works great with this library. Thank you very much for your help!

    Best regards

    Tamas

  • Tamas,

    thanks. Just remember to switch back to REVA ROM symbol library on the production silicon. You probably have a control card from early on.

     

    Best Regards

    santosh