Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coldfire-gnu-discuss] Sourcery G++ Lite support for m5235evb serial I/F ?


  • To: Christof Frey <Christof.Frey@xxxxxxxxxx>
  • Subject: Re: [coldfire-gnu-discuss] Sourcery G++ Lite support for m5235evb serial I/F ?
  • From: Kazu Hirata <kazu@xxxxxxxxxxxxxxxx>
  • Date: Mon, 26 Nov 2007 11:14:11 -0500

Hi Christof,

is there any support from the Lite version for <stdio.h> functions ( in particular printf(); ) to work via the serial communication interface of the M5235BCC evaluation board from Freescale ?

You need to override "write".

  ssize_t write(int fd, const void *buf, size_t count);

Your version of write should take COUNT characters from BUF. You can ignore FD. printf uses the function to write to stdout. You still have to write the serial port support yourself.

If you would like printf support just for debugging purposes, you can route stdout to gdb's console just by linking your application with -T m5235evb-ram-hosted.ld or m5235evb-rom-hosted.ld. In that case, you do not need to override "write". The default version of "write" knows how to print characters at gdb's console.

Hope this helps,

Kazu Hirata