cancel
Showing results for 
Search instead for 
Did you mean: 

How to print a multidimensional array in stm32 eclipse

KA
Associate II

Is there any way to print a multidimensional array to console in eclipse for stm32. I am able to print a one dimensional array via UART. However , printing a 2 dimensional array via UART or to the console in eclipse seems impossible. Could anyone help

3 REPLIES 3
ayarema
Associate II
KA
Associate II

Thank you ayarema,

I know how a 2d array works in c language. I don't know how to print it to console on eclipse IDE. In eclipse , the printf statement doesn' t work. Each time i have to use UART to print something. I tried print a 2d array via UART and that didn't work either.

There isn't a magical way to printf() a matrix, you're going to have to make your own pretty-printer that enumerates through the rows/columns of your array. Make it a subroutine.

If you want printf() to work you have to have working plumbing in the library, ST frequently uses an __io_putchar() function to do the actual output, and that is driven from the _write() function in syscalls.c or equivalent newlibs code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..