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.

Only CodeSourcery (gcc) version 2009q3-68 *and newer* can compile uartEcho and usb_bulk_dev!

Other Parts Discussed in Thread: AM1707, AM1808

Update: CodeSourcery versions newer than 2009q3 now seem to work with StarterWare if you compile with the flag -fno-zero-initialized-in-bss.  Older versions untested by original poster due to lack of interest.


I just want to point out for anybody wanting to use gcc + UARTprintf as a substitute for printf, that serial port output seems to be broken for CodeSourcery versions newer than 2009q3 - up to and including 2011.09-69 (try uartEcho: interrupt Tx breaks).  However, gcc is apparently required for USB..

Also, usb_bulk_dev when compiled with CodeSourcery 2009q1-161 works when debugging in CCS but does not work when booting from SPI0 standalone.

Everything (including usb_bulk_dev booted from SPI0!!) seems to work when compiled with 2009q3-68.

This is all for my EVMAM1707 Rev. H evaluation board; code forthcoming in original thread.  Is this sort of crazy compiler dependence true for other processors too??

  • Chen,

                 Thanks for sharing your experience.

                "usb_bulk_dev works in CCS" - do you mean you compiled with CCS (TMS470 compiler) or you compiled with GCC and loaded using CCS IDE..?

                 when you use UARTPrintf will you get your data printed via UART serial port on the EVM..?

    Regards

    Baskaran

  • Hello, Baskaran,

    The latter is right - compiled with GCC and loaded program in debugger.  I have tried to clarify this in the original post (italicized).  A full write-up including source code and makefile/CCS project will be posted sometime soon.

    When UARTprintf calls are compiled with CodeSourcery 2010q1 and later, the AM1707 EVM Rev. H board sends gibberish data to PC.  This was preventing progress until other compiler versions were tried.

    Similarly, the uartEcho example does not run correctly for me using 2010q1 or later.  The "StarterWare AM1808 UART echo application" string transmits as gibberish.  However, the echo back still works correctly, as does the following non-interrupt based test of the serial port API:

        for (unsigned int i = 0; i < strlen(txArray); i++)
            UARTCharPut(SOC_UART_2_REGS, txArray[i]);
        while(1)
            UARTCharPut(SOC_UART_2_REGS, UARTCharGet(SOC_UART_2_REGS));

    UARTprintf seems to work fine in 2009q3, 2009q1, and older.

    USB breaks in 2009q1 as described previously.  Also, when compiled with 2010q1 and newer, USB seems to regress further: enumerates as USB\UNKNOWN even when loaded from CCS.

    As of this writing, everything seems to work fine in 2009q3, and only 2009q3, which seems pretty lucky!

    -Jonathan

  • Chen,

              Thanks. Sorry i still didnt get how UART Printf is used. Since this is compiler function how will it be able to output data on AM17xx evm.?

     Regards

    Baskaran

  • Hello, Baskaran,

    I was referring to the use of UARTprintf as a substitute for printf, as described in your previous post at http://e2e.ti.com/support/embedded/starterware/f/790/t/159729.aspx .  I am outputting text to PC via the EVM's serial port + null modem cable.  Sorry about any confusion.

    -Jonathan

  • ok thanks. I got confused earlier that you are trying to use the tool chains printf function.

  • The CodeSourcery compiler "regressions" have now been fixed!

    When ported to AM1707, StarterWare projects compiled with CodeSourcery gcc 2011.09 apparently require an additional flag:

    -fno-zero-initialized-in-bss

    This flag is not required for 2009q3, which was apparently more lenient.

    This fixes the mysterious regressions for both uartEcho and usb_bulk_device; both have now been verified as working with CodeSourcery 2011.09 (didn't test other versions between 2009q3 and 2011.09).  This is all untested on older compiler versions, but those are of lesser interest.

    A sample project (very messy) for uartEcho compiled with gcc is attached, previously uploaded for CCS only (tms470).

    Special thanks to Sergei Poselenov from CodeSourcery's arm-gnu mailing list!

    gcc_uartEcho_2011.zip
  • Chen,

               thanks for sharing.

    regards

    Baskaran