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.

TMS570LC4357: Ethernet bootloader

Part Number: TMS570LC4357
Other Parts Discussed in Thread: UNIFLASH

Hi E2E,

I am facing a unique problem,

I am using TMS570LC4357. I want to have a Ethernet Bootloader for this controller. I've found one ethernet bootloader based on TFTP Protocol.

And i'm able to load the bootloader and application program & works fine, not an issue.

The bootloader is configured to bank0 & my application in bank1.

the problem is when i edit my application program & try to load through tftp ,the application doesn't load it gets stuck at Fapi_BlockProgram function, but when i revert the changes and load the appliction it loads.

The functionality of project is 

1. load the bootloader - u will get a command saying (program flash) in serial debug

2. load the application program through TFTP (.bin file)

TFTP config -  ipaddr - 192.168.0.2

port - 69

3. send a command - erase  through sockettest & restart the launchpad u will get to step 1

socket test config UDP client - 192.168.0.12

port - 7000

I have attached my bootloader project & application project , Please help.

8360.BOOTLOADER.rar5148.Source_TFTP.rar

  • Hello Shanmukh,

    Please refer to the identical thread from your associate at this link: e2e.ti.com/.../2321379

    We have provided a working example of a boot loader using the TMS570LC4357 that is based on UART. This code/example can be adapted to your ethernet based boot loader by replacing the communication layers of the example with the communication algorithms of your custom code. Likewise, you could use the examples programming/command response portion of the code to integrate the same programming/data flow functions in your code.

    We do not have a direct example using the Ethernet port within a boot loader program.
  • Hi Chuck,
    I have tried what you had suggested, that didn't solve my problem.

    Is it possible to load bootloader and application program to same bank i.e, active bank (bank0).
    Could you send me an example of how do i achieve this ?
  • Shanmuth,

    Again, I apologize for the delayed response. We have been tied up with some internal trainings and not able to respond.

    Our device architecture does no allow programming to the same bank from which you are executing. i.e., if you are executing your boot loader from Bank 0, you may not load your application also to bank 0. The only way to achieve this would be to switch program execution to RAM and run from RAM. Then you would need to reprogram bank 0. Care must be taken to preserve your boot loader in this case and to also make sure the execution doesn't still branch back to or reference Bank 0 locations at all while executing from RAM. The danger in this is that you could result in a damaged part if you only get bank 0 partially programmed due to a power loss or RAM ECC error, or any event causing the programming to be interrupted.

    In regard to the example program provided, were you able to run it in UART mode at all? i.e., can you check that it is working properly without the introduction of the ethernet code/stack. Also to be certain I understand, the code works per normal use of programming the entire application (boot loader + application code) via CCS or Uniflash (or other external programmer), but when you go into the boot loader programming mode, it gets stuck at the call to the prescribed BlockWrite function. Correct?

    Have you checked permissions? Have you been able to determine what line it is hanging on? Can you tell if any blocks are programmed at all or if it is only the first one that hangs? What Ethernet stack are you using? LwiP which is open source?
  • Hi Chuck,

    I am able to load Bootloader & Application to BANK0.
    The problem is I want to use ethernet in my application so when I initilise "EMAC_LwIP_Main(emacAddress);" - it is getting stuck at this line "netif_set_up(&hdkNetIF[instNum]);" within this at this line "etharp_gratuitous(netif);"

    But When I run my application without the Bootloader it works fine there is no issue.

    Can you help me to get this resolved ?

  • Hi
    Please someone can respond, this is very urgent . I need to solve this problem
  • Hello Shanmukh,

    The memory section in link.cmd needs to be modified for application:

    VECTORS (X) : origin=0x0000xxxx length=0x00000020 --> xxxx is the starting address of your application
  • Hi Wang,
    Thank you for the reply.
    The memory section in my Bootloader is :

    VECTORS (X) : origin=0x00000000 length=0x00000020
    FLASH0 (RX) : origin=0x00000020 length=0x001FFFE0
    FLASH1 (RX) : origin=0x00200000 length=0x00200000
    STACKS (RW) : origin=0x08000000 length=0x00001500
    RAM (RW) : origin=0x08001500 length=0x0002EB00

    USER CODE END */
    .intvecs : {} > VECTORS
    .text align(32) : {} > FLASH0
    .const align(32) : {} > FLASH0
    .cinit align(32) : {} > FLASH0
    .pinit align(32) : {} > FLASH0
    .bss : {} > RAM
    .data : {} > RAM
    .sysmem : {} > RAM


    And my application memory is like this :

    VECTORS (X) : origin=0x00200000 length=0x00000020
    FLASH1 (RX) : origin=0x00200020 length=0x001FFFDF
    STACKS (RW) : origin=0x08000000 length=0x00008000
    HEAP (RW) : origin=0x08008000 length=0x00008000
    RAM (RW) : origin=0x08010000 length=0x00020000

    .intvecs : {} > VECTORS
    .text : {} > FLASH1
    .const : {} > FLASH1
    .cinit : {} > FLASH1
    .pinit : {} > FLASH1
    .bss : {} > RAM
    .data : {} > RAM
    .sysmem : {} > RAM


    Is this correct ? or are there any modifications ?

    System freq is 150Mhz.

    Even I tried to run by fetching bootloader to RAM using FlashAPI. Even this didn't solve the problem.

  • Dear e2e,

    Could someone help me with this problem, its been a month since I raised this issue, still the problem isn't solved. And i'm barely getting any replies.
    Its very urgent to get this solved as my design is already finalized and is in production. It would be a major problem if this issue isn't solved.
    Please someone could help to solve this issue, that would be of very great help.
  • Hello,

    The cmd file looks good. How about your settings in sys_intvecs.asm of bootloader project? The correct setrtings are:

    ;-------------------------------------------------------------------------------
    ; interrupt vectors
    ; Please change the #0x???? for your specified image location defined in bl_config.h

    b _c_int00 ;0x00
    b #0x1FFFF8 ;0x04; 0x1FFFF8=$200000-0x8; 0x200000 is the application start addr
    b #0x1FFFF8 ;0x08, Software interrupt
    b #0x1FFFF8 ;0x0C, Abort (prefetch)
    b #0x1FFFF8 ;0x10, Abort (data)
    reservedEntry
    b reservedEntry ;0x14
    ldr pc, [pc, #-0x1b0] ;0x18
    ldr pc, [pc, #-0x1b0] ;0x1C