Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Mostafa_E_Intel
Employee
97 Views

printf() API in newlib-syscalls.c

I am trying to upgrade my project with the latest QMSI, the problem is that i see that they have removed the printf() API from the newlib-syscall.c ... is there any way in order to overcome this issue.

I know that there is the pico_printf() but i see they added a comment in the source code as follows:

"
/**
 * @brief This is an minimally useful subset of the POSIX printf() function.
 *
 * To reduce code size, this pico_printf() implementation only supports a few
 * conversion specifiers:
 *  - @a 'd', @a 'u': for signed and unsigned decimal numbers, respectively;
 *  - @a 'x', @a 'X': for hexadecimal numbers, downcase and upcase;
 *  - @a 's': for NULL terminated strings.
 *
 * Other limitations:
 *  - No flag specifier is implemented;
 *  - No field width specifier is implemented;
 *  - The only supported length modifier is 'l', which is parsed and ignored,
 *    on supported archictetures 'int' and 'long int' are both 32 bits long.
 *  - 32 digits maximum length for formatted numbers.
 */

"

which i think would still be a problem as i do have some unsigned long int's and so... any thougths ?

0 Kudos
1 Reply
Richard_A_Intel
Employee
97 Views

Mostafa,

QMSI comes with a wrapper function for printf that is called QM_PRINTF which should serve your purpose.  For an example of usage see the hello_world sample included with Intel(R) System Studio for Microcontrollers.

Thank you,
Richard

 

Reply