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.

TMS570LS1224: TMS570 Bootloader using IAR EWARM V8.22

Part Number: TMS570LS1224
Other Parts Discussed in Thread: HALCOGEN,

Hi,

I am using IAR EWARM V8.22 for development and following the SPNA192 document for Bootloader for Hercules TMS570LS12x MCU.

However I am not able to compile the project. Could you please suggest me a solution.

Do you suggest that the linker file provided for CCS project has to be modified to support IAR?

Thanks and regards,

Abrar

  • I am using using the sys_link.cmd file generated using HALCOGEN for the IARv8.22

    I am getting the following errors: 

    Error[Li005]: no definition for "copy_in" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "_copyAPI2RAM_" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__binit__" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__TI_Handler_Table_Base" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__TI_Handler_Table_Limit" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__TI_CINIT_Base" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__TI_CINIT_Limit" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__TI_PINIT_Base" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__TI_PINIT_Limit" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Fatal Error[Lp049]: there was no reference to __iar_data_init3, but it is needed to initialize section .bss (bl_check.o #8)
    Error while running Linker

  • Hi Abrar,

    IAR Workbench uses different linker cmd file. Please use HALCoGen to generate one for IAR workbench:

  • Hi,

    Thanks for your reply.
    I have used sys_link.cmd generated from HALCoGen for IAR workbench.

    The following are the contents of sys_link.cmd
    /*----------------------------------------------------------------------------*/
    define memory mem with size = 4G;

    define region VECTORS = mem:[from 0x00000000 size 0x00000020];
    define region FLASH = mem:[from 0x00000020 size 0x0013FFE0];
    define region STACK = mem:[from 0x08000000 size 0x00001500];
    define region RAM = mem:[from 0x08001500 size 0x0002EB00];
    define block HEAP with size = 0x800, alignment = 8{ };

    initialize by copy {readwrite};
    do not initialize {section .noinit};

    place in VECTORS {readonly section .intvecs};
    place in FLASH {readonly};
    place in RAM {readwrite};
    place in RAM {block HEAP};
    /*----------------------------------------------------------------------------*/


    But I am getting the following compilation errors:

    Error[Li005]: no definition for "copy_in" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "_copyAPI2RAM_" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__binit__" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__TI_Handler_Table_Base" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__TI_Handler_Table_Limit" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__TI_CINIT_Base" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__TI_CINIT_Limit" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__TI_PINIT_Base" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Error[Li005]: no definition for "__TI_PINIT_Limit" [referenced from D:\SafetyMCU_Bootloader\object\Debug\Obj\sys_startup.o]
    Fatal Error[Lp049]: there was no reference to __iar_data_init3, but it is needed to initialize section .bss (bl_check.o #8)
    Error while running Linker

  • The assembly function "_copyAPI2RAM_" is based on the CCS linker commmand file. The sys_startup.c should not call __TI_auto_init();

    You can write C code to copy flash API from flash to SRAM at the beginning of main().
  • Hi,

    I have given the lib path for F021_API_CortexR4_BE.lib and modified the linker file as follows:

    /*----------------------------------------------------------------------------*/
    define memory mem with size = 4G;
    
    define region VECTORS = mem:[from 0x00000000 size 0x00000020];
    define region FLASH   = mem:[from 0x00000020 size 0x0013FFE0];
    define region STACK   = mem:[from 0x08000000 size 0x00001500];
    define region RAM     = mem:[from 0x08001500 size 0x0002EB00];
    define block HEAP with size = 0x800, alignment = 8{ };
    
    initialize by copy { readwrite };
    initialize by copy { object bl_flash.o };
    initialize by copy { object F021_API_CortexR4_BE.lib };
    do not initialize  {section .noinit};
    
    place in VECTORS {readonly section .intvecs};
    place in FLASH   {readonly};
    place in RAM     {readwrite};
    place in RAM     {block HEAP};
    /*----------------------------------------------------------------------------*/

    However, when I try to read from flash, I get the following error in IAR.

    Please could you suggest a solution.

    Thanks and regards,
    Abrar

  • Since I am using IAR EWARM V8.22 and the microcontroller TMS570LS1224 (big endian), I tried the following:
    1) In the file CGT.IAR.h, I modified the line
    #if !defined(__LITTLE_ENDIAN__) /* is big endian compile */
    to
    #if (__LITTLE_ENDIAN__ == 0) /* is big endian compile */
    2) For making the F021_API_CortexR4_BE.lib & bl_flash.c to run from RAM, I added the following lines to the linker file:
    initialize by copy { object bl_flash.o };
    initialize by copy { object F021_API_CortexR4_BE.lib };
    3) I had to setup the following before accessing the flash:
    a) FRDCNTL_bit.RWAIT = 0; // Since I am running less than 50MHz
    b) FSM_WR_ENA_bit.WR_ENA = 5; // Enabling write enable
    c) EEPROM_CONFIG = 2 // EEPROM wait configure.
    d) FSM_WR_ENA_bit.WR_ENA = 2; // Disable write enable
    4) Disable interrupts ( _disable_interrupt_() ) before accessing the flash and enable interrupts ( _enable_interrupt_() ) after flash access is complete.
    5) I had to ignore the following warning:
    Warning[Lt009]: Inconsistent wchar_t size
    Read.MarginByByte.obj(F021_API_CortexR4_BE.lib)
    and 15 other objects have wchar_t size 16 bits
    adc.o and 72 other objects, some of them in dl7Sx_tbn.a
    and 12 other libraries have wchar_t size 32 bits

    As per the post on: e2e.ti.com/.../746903
    The only workaround for now is to downgrade the IAR Workbench.
  • Is the problem caused by the different wchar_t definition? If you switch back to old version IAR workbench, does the problem gone?
  • Hello Abrar,

    Have you solved the problem?
  • Hi,

    The compilation errors are resolved and flash read / write / erase are working in IAR EWARM 8.22.

    I did not switch back to old version IAR workbench, so there is a warning for inconsistent wchar_t size in F021_API_CortexR4_BE.lib.
    As of now, I did not find any problem caused because of that warning.

    Thanks a lot for your continued support.

    Regards,
    Abrar