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.

Erasing and Writing flash in TMS570LS3137

Other Parts Discussed in Thread: TMS570LS3137

Hi,

     It is sad to tell that we are not getting any kind of reply for our post from past one or two wks. Now i am regretting for choosing Texas uc . we have been putting a quires and not getting any replies.

My query was regarding Flash erasing and Writing into the flash . We are trying to write into flash in the processing of doing that we controller is not able to come out after entering in to the flash write function ie the processor is getting hanged .

My one more query was can a application program call boot-loader program ?  

  • Abhijith,

    I'm sorry if we didn't reply in time to your question.

    Concerning Flash programming and bootloader question, there are a lot of detailed thread talking about these subjects.

    If you are using our bootloader example, you can force a software reset from your application. This will force the device to re-boot and re-start the bootloader.
    What the bootloader checks is either the state of a GIO pin (by default GIOA7) to see if there is a need to force a new download or if there is no application code already programmed in the device.

    Please let me know if this is what you are looking for.

  • Dear Jean ,

                          Thank You for your reply.

    I will try to explain the exact scenario , We are using TMS570LS3137 in a control unit where there will be four micro controllers in different places and all the micro controllers will be connected to one Ethernet switch. Ethernet is the only media connected to the  micro controllers in vehicle control unit . Here if i want to change my application in micro controllers i have to do it through Ethernet .

            What we have done is we are sending one command through Ethernet (Tcip) after receiving the required command, application will write a known pattern in a pre defined memory address in  BANK1 , and boot loader is modified to check that pre defined address BANK1 and depending on the data there boot loader will decide whether to run application or to wait for a new application program . Is this a correct method or is there any better method?.

    In this we tried to erase the application program in flash through application itself, we were not successful in doing so. So we decided that we will write a pre-defined pattern in other BANK in flash. Here the issue is when we combine this logic with Ethernet program our controller is getting hanged in side the Flash operation ie(One flash operation is called it will not come back and do the remaining code ). What might be the issue?.

    I am attaching the zip file of our project . Awaiting for your quick reply.

    Thanks & Regards

    Abhijith Raghavendra

  • Dear Jean ,

                          Thank You for your reply.

    I will try to explain the exact scenario , We are using TMS570LS3137 in a control unit where there will be four micro controllers in different places and all the micro controllers will be connected to one Ethernet switch. Ethernet is the only media connected to the  micro controllers in vehicle control unit . Here if i want to change my application in micro controllers i have to do it through Ethernet .

            What we have done is we are sending one command through Ethernet (Tcip) after receiving the required command, application will write a known pattern in a pre defined memory address in  BANK1 , and boot loader is modified to check that pre defined address BANK1 and depending on the data there boot loader will decide whether to run application or to wait for a new application program . Is this a correct method or is there any better method?.

    In this we tried to erase the application program in flash through application itself, we were not successful in doing so. So we decided that we will write a pre-defined pattern in other BANK in flash. Here the issue is when we combine this logic with Ethernet program our controller is getting hanged in side the Flash operation ie(One flash operation is called it will not come back and do the remaining code ). What might be the issue?.

    I am attaching the zip file of our project . Awaiting for your quick reply.

    Thanks & Regards

    Abhijith Raghavendra3581.ETH_Demo2.rar

  • Abhijith,

    I'm looking at your code and I'm trying to run in on my HDK board.

    Can you tell me the Serial Terminal configuration?

    Also, which utility do you use to send command to the device via Ethernet?
    If I'm correct you are using a fix IP address. What is this default IP address?
    I may have to build using Dynamic IP.

  • Jean,

             Terminal configuration is .

    Baud Rate : 115200

    Data :8 bit

    Parity:none

    stop bit : 1

    I have used TCIP Protocol to send command . if you send "close" from client  the required operation will be done.

    Thanks & Regards

    Abhijith

  • Abhijith,

    I better understand your configuration, but still can't make it run on my setup.

    So let me explain what you could do.

    You have to have an Ethernet boot loader on your part.
    After power on, the bootloader will check if there is valid application code already programmed or if there is a need to overwrite the application code with a new one. To do so, you can use any option you want. (Specific data programmed at a specific location in Flash, IO pin....)

    If there is no application code, than the download and programing will be done by the bootloader.

    If an application code is already in flash and there is no need to update the application than the bootloader will jump to your application and run it.

    During application run, a command to update the application is received. Within the application, it will be necessary to program in flash the specific data that the bootloader will check. As we explain, all Flash API code has to run from RAM or the application has to run from one bank while the other one is accessed by the flash API. It is also recommended to disable interrupt, unless you are 100% sure that your service routine will not break the previous rule.

    Once the specific Data Key is programmed, your application will have to shutdown, and a software reset will be performed.

    At that point the device will reboot to the bootloader, check for the key, found that there is a need to update the application and reprocess a full update.
    When the update is done, the bootloader will start your application. Update Done.

  • Jean,

             Yes i understand what you are telling . I will tell what exactly we tried to do , our setup is like this.

    We tried to incorporate TCP-IP communication between our application  and the host machine (Laptop used for programming), after receiving a particular command (e.g "close" in our application which i have sent to you) the application will write a byte (0x55) in the address 0x1A0000 which falls in BANK1 . In Boot-Loader i am doing nothing than checking the particular address (i.e 0x1A0000) if there is 0x55 data then Boot-Loader will go into program receiving mode once the program is downloaded 0x1A0000 is cleared , so that in successive rebooting the valid application to run directly.

    Here i would like to tell is we tried this method because we were not able to erase the application program which is in flash by the same application that is why we are trying this alternative method. And regarding reseting the application once a request for programming is received is done through a small circuit which will be controlled by  application  through GPIO pin.

    I have few doubts that if your Boot Loader can erase a flash where Boot-Loader is present then why we are not able to do the same . i want to ask you that what ever method we are trying will work?. 

    Is it necessary to take all the Tx and Rx from TCP-IP or UDP through interrupt ?. Can you get me one small example where UDP socket sending and receiving data .

    Thanks & Regards.

    Abhijith Raghavendra .