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.

TMS570LS3137: CAN Bootloader

Part Number: TMS570LS3137

I am trying to embed a CAN bootloader into my application.  In the linker command file I've reserved an area of flash to "bootFuncs" where I intend to place the bootloader functions, and after it executes it would call the application main() which I've assigned in linker file to 0x8000.   Right now my bootloader is empty and simply just calls main.  This only works if I do not add the #pragma CODE_SECTION(main,"appEntry");  As soon as my pragma is inserted my application does not boot.  

  • Are there areas of flash that should be avoided, since it appears the linker is avoiding 0x8000 (or so it would appear from the .map file)
  • Are we not allowed to specify the memory location for main?  Linker seems to want to put it at 0x11C98.
  • Also, are there restrictions regarding initialization code and where it needs to reside?  If I move it out of c_int00 (lets say SystemStartup()) but c_int00 calls SystemStartup() my program does not boot.

Any help, extra documentation or guidelines will be greatly appreciated.

  • Hello,

    My understanding is that the bootloader and the application use different cmd files, and both of them have a mian() function. They are two separate projects.

    You can use this way to jump to application start point:
    ((void (*)(void))applicationAddress)();

    It will execute the c_int00(), sys_intvecs for the application project. There are no restrictions to put the application code. The bootloader should be laced in the beginning of he flash.
  • If there are no restrictions then could you please help me understand why this leads to a call to dataAbort in sys_intvecs.asm. If I remove the pragma for my SystemStartup function everything works fine, however as soon as I include it my application will not boot. If I replace the call to SystemStartup() with :

    ((void (*)(void))appAddress)();

    I get the same results. Here's a snippet of my code below:

    #pragma CODE_STATE(_c_int00, 32)
    #pragma CODE_SECTION(_c_int00,"bootFuncs");
    #pragma INTERRUPT(_c_int00, RESET)
    void _c_int00(void)
    {
    SystemStartup()
    }

    #pragma CODE_SECTION(SystemStartup,"appEntry");
    void SystemStartup(void)
    {
    // Initialize Core Registers
    _CoreInitRegisters_();

    // Initialize Stack Pointers
    _CoreInitStackPointer_();

    if (DEVICE_ID_REV == 0x802AAD05)
    {
    // Clear ESM Core Compare Module (CCM-R4) for Rev-A silicon:
    _EsmCcmErrorsClear_();
    }

    // Enable response to ECC errors indicated by CPU for accesses to flash.
    // Enable events on Ones/Zeros fail, and enable SECDED in the EDACEN
    flashWREG->FEDACCTRL1 = 0x000A060A;

    // Initialize the Performance Monitoring Unit (PMU)
    _CoreEnableEventBusExport_();

    // Work Around for Errata CORTEX-R4#66
    _Errata_CORTEXR4_66_();

    // Work Around for Errata CORTEX-R4#57
    _Errata_CORTEXR4_57_();

    ...... (more init stuff)
    ......

    }