VDK: how to redirect printf to UART with minimal code footprint instead of debug-console? I don't need scanf only printf.
felix wrote:
VDK: how to redirect printf to UART with minimal code footprint instead of debug-console? I don't need scanf only printf.
Hi,
The Blackfin Compiler and Run-Time Library Manual details how to extend I/O support to new devices, using an extensible device driver mechanism. I believe it would require a larger footprint to selectively redirect some parts of the STDIO, than it would to redirect al I/O.
Please take a look at the Compiler and Run-Time Library Manual, which is available via the link below. From page 3-43 it discusses the extension of the I/O support to a new device.
The VDK Shell Browser Example in VDSP implements this. You could use the code there as a reference –
C:\Program Files\Analog Devices\VisualDSP 5.0\Blackfin\Examples\ADSP-BF527 EZ-KIT Lite\Services\File System\VDK\shell_browser
The relevant files are the ones with ConsoleIO in the file name. The ConsoleIO thread is initialized in CommandThread.c file.
Hope this helps!
I was looking for more compact way of doing it. Right now if i'm adding whole I/O driver for simple putc replacement it increases my code by 27kbytes. if i'm just compiling printf from FreeRTOS distribution and using direct register access to UART -- it compiles to just 3kbytes of code. I was looking to stay with stdio library but replacing putc only, as most other compilers/libraries allows (weak definition). Is there such way?
Hi,
Is this still a problem for you? In order to offer advice we would need to request further information about your current setup. For that reason, we would recommend that, if this is still a problem, you should contact us directly via the link below:
http://www.analog.com/processors/support
regards,
Craig.