Skip to main content
KA_it
Associate II
September 13, 2019
Question

How to print a multidimensional array in stm32 eclipse

  • September 13, 2019
  • 1 reply
  • 1800 views

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

    This topic has been closed for replies.

    1 reply

    ayarema
    Associate II
    September 13, 2019
    KA_it
    KA_itAuthor
    Associate II
    September 13, 2019

    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.

    Tesla DeLorean
    Guru
    September 13, 2019

    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 VenmoUp vote any posts that you find helpful, it shows what's working..