2019-09-13 01:00 PM
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
2019-09-13 01:08 PM
2019-09-13 01:28 PM
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.
2019-09-13 02:43 PM
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.