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.

Concerning to the Hercules Safety MCU UART Bootloader

Other Parts Discussed in Thread: RM48L950

I tried uart bootloader on RM48-HDK.

My tested configuration was RM48-HDK + SafetyMCU_Bootloader_v1.2.0 + F021 Flash API 02.00.01.

Result was;

- Main Menu displayed

-> selected '1'

-> displayed 'C' character

-> clicked 'Transfer'

-> selected bin file

-> selected Ymodem

-> clicked transfer

holding...

I don't know reason.

Please provide uart bootloader normally running on RM48-HDK.

Regards,

Jongyong.

 

 

  • Yong,

    The RM48 bootloader can be found on this page:  http://processors.wiki.ti.com/index.php/RM48_HDK_Kit

    Look under the heading "HDK Bootloader Sample Code".

    Where did you get the bootloader that you mention in the post?

     

  • Hellow,

    I knew that site. That's version Hercules_UART_Bootloader_v1.0

    I tried that but it occur compile error. Beacuse F021_Flash_API version.

    That need F021_Flash_v1.5. But privide your site F021_Flash_v2.0.1(http://www.ti.com/tool/f021flashapi). mismatch!

    I'm found uart_bootloader v1.2 on TI's E2E Community. seaching... same problem.

    Today, I found same problem on TI's E2E Community(http://e2e.ti.com/support/microcontrollers/hercules/f/312/p/1061137/reply.aspx).

    "My code always loop   while(FAPI_GET_FSM_STATUS!= Fapi_Status_Success);"

    me too.

    Please provide normally run on RM48-HDK.

    Regards,

    Jongyong.

     

     

  • Hi Jongyong,

    I'll assign this to QJ who has written the bootloader then.   But in the meantime the resolution might have to be to clean up the compile error if he hasn't had time to update the bootloader.

    What is the compile error?   Many times these might be simple.

     

  • Hi Anthony,

    I hasn't F021 Flash API v1.5. Because not provide your site.

    The compile error was "#5 could not open source file "F021_FMC_LE.h" is undefined Fapi_UserDefinedFunctions.c /Hercules_RM48_UART_Bootloader/src line 20 C/C++ Problem".

    So, i tried to F021 Flash API v2.0.1(#include "Registers_FMC_LE.h").

    The compile error was "Description Resource Path Location Type
    #20 identifier "Fapi_StatusType" is undefined Fapi_UserDefinedFunctions.c /Hercules_RM48_UART_Bootloader/src line 20 C/C++ Problem", "Description Resource Path Location Type
    #20 identifier "Fapi_Status_Success" is undefined Fapi_UserDefinedFunctions.c /Hercules_RM48_UART_Bootloader/src line 24 C/C++ Problem", "Description Resource Path Location Type
    #20 identifier "Fapi_GlobalInit" is undefined Fapi_UserDefinedFunctions.c /Hercules_RM48_UART_Bootloader/src line 29 C/C++ Problem" and "Description Resource Path Location Type
    #20 identifier "uint32" is undefined bl_flash.c /Hercules_RM48_UART_Bootloader/src line 125 C/C++ Problem".

    Please reply.

    Regards,

    Jongyong.

  • Hi Jongyong,

    I am still debugging it with V2.0.1 API.

    Regards,

    QJ

  • Hello QJ and Jongyong,

    I have also been trying to run the UART Bootloader v1.0 on my RM48. I managed to get it to run with v2.0 of the Flash API. You need to replace includes for F021_FMC_LE.h with F021.h. I also had to remove the Fapi_setupEepromSectorEnable() and Fapi_setupBankSectorEnable() functions from Fapi_UserDefinedFunctions.c. Some other things you might need to do is to include stdint.h in F021.h and replace any uint32 types to uint32_t. My issue with the bootloader is that the controller always refuses to receive the .bin file HyperTeminal using the Ymodem protocol.

    Please keep us posted if you get it to work. Thanks!

    Regards,

    Yash 

  • Hello Yash,

    I'm tried.

    1. Hercules_UART_Bootloader_v1.0

    2. F021 Flash API v2.0

    3. Replaced #include "F021_FMC_LE.h" to #include "Registers_FMC_LE.h" within Fapi_UserDefinedFunctions.c, bl_dcan.c and bl_spi.c

    4. Removed Fapi_setupEepromSectorEnable() and Fapi_setupBankSectorEnable() functions within Fapi_UserDefinedFunctions.c

    5. Included stdint.h within F021.h

    6. Replaced uint32 type to uint32_t

    But, do not download to RM48HDK.

    I attached screen shot as below;

    7178.Screen shot.docx

    bin file was Hercules_RM48_Blinky_Example.

    RM48L950FlashLnk.cmd as below;

    /*----------------------------------------------------------------------------*/
    /* Linker Settings                                                            */
    --retain="*(.intvecs)"
    -heap 0x800

    /*----------------------------------------------------------------------------*/
    /* Memory Map                                                                 */
    MEMORY{
        VECTORS (X)  : origin=0x00020000 length=0x00000200
        FLASH0  (RX) : origin=0x00020200 length=0x0017FFE0
    /*    FLASH1  (RX) : origin=0x00180000 length=0x00180000*/
        STACKS  (RW) : origin=0x08000000 length=0x00002000
        RAM     (RW) : origin=0x08002000 length=0x0003ED00
    }

    /*----------------------------------------------------------------------------*/
    /* Section Configuration                                                      */
    SECTIONS{
        .intvecs : {} > VECTORS
        .text    : {} > FLASH0/* | FLASH1*/
        .const   : {} > FLASH0/* | FLASH1*/
        .cinit   : {} > FLASH0/* | FLASH1*/
        .pinit   : {} > FLASH0/* | FLASH1*/
        .bss     : {} > RAM
        .data    : {} > RAM
     .sysmem  : {} > RAM
    }
    /*----------------------------------------------------------------------------*/

    Please reply.

    Regards,

    Jongyong.

     

  • Hi Jongyong, 

    I am getting the exact same error and am unable to transfer any bin files to the MCU. I'll keep you posted if I manage to get anything working. I will be trying out the CAN bootloader for now to see if it works.

    Regards,

    Yash

  • Hi Jongyong, 

    I have posted the bootloaders for latest flash API (V2.0.1). It is located at:

    http://processors.wiki.ti.com/index.php/Category:RM4

    Any question, please let me know. Thank you for your patience!

    Regards,

    QJ

  • Hi QJ,

    I tried after downloading to site you asked.

    But, blank into F021_API directory. so i copyed F021_API_CortexR4_LE.lib into F021_API directory.

    However, i can't download on the RM48HDK.

    It has same problem.

    Are you tested on the RM48HDK?

    I attached testing screen shot.

    6366.Screen shot-SafetyMCU_Bootloader_RM48_uart.docx

    Always stop "while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );".

    Please send it to be run exactly on the RM48HDK.

    Regards,

    Jongyong.

  • Hi Jongyong,

    Please copy the F021_API_CortexR4_LE.lib to \SafetyMCU_Bootloader\lib instead of \SafetyMCU_Bootloader\inc\F021_API

    I tested before posting the project to WIKI.

    Regards,

    QJ

  • Hi QJ,

    I was mistaken about the directory.

    I tested result after copy the F021_API_Cortex_LE.lib to \SafetyMCU_Bootloader\lib.

    I has two RM48HDK.

    Both are not downloaded(always loop "while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );).

    I attached my properties for boot_uart. Please comfirm.

    6433.Screen shot-Properties for boot_uart.docx

    To solve this problem, please let me know if you have any needs.

    Regards,

    Jongyong.

  • Hi Jongyong,

    The project I posted is configured as Release rather than Debug, so the obj folder in the bl_link.cmd is \Release. Two suggestions:

    1. Change the folder name in cmd file to Debug

    2. Add \lib to library search path in project property

    Regards,

    QJ

     

  • Hi QJ,

    I have changed the folder names in the cmd file to 'Debug' for a Debug configuration and have added the \lib library path for the F021_API_CortexR4_LE.lib from v2.00.01.

    I have the same problem with the code looping on

    while(FAPI_GET_FSM_STATUS != Fapi_Status_Success);

    remaining -= flash_sector[j++].length;
    eraseStartAddr = flash_sector[j].start;

     in Fapi_BlockErase 

    I've noticed that after receiving Fapi_Status_Success status, the code skips the line remaining -= flash_sector[j++].length; and jumps to eraseStartAddr = flash_sector[j].start; and back to while(FAPI_GET_FSM_STATUS != Fapi_Status_Success); back and forth.

    Hence the value for eraseStartAddr is always 0x20000

    I've noticed a few other users experiencing the same issue. I'm using an RM48L950 Rev E board and am linking to the following files:

    "C:\ti\ccsv5\tools\compiler\arm_5.1.2\lib\libc.a"

    "C:\ti\ccsv5\tools\compiler\arm_5.1.2\lib\rtsv7R4_T_le_eabi.lib"

    "C:\ti\Hercules\F021 Flash API\02.00.01\F021_API_CortexR4_LE.lib"

    All other files are from the sample bootloader directory.

    Please let me know how I can fix this issue.

    Regards,

    Yash

  • Hello Yash,

    Please check if the return value of Fapi_issueAsyncCommandWithAddress is 0.

    status=Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, eraseStartAddr);

    Make sure the value (I use 0xFFFE to cover sector 1 to sector 15) in Fapi_enableMainBankSectors(0xFFFE) cover the sector you want to erase.

    Regards,

    QJ

  • Hi QJ, 

    I use the TMS570L432 HDK and  my code also loops at the location reported by   : "while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy ).

    My code do not branch into line you stated : status=Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, eraseStartAddr);

     I trace the code flow, it seems that the code jumps to that location without running into lines of code before that line. It is a very strange behavior, I suspect there is something wrong with copying F021 functions to RAM.  

    I need the bootloader, please help.

    regards

  • Hi QJ, 

    I am also suspicious of the fact the F021 API is not being copied correctly to RAM. I tried wrapping  my FAPI functions in do while statements to ensure that the correct status is obtained before proceeding.

    do{
    status=Fapi_setActiveFlashBank((Fapi_FlashBankType)bk);
    }while(status!=Fapi_Status_Success);

    do{
    status= Fapi_enableMainBankSectors(0xFFFE); /* used for API 2.01*/
    }while(status!=Fapi_Status_Success);

    do{
    status=Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, eraseStartAddr);
    }while(status!=Fapi_Status_Success);

    The code still behaves in an unexpected manner, jumping back and forth between while(FAPI_GET_FSM_STATUS != Fapi_Status_Success); and eraseStartAddr = flash_sector[j].start; while skipping other statements which are in the same loop, namely,

    status=Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, eraseStartAddr); , 

    while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy ); and

    remaining -= flash_sector[j++].length;

    Once again, I'm using a Rev-E Hercules RM48L950 and linking to the following external files:

    "C:\ti\ccsv5\tools\compiler\arm_5.1.2\lib\libc.a"

    "C:\ti\ccsv5\tools\compiler\arm_5.1.2\lib\rtsv7R4_T_le_eabi.lib"

    "C:\ti\Hercules\F021 Flash API\02.00.01\F021_API_CortexR4_LE.lib"

    Regards,

    Yash

     

  • I tried to copy Flash API to ram as described in http://e2e.ti.com/support/microcontrollers/hercules/f/312/p/62954/227583.aspx#227583  . I am sure that F021 is copied to ram and executed from there, yet the strange behavior contiunes.I assume the original  _copyAPI2RAM_(); in project was working fine,too.

    It seems that code branches to while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy )  following any Fapi_issueProgrammingCommand or Fapi_issueAsyncCommandWithAddress.

    It has been more than three months, I am in to this bootloader project. I will sure throw a real party when I have it running...

  • Hakan,

    After observing the Disassembly code, I could indeed confirm that the code execution sequence from RAM was incorrect. There was a discrepancy in the order of assembly instructions executing in RAM vs the C code statements in the program.

    I investigated this little a further and concluded that it was the result of interprocedural optimization implemented by the compiler (I'm using v5.1.2). I changed the compiler optimization options to turn it off and the code works fine, I could successfully erase the necessary sectors and was able to successfully receive the bin file packets. 

    Let me know if this solution works for you. Good luck!

    Regards,

    Yash

  • Hi Yash,

    I tried successfuly!

    Thank for your help.

    I closed this issue.

    Merry Christmas!

    Regards,

    Jongyong.

  • Hi Yash,

    Thank you for the help.

    Optimization did not work on me, in fact in my project, optimization level was already set to off. Do not know why it is diffrent than yours. I am not sure whether QJ actually tested for TMS570LS04x UART or not.

    I realized that I also have problems during compiling. I have some issues with libc.a and rtsv7R4_A_be_eabi.lib. If I add libc.a, rtsv7R4_A_be_eabi.lib is reported as missing. I  add libs wtih absolute path.  

    I will review CCS installation. 

    Hi Jongyong, I am very happy for you and a little bit jealous I guess.

  • Hey sorry I didn't work for you. I'm using CCS 5.4, and haven't experienced any library issues after the initial configuration of the project and including absolute paths for the linker.

    I'm using the following external libraries 

    "C:\ti\ccsv5\tools\compiler\arm_5.1.2\lib\libc.a"

    "C:\ti\ccsv5\tools\compiler\arm_5.1.2\lib\rtsv7R4_T_le_eabi.lib"

    "C:\ti\Hercules\F021 Flash API\02.00.01\F021_API_CortexR4_LE.lib"

    Good luck!

  • Hi Hakan,  

    I have the same problem sometime ago, the missing problem of the  rtsv7R4_A_be_eabi.lib  file it should be in the 

    C:\ti\ccsv5\tools\compiler\arm_5.x.x\lib   folder you can just put "rtsv7R4_A_be_eabi.lib"  and  "libc.a"  in "ARMLinker->FileSearchPath->Include Library File or command file por input "    and adding the Library search paths below there, and changing the lines 186 and 236 from

    Fapi_enableMainBankSectors(0xFF);        /* used for API 2.01*/ 

    to 

    Fapi_enableMainBankSectors(0xFFFE);        /* used for API 2.01*/  

    in the bl_flash.c file

    I hope that this info help you

  • Hi Emilio

    IT WORKED !

    Wow, looking back to all the mumbo jumbo i went through. Speechless.

    There are two lines in bl_flash.c that calls Fapi_enableMainBankSectors. One of them actualy had the fix orginally. I changed the second per your message. Ta daaa....

    Thank you very much. I owe you one...