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.

UART BOOTLOADER SOLUTION FOR TMS570LS3137

Other Parts Discussed in Thread: TMS570LS3137

I'm using Tms570ls3137 ,the boot loader code for this got struck at this point while 

Hyper-terminal-->send file-->example.bin  + ymodem--->send

It shows error something like  "No response from remote computer"


while I'm using flash API  2.01.01 and CCS 6.1.0


I think the flash program is not working. please, reply me soon 

  • Hi Saif,

     Did you have a chance to follow the UART bootloader app note here?

  • Hello Charles,

    Thanks for your reply, I'm following the same guide.

    this code halts at this point,

    while(FAPI_GET_FSM_STATUS != Fapi_Status_Success);

    and terminal displays "no response from remote system"

    looking forward to your reply
  • So what is the value of FAPI_GET_FSM_STATUS ?

    The FAPI_GET_FSM_STATUS is the FMSTAT register at 0xFFF87054.
  • Hello Charles,

    As per your guidance
    FMSTAT register at 0xFFF87054 is getting this value

    FAPI_GET_FSM_STATUS =00000818

    so that it's looping at this point --> while(FAPI_GET_FSM_STATUS != Fapi_Status_Success);

    I inspected that status bits for VOLSTAT, CSTAT ,PCV are high.

    I also tried to issue clear status command using Fapi_issueAsyncCommand(Fapi_ClearStatus);
    but it's just skipping and problem remains the same.
    Am I missing something?

    do i need to use Fapi_flushPipeline();

    Thank you and waiting for your reply.
  • Hi Saif,
    Do you have custom board or you are using an EVM board like the HDK or the Launchpad? If you have your own board please check the power supply (the VCCP pin) to the flash. Do you have 3.3V connected to VCCP pin?
  • Hello Charles,

    I have my own HDK with TMS570LS3137 ZWT package mounted on it .
    I checked for voltage at VCCP pin for flash it takes 3.32V I think that is fine.

    Then why Flash Api is not getting initialized properly? I inspect some conditions please take a look

    I'm loading bootloader code to bank0 (sectors 0-3) and while running Flash api in Ram
    and trying to erase/program from address 0x00020000 i.e, sector 4

    As from the Guide the bootloader should executes at VCLK = 40 MHz so I give SYS_CLK_FREQ=160 with Rwait=3
    Is it proper?

    (1)All FPI21 functions are returning status =4
    i.e, Fapi_Error_NullPointer /* One of the pointer parameters is a null pointer */

    still FAPI_GET_FSM_STATUS =00000818
    what does it mean?

    (2)Do i have to use any initialization sequence (or) User defined functions like Fapi_serviceWatchdogTimer();

    (3)and then one more thing is there any ymodem binary file transfer specifications
    because it's receiving binary image successfully but unable to send (or) download image to flash.

    I appreciate your guidance Charles
    Thank you and looking forward to your answer.
  • Your clock setting is correct with Rwait=3 for SYS_CLK_FREQ=160.

    Are you using the UART bootloader example provided in the app note?

    I've just tried it myself and I do find one inconsistency between the app note and the actual bootloader. In the app note it says the application will start at 0x00020000 and the magic word at 0x7FF0. However, in the bl_config.h they are defined different. They are define as follows.

    #define APP_START_ADDRESS 0x00010100
    #define APP_STATUS_ADDRESS 0x00010000

    Please make sure in the linker command file for your application the starting address starts at 0x10100 and not 0x20000. I modified my application linker command file to 0x10100 and it is working properly. You will change the memory directive in the linker file to something like below:

    VECTORS (X) : origin=0x00010100 length=0x00000020
    FLASH0 (RX) : origin=0x00010130 length=0x0016FED0
    FLASH1 (RX) : origin=0x00180000 length=0x00180000
    STACKS (RW) : origin=0x08000000 length=0x00001500
    RAM (RW) : origin=0x08001500 length=0x0003EB00
  • Hello Charles,

    I make changes as you guided with little difference

    because for this program APP_START_ADDRESS has to be address of sector first address.

    Now what I'm doing is loading bootloader to flash bank 0 and application code has to go to bank 1

    #define APP_START_ADDRESS     0x00180000
    #define APP_STATUS_ADDRESS  0x00260000            //magic word

    please verify i have attached files below

    application code  led_blink.cmd  memory allocations

    MEMORY
    {
        VECTORS (X)  : origin=0x00180000 length=0x00000020
        FLASH1  (RX) : origin=0x00180020 length=0x0017FFE0
        STACKS  (RW) : origin=0x08000000 length=0x00001500
        RAM     (RW) : origin=0x08001500 length=0x0002EB00
    }


    so where I'm actually getting stuck is now FSM_STATUS=0x11

    i.e   SLOCK  --> Sector Lock Status

    CSTAT -->commad status

    (1)How to select sectors i have sector 0-11 in bank 1

    Fapi_enableMainBankSectors(0xFFFE);    //how you decide this value because 0x0FFF doesn't work

    how to unlock the sectors for erase/program??


    (2)Do i need to add flash fpi21  .obj files to bl_link.cmd??

    I'm using bootloader package-- SafetyMCU_Bootloader_2015-07-09


    Thank you and waiting for your response

  • Hello,

     You are mapping the APP_STATUS_ADDRESS  to bank1. Is there any reason you want this address to be in bank1? Unless it is already working for you, I will suggest you change to an address in bank0 for the status.  Other than that, I don't see a problem with your led_link.cmd

     Since you are starting your application in bank1 sector 0 you need to make sure the sector 0 is not locked. You should call Fapi_enableMainBankSectors(0xFFFF); And also make sure you have select bank1 as your active bank using the Fapi_setActiveFlashBank() API.

     Where did you download SafetyMCU_Bootloader_2015-07-09?

     I downloaded the bootloader example from which is a link embedded inside the appnote at . If you use this app note and the attached collateral then the example bl_link.cmd is already provided for you.  See below again where the bl_flash.obj is being mapped using the SECTIONS directive. I will suggest you use the exising bootloader example as is and see if you are able to download a simple LED application to the flash. Once everything works, you can move your application to 0x180000 or do additional customization. 

    --retain="*(.intvecs)"
    
    
    MEMORY
    {
        VECTORS    (X)   : origin=0x00000000 length=0x00000020
        FLASH_API  (RX)  : origin=0x00000020 length=0x000014E0
        FLASH0     (RX)  : origin=0x00001500 length=0x002FEB00   //LS31x and RM48 Flash size is 0x300000
        SRAM       (RW)  : origin=0x08002000 length=0x0002D000
        STACK      (RW)  : origin=0x08000000 length=0x00002000
    }
    SECTIONS
    {
       .intvecs : {} > VECTORS
       flashAPI :
       {
         Fapi_UserDefinedFunctions.obj (.text)
         bl_flash.obj (.text)
         --library= ..\..\..\lib\F021_API_CortexR4_BE.lib (.text)
       } load = FLASH_API, run = SRAM, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size)
    
       .text  > FLASH0
       .const > FLASH0
       .cinit > FLASH0
       .pinit > FLASH0
       .data  > SRAM
       .bss   > SRAM
    }
    

  • Thaank you Charles,

    Its working now and I really appreciate your guidance.
  • Glad your problem is solved.