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.

CCS/TMS570LS0432: CAN boot-loader example code is getting stuck after CAN_DOWNLOAD_COMMAND

Part Number: TMS570LS0432

Tool/software: Code Composer Studio

Hi ,

I am testing CAN bootloader example code. I don't  have NI-CAN device so, i have have written code for BeagleBone enhanced to send all commands specified in the document provided in example program doc. folder. When i am sending PING command , bootloader is giving ACK also RESET and RUN command is working by placing blink app image via JTAG without erasing bank 0 section 0 to 10.

My problem is when i am giving DOWNLOAD command which is actually erasing flash from app start address to size of image and after that it should respond ACK or NACK, but after issuing this command it is getting stuck.

I guess CPU is enable erase bank 0 as this is trying to erase same bank's sector.

Even though in system initialization file before main, _Copy2RAM is called it is not working properly and i am not getting any ACK.

what is solution ??

Thanks .. 

  • Hello Indrajit,

    1. Are the flash address and size of the flash sectors defined correctly? In the example code, they are defined in flash_defines.h

    2. Before you call _copy2RAM_() function, make sure the sections of api_load, api_run, and api_size have been defined. In the example code, they are defined in linker command file.

      flashAPI :

      {

        Fapi_UserDefinedFunctions.obj (.text)

        bl_flash.obj (.text)

        --library= ..\flash_api\lib\F021_API_CortexR4_BE.lib (.text)

      } load = FLASH_API, run = RAM, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size)

    3. make sure the correct F021 flash library is linked: F021_API_CortexR4_BE.lib rather than the F021_API_CortexR4_BE_V3D16.lib and F021_API_CortexR4_BE_L2FMC_V3D16.lib

     

     

  • Thanks for reply,

    As I am using hercules launchpad which has  TMS570ls0432 on board. following files i am using --

    1. flash_defines.h -----

    I think flash are defined is correct.

    2. Linker cmd file -- which is as it is

    3. And i have copied  F021_API_CortexR4_BE.lib   inside project folder.

    I think _copy2RAM_() is not working and because of that bootloader is not able to erase flash bank 0 as i understood flash api wont work within same bank's sector.

    Any changes i need to make ??

    2251.flash_defines.h

  • Hello Indrajit,

    Since this device has only one flash bank, the flash APIs and bl_flash.c have to be copied to SRAM and execute from SRAM. Otherwise the flash will not be erased and programmed.

    _copy2RAM_() used the variables defined in linker cmd file: api_load, api_run, api_size

    Please change the following:

    --library= F021_API_CortexR4_BE.lib <FlashStateMachine.obj
    Program.obj
    Init.obj
    Utilities.obj
    Async.obj> (.text)

    to:

    --library= F021_API_CortexR4_BE.lib (.text)

    Where is the library located? you need to put the relative path of the lib in: --library= F021_API_CortexR4_BE.lib (.text)