- May 11, 2008
- 21,831
- 1,316
- 126
The gcc compiler i use for my arm chips, also supports stdio.h
But when i started programming i did not know how to get printf to work.
I did not know how to connect printf to write (pipe) to a buffer in ram and let me take it from there with either interrupt based uart transfers or through dma based transfers.
I do not mean to use sprintf or snprintf, i really mean printf.
Thus i wrote my own limited to one input variable but functional printf solution that can print in a buffer and transmit uart data through dma, pio or interrupt based transfers.
However, i am in the process to use as much standard functions as possible.
I would like to abandon my own printf function for standard use and only use it when i am memory limited.
When that is not the case, i prefer to use stdio instead.
Does anybody know what i have to do to get printf to print in a by me designated buffer in ram ?
I searched a bit but it is hard to find so far.
edit:
I changed the title to match the problem and solution.
But when i started programming i did not know how to get printf to work.
I did not know how to connect printf to write (pipe) to a buffer in ram and let me take it from there with either interrupt based uart transfers or through dma based transfers.
I do not mean to use sprintf or snprintf, i really mean printf.
Thus i wrote my own limited to one input variable but functional printf solution that can print in a buffer and transmit uart data through dma, pio or interrupt based transfers.
However, i am in the process to use as much standard functions as possible.
I would like to abandon my own printf function for standard use and only use it when i am memory limited.
When that is not the case, i prefer to use stdio instead.
Does anybody know what i have to do to get printf to print in a by me designated buffer in ram ?
I searched a bit but it is hard to find so far.
edit:
I changed the title to match the problem and solution.
Last edited: