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.

Starterware/LAUNCHXL2-570LC43: LAUNCHXL2-570LC43

Part Number: LAUNCHXL2-570LC43
Other Parts Discussed in Thread: TMS570LC4357, TMS570LS3137

Tool/software: Starterware

Hi,

I am using TMS570LC4357 Launch pad and  implement Ethernet boot loader where my application is in Flash bank1

from the location 0x00200000 for this i made some changes in sys link cmd in application project and Application code

having only sci  and some gpio, in this case application is working fine even though the system get restart the application runs properly,

but when application is included with LWIP_Init then the  application get struck after 200 odd cycle.   

Application project

/* USER CODE BEGIN (0) */
#include "lwip/udp.h"
#include "lwip/ip_addr.h"
#include "HL_sci.h"
#include "HL_reg_sci.h"
#include "HL_gio.h"
#include "ti_fee.h"
#include "lwiplib.h"

#include "HL_sys_common.h"

extern void EMAC_LwIP_Main (uint8_t * emacAddress);
extern void gioInit();
void Debug_Display_Val(unsigned int);
void sciDisplayText (sciBASE_t *sci, uint8_t *text,uint32_t length);
struct udp_pcb *pcb;

struct ip_addr ipaddr, netmask, gw,Src,Dst;
unsigned short PORT_NO=7000;

uint8 emacAddress[6U] = {0x00U, 0x08U, 0xEEU, 0x03U, 0xA6U, 0x6CU};

uint32 emacPhyAddress = 1U;

int main(void)
{

uint32 Ip_addr=0xC0A8000C,Gatway=0xC0A80001,Net_Mask=0xFFFFFF00;/* Initialize RAM array.*/

gioInit();

IP4_ADDR(&Src, 192, 168, 0, 12);
IP4_ADDR(&Dst, 192, 168, 0, 10);
IP4_ADDR(&netmask, 255, 255, 255, 0);
IP4_ADDR(&gw, 192, 168, 0, 1);

//EMAC_LwIP_Main(emacAddress);

lwIPInit(0,emacAddress,Ip_addr ,Net_Mask,Gatway,IPADDR_USE_STATIC); //if comment this lwip init apllication will run properly or else it get struck after 200 or odd cycles  

while(1)

{

sciDisplayText(sciREG1,(uint8_t *)"Testing serial==", sizeof("Testing serial=="));
sciDisplayText(sciREG1,(uint8_t *)"\r \n", sizeof("\r \n"));

}

}

changes in sys link cmd

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

So please help me to resolve this problem if you want i will attach both boot loader and application code 

  • Dear Bob,

    Ethernet application works when application code programmed through jtag (XDS110).but if application code programmed through the Erhernet boot loader it get struck after some time.

    So if i comment memp_init() fuction  in lwip_init(),the application wont get struck but ethernet wont work it seems like there must be some memory related problem so can you tell me the exact reason for this problem  

  • Dear Bob,

        My application is running in flash bank 1 and i wanted to store some data in same bank so how can i read and write same bank through  my application  

  • You cannot program flash in the same bank as you are executing from. Consider storing data in bank 7. Otherwise the routines to program data into bank 1 must be in bank 0 or executed from RAM.
  • Dear Bob,

    I tried to write the some format in bank 7 through the ti fee function while my application is bank 1 in that case application is getting struck after some cycles so is there any option.
    actually i wanted to write one format in any of the one location(one address) to check the condition that during power on or hard reset the boot loader has to wait for application code to dump or directly start with defined address so how can i do this.
  • While it is possible to use the FEE driver to write a single value to bank 7, you do not get to define it to a specific address. In this case you can just use the F021 Flash API functions to program that location.  The flowchart for programming is here. I suggest you program a 64-bit location (8-bytes) using the "Fapi_AutoEccGeneration" mode.

  • Dear Bob,
    Now I can able to write in flash bank 7 and required logic is working fine.Now i can able to dump application bin file through boot loader and its working, but if i modify the application and generate bin and try to dump it then it gets struck in Fapi_BlockProgram function to resolve this again i need to program boot loader and try to dump the application so can you tell me the exact reason for it
  • There is not Fapi_BlockProgram function in v2.01.01 of the F021 Flash API. Is this a function you wrote?

  • Hi Bob,

    while writing application in flash application is getting struck in Fapi_issueProgrammingCommand fuction.

     I have uploaded the project please try it in tms570lc4357 launch pad and give some solution because project is in development stage we have

    to finalize the processor if all goes well it will be in consider as regular product or we have to think about some other make processors.     

    /cfs-file/__key/communityserver-discussions-components-files/312/6014.BOOT_5F00_APP.rar

  • Hi Bob,

    Have you tested the attached application?

    waiting for your response

  • Sunil,

    Apologies for the delays but Bob has had to take an unexpected emergency leave. In the meantime, I will locate another person to see if they can provide some assistance.
  • Hi chuck,

    try to implement attached boot loader code with TMS570LC4357 launchpad and check its urgent.
  • Hello Sunil,

    Unfortunately, I do not have the resources to run the application at the moment so I can only offer some suggestions. In your prior posts you indicated that you believe the issue to be memory related. Can you review your cache settings? The original boot loader application notes and examples are written using a non-cache device but the one you are using has cache. This is a significant change that could be affecting if data is actually written to the locations that you believe they should be. This might also explain the differences between the performance when programmed by boot loader vs external programmer. I would recommend insuring that the cache was disabled (write through) during boot loader operation in order to mimic the same operation as an external programmer. The cache configurations are included in the MPU of the device.
  • Hi chuck,

    do you have any proven boot loader application example for TMS570LC4357 launch pad.

    i downloaded boot application for TMS570LS3137 for ti forum similarly is there any example code for TMS570LC4357.  

  • Hello Sunil,

    I have uart bootloader for RM57. RM57 and TM570LC4357 have same package, architecture, flash, SRAM, but different endianess.  

    1440.RM57_uart_boot.zip

  • Hi QJ Wang,
    At this moment i cant change the design, i cant divert to uart boot loader because our hardware is finessed for Ethernet and designed,so please try the boot loader application which i was attached earlier its too urgent.using that application i can able to download same bin file as many as time but if i change the bin file then i cant able to program the application.
  • Hello Sunil,

    You can not erase/program a sector in Bank0 using the code and API running in the same bank (bank0). You need copy your flash erase/program related code and flash API to another flash Bank or SRAM, and execute flash erase/program from other bank or SRAM.
  • Hello Sunil,

    Just read your code:
    1. The clock you used to initialize the flash bank is 100Mhz. But your system clock is 300MHz. System clock frequency should be used in Fapi_initializeFlashBanks(...)

    2. LC4357 has 32 sectors in Bank7, your code tries to enable unimplemented sectors (63..32)
  • Hi,

    In my boot loader application i am not erasing bank 0, i am erasing bank 1 and writing application in bank 1 only. 

  • Hello Sunil,

    The clock you used to initialize the flash bank is 100Mhz. But your system clock is 300MHz. System clock frequency should be used in Fapi_initializeFlashBanks(...)
  • Hi Wang,

    It wont work for 300MHz frequency so I kept system clock frequency to 150MHz 

  • Hi Wang,

    I am suffering with this problem for past 2 month even I have sent boot loader code to you so please try it with TMS570LC4357 launch pad so you can get the exact problem that we are facing.
  • Hi Wang,

    The problem I am facing is,after dumping boot loader code I can able to dump application binary file in flash bank 1 and application runs properly then if I modify the application and generate the binary file and again try to dump then application gets struck but if I put previous application bin file again then it get dumped, so to dump modified application binary file I need to dump boot loader code again.     

  • Hello Sunil,

    So my understanding is:

    1. Program Bootloader to flash bank0 through JTAG  -- work

    2. Program original Application binary to flash bank1 through Bootloader  -- work

    3. program the updated Application binary to flash bank1 through  bootloader  -- fail

    4. Re-Program original Application binary to flash bank1 through bootlader -- work

    5. Re-program bootloader to bank0, then program the updated application binary to bank1 through bootloader -- work

    What is the difference between the original application and the updated application? Did you modify the cmd file? 

  • Hi Wang,

    yes Exactly same,i am not modified any cmd file in updated application i will just comment any of the condition in my application or will add any of the condition in my application that's it.   

  • Hello Sunil,

    Can you please list the differences between the original application and the updated application? I could not figure out your modifications from your project (source TFTP).
  • Hi Wang,

    i am just changing the text message which is sending through the serial port and generate the binary file.

    for example in first Binary file i am sending  sciDisplayText(sciREG1,(uint8_t *)"Boot testBin==", sizeof("Boot testBin==")) and in second bin file sending

    sciDisplayText(sciREG1,(uint8_t *)"Boot testBinary==", sizeof("Boot testBinary==")) .there wont be any other changes in source.

    even you can add any logic in application or remove logic from application and try tu put it doesn't work  

  • Hi wang,

    Any updates about the query?

  • Hi Wang,

    Waiting for your reply.
  • Hi Wang,
    we are running with very short time with this issue so please give some feedback
  • Hi Wang,
    I dint get any response from e2e from past 15 days,we are loosing hopes with your support.
  • Hello Sunil,

    I am sorry for delayed response. Can I have your latest CCS project? and tell me how to do the test on my bench including the tools used on window PC to TX application image to the bootloader. I'd like to run your code on my launchpad, it might help me understanding your issue. Thanks
  • Hi Wang,

    I have attached RAR file which included with boot loader and application project with used tool and procedure of testing.    

    2251.BOOT_LOAD.rarHi Wang,

  • hi wang,
    please find the attached file in previous message and let me know if you need more detail
  • Thanks You Sunil, I will take a look, and come back to you next week.
  • Hello Sunil,

    I tested the boatloader itself, it works on and the application image is programmed into the flash bank1.

    The code gets stuck somewhere, I didn't get the display of "BOOT BIN1=xxx".

    I checked the CP15 registers, the value in data fault and instruction fault registers: 0x00001008 which is a synchronous external abort. It is a software error that a store instruction occurred to an unmapped memory address.

  • Hi wang,

    After programming application image you just restart the launch pad so application gets run and you can get the data from SCI1 debug port of launchpad with the baud rate of 9600.

    I have attached 2 application binary file you just program application image  BIN1 after programming boot loader image and restart the launch pad then application gets run then follow the the procedure which i have given earlier to program the application image BIN2.        

    6011.BIN1.rar1803.BIN2.rar

  • Hi wang,

    You just remove below IF statement in boot loader code, which is in line 124 of HL_sys_main.c and program boot loader application through JTAG.

    if(( (*(uint8_t *)0xF0200000) == 0xAA) || ( (* (uint8_t*)(APP_START_ADDRESS+1)) == 0xFF))


    1. program BIN1 application image through tftp64 then application gets program in flash bank 1.
    2. Restart the launch pad then again try to program BIN2 application image through tftp64 then it get stuck while programming
    3. Again restart the launch pad and try to program BIN1 application image then it get program in flash bank 1.
  • Hello Sunil,

    This is a different question. Can you start another thread? Otherwise, I have to scroll down pages to read your latest post.

    This is my test:

    1. Program the bootloader

    2. Start the bootloader + TeraTerm + tftp32 (or 64)

    3. Download BIN1 to bank1 without any problem

    4. Re-start bootloader, download BIN2 with tftp32, and got a timeout problem as below:

    5. Re-start the bootloader, and program BIN1 again, I did not see any problem. 

    What are the differences between BIN1 and BIN2?

  • Hi Wang,

    i just added some logic related with my application there wont be any much difference between both BIN.

    the problem is same what i told earlier and telling now. i am just trying to simplify for better understanding.

    for your reference you can also add some logic in source TFTP application code which i have given and generate BIN and just modify the source application simply by adding logic or removing logic in application code and generate bin so both generated bin you can program through the above procedure in that the bin you put after boot loader program will dump but the bin which you put second time will get time out.     

     In above test you programmed BIN1 in flash 1 and while trying to program BIN2 you will get time out so if you do reverse i mean first you put BIN2 and then you try to put BIN1 then time out appear while putting BIN1.   

  • Hello Sunil,

    I repeated re-programming BIN1 through bootloader several times, didn't see the problem so far. 

  • Hi Wang,

    After Boot loader program through JTAG you can program any BIN(BIN1 or BIN2),there wont be any problem.but once you program BIN1  then you cant program BIN2. If you program BIN2 then you cant program BIN1 .but  same BIN can be program repeatedly.  

  • Hi Wang,

    Thanks for your support the problem is resolved.
  • Hello Sunil,

    How did you solve the problem?
  • Hi Wang,
    There is issue with sector erase in boot loader application so i just inter change the sector erase with bank erase.