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.

TM4C1290NCPDT: TI ARM Clang Migration and Tiva Bootloader issue

Part Number: TM4C1290NCPDT

Hi,

I want to migrate my existing project from  TI 20.2.7 LTS to TI ARM Clang V2.1.3 LTS and encountered the following problem:

I build the hexfile and run it on the target but when I reboot the device the bootloader is called. I`m using the default TivaWare Bootlader 2.2.0295.

I`ve already found the origin of the problem but I don`t know how to fix it.

The bootloader expects the application at address 0x4000 and checks for a int vector table.

    // See if the first location is 0xfffffffff or something that does not
    // look like a stack pointer, or if the second location is 0xffffffff or
    // something that does not look like a reset vector.
    //
    pui32App = (uint32_t *)APP_START_ADDRESS;
    if((pui32App[0] == 0xffffffff) ||
       ((pui32App[0] & 0xfff00000) != 0x20000000) ||
       (pui32App[1] == 0xffffffff) ||
       ((pui32App[1] & 0xfff00001) != 0x00000001))
    {
        return(1);
    }

I´ve looked into the linker map from the TI Clang compiler and it puts the text section at 0x4000 the old compiler puts the intvecs at the address. check out attached linker files and linker cmds.

How can I modifiy my linker script for the Clang compiler so that it puts the intvecs at 0x4000?

Thanks!

Best regards

Steffen

Maps.zip

  • When using tiarmclang, is the file tm4c1290ncpdt_startup_ccs.obj one of the inputs seen by the final link command?

    Thanks and regards,

    -George

  • Hi George,

    thanks! That was the problem! The migration wizard excluded the startup_ccs.c from build. I didn`t see that!

    I`ve got 2 follow up questions:

    1. The warning -> #10247-D creating output section ".rodata" without a SECTIONS specification:

    What can I do about it. Of course I can set it in the linker script but will the old ti compiler recognize it? I want to support both for a period of time...

    2. The warning -> #16032-D object files have incompatible wchar_t types ("TivaWare_C_Series-2.2.0.295/driverlib/ccs/Debug/driverlib.lib<adc.obj>" = --wchar_t=16, "./main.o" = --wchar_t=32):

    The Tiva lib was build with wchar_t=16. If I switch globaly to wchar_t=16 than the error occurs that libc is build with wchar_t=32. Can I rebuild the Tiva Lib? Is wchar_t used by the tiva lib at all? So maybe I can ignore it. Its a C only lib so there is no wchar_t isn`t it? Can I than suppress the warning for specific includes?

    Thanks!

    Best regards

    Steffen

  • Hi George,

    can you reply to my followup questions?

    Thanks!

    Best regards

    Steffen

  • I apologize for the delay.  When you marked this thread answered, it automatically closed.  Thus, the dashboard I use no longer showed this thread to me.  When you posted another reply, that caused the thread to automatically open, and then I saw it on my dashboard.  Please don't feel obligated to learn all these details.  But that's why my response is delayed.

    The warning -> #10247-D creating output section ".rodata" without a SECTIONS specification:

    What can I do about it.

    Change the linker command file (you call it a linker script).  If you don't change it, then the .rodata section gets allocated to memory using the linker defaults, which is almost certain to cause problems.

    Of course I can set it in the linker script but will the old ti compiler recognize it?

    Yes.  The programming language of the linker command file is the same for both toolchains.  When you build with the old compiler, it will end up creating a .rodata section of length zero.  Which is harmless.

    Can I rebuild the Tiva Lib?

    I don't know.

    Is wchar_t used by the tiva lib at all?

    Probably not.  But you need to check with the team that supports it for confirmation.

    Can I than suppress the warning for specific includes?

    There is a command line option to suppress certain diagnostics, including this one.  In this case, add --diag_suppress=16032.  That number appears in the early part of the diagnostic.

    Thanks and regards,

    -George

  • Hi George,

    I`ve fixed the linker script and it worked! Thanks!

    For now I have suppressed the 16032 warning but I want to make shure that this dowsn`t cause trouble in the future.

    Can you please check with your team rearding this issue?

    Thanks!

    Best regards

    Steffen

  • Hi Steffen,

    The Tiva lib was build with wchar_t=16. If I switch globaly to wchar_t=16 than the error occurs that libc is build with wchar_t=32. Can I rebuild the Tiva Lib? Is wchar_t used by the tiva lib at all? So maybe I can ignore it. Its a C only lib so there is no wchar_t isn`t it? Can I than suppress the warning for specific includes?

    I do not see wchar_t being used for Tiva driverlib. 

    You can rebuild the drivelib. You can import the driverlib project from the TivaWare SDK into CCS and rebuild it.