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.

TI-RTOS release compilation : Error[e46]: Undefined external "__write" referred in ?putchar

Other Parts Discussed in Thread: MSP430F5529

Hello


i use the MSP430F5529 CPU with IAR compiler.
i used sys/bios version 6_35_04_50 and TI-RTOS version 1_21_00_09
I'm able to compile my project under "debug" but when i passe in relase mode i have this error :" Error[e46]: Undefined external "__write" referred in ?putchar ( C:\IAR Systems\Embedded Workbench 6.5\430\LIB\DLIB\dl430xsfn.r43 ) "
On my project i have no printf

In my current CFG file i have this :
var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
System.SupportProxy = SysCallback;

If i replace it by the code below i can compile but with many warning because i have not define the call back.
var SysStd = xdc.useModule('xdc.runtime.SysStd');
System.SupportProxy = SysStd;

I want to know if they have a solution to used TI-RTOS without any putchar or a simple solution to build on release and debug without error?

in attachement my CFG file.

4863.Configuration.cfg

  • Cedric,

    Have you resolved your issue yet?  Is this your own example or one of TI-RTOS?

    Judah

  • hello Judah

    I have not resolve my problem.

    The exemple is extract from TI-RTOS example FATFS.

    I can used a callback but, before to used it, i prefere to see if i have a possibility to avoid using putchar (because i dont know where it is called and what is the impact if i add an empty callback)

    Best regards

    Cedric

  • Is there anyway you can attach your project here? or a cutdown version?

    I'm not familiar with the IAR embedded workbench.  Most people here either use TI tools or Linux (if they want to build IAR programs) so I'm not able to reproduce your issue.

    Judah

  • I'm sorry but It is not possible to add my project.

    If you want to reproduce it, just recompile any TI-RTOS exemple on IAR (like UART echo). Debug are ok but in release... "Error[e46]: Undefined external "__write" referred in a_pr430XS"

    Cedric

  • Cederic,


    IAR's release runtime libraries do not support low I/O operations. Hence, the API printf(), putc() cannot be used in release mode. In your case, the __write function is referred by putchar which is called in the SysStd code

    There are two solutions,

    1) (Recommended) Do not use SysStd in release mode, instead use SysCallback and implement the callback functions to output to your I/O Console.

    2) Implement the __write function. More information about the __write function can be found in compiler documentation in your IAR installation. It is under <IAR installation>/430/doc directory.


    Hope this helps.

    Vikram

  • hello Vikram

    Thanks for your replay.

     before to used callback, have a you a solution to avoid using putchar on the TI-RTOS? (Why TI-RTOS needed to used putchar on release ?) 

    Best regards

    Cedric

  • Cedric,

    TI-RTOS examples out of box contain some System_printf statements which print messages to console for debugging purposes. These work in the debug mode only. In the release mode, it is assumed the user will not require the debug printf message and will get rid of them or have those message sent out to a custom I/O console/through UART.

    The solution to your problem is to remove the use of System_printf() from c code and xdc.runtime.System/ xdc.runtime.SysStd from your configuration file. Or if you need the debug message, then you will to use SysCallback instead of SysStd and implement your own callback functions which  will send the messages to your desired I/O console.


    Vikram