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.

Error Code 4012 with Script "loadti"

Other Parts Discussed in Thread: MSP430F2274

Hi,

I'm trying to programm my MSP430 with the EZ430. My firmware is working well if I'm programming the target with CCS4.2.3 (and also with IAR, but I prefer the CCS).

But I want to programm the device via shell. So i found the the "loadti"-tool that comes with the CCS.I can load my program to the target (message: "MSP430: Program loaded, code size, etc) but i get an error after that and the application freezes. After resetting the target the firmware runs as it should.

The occuring error is

SEVERE: Unable to get address for symbol: ___c_args__

Error code #4012 <filename occurs> load failed!

 

Can you help me out?

  • Hello,

    It sounds like you are trying to pass arguments to main but did not build with the --arg_size linker option to allocate space for the arguments.

    Thanks

    ki

  • With memory size i.e. 16 i get an error. "Exception during launch. Reason: Failed to load program app.out on target 'TI MSP430' USB1_0/MSP430'. Reason: Cannot write to target"

  • This is because  when the '--arg_size' option is used, it will create a section called '.args'. And if you didn't specify where to place '.args' in your linker command file (*.cmd), it will place it in a default location which is probably not valid on your device. So you should edit your *.cmd file and add the '.args' section and specify a valid memory range to place it in.

    Example (from a modified cmd file for the MSP430F2274)

    SECTIONS
    {
        .bss       : {} > RAM                /* GLOBAL & STATIC VARS              */
        .sysmem    : {} > RAM                /* DYNAMIC MEMORY ALLOCATION AREA    */
        .stack     : {} > RAM (HIGH)         /* SOFTWARE SYSTEM STACK             */

        .text      : {} > FLASH              /* CODE                              */
        .cinit     : {} > FLASH              /* INITIALIZATION TABLES             */
        .const     : {} > FLASH              /* CONSTANT DATA                     */
        .cio       : {} > RAM                /* C I/O BUFFER                      */

        .args       : {} > RAM

    ..........

    }