This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-MSPM0L1306: implementing printf() via onboard debugger without UART

Part Number: LP-MSPM0L1306

I am using LP-MSPM0L1306 board.

Is there a way to print debug messages through the onboard debugger? (like semihosting)

The MCU's UARTs are all in use and cannot be used to output debug messages.

Thank you.

  • Hi Sungwoo,

    Sorry for late response.  To enable printf() in CCS you must use #include "stdio.h", then set the heap size = 1024 in project settings > linker > basic options. 

     printf("Hello MSPM0\r\n");  Note the \r\n.  If you don't include these, nothing will print.  These are required because printf is line buffered.

    See this E2E-> https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/471920/printf-to-console

  • Hello.

    I tested it, but I can't see any message output.

    Here is what I did.

    1. I used uart_rw_multibyte_fifo_poll example from the mspm0_sdk_1_10_01_05 SDK for this test.

    2. Ther is no heap size setting option (project settings > linker > basic options)

    3. I added following code in the uart_rw_multibyte_fifo_poll.c to increase heap size.

         char __heap_buf[1024] __attribute__ ((section (".heap")));

    4. I checked the __heap_start__ and __heap_end__ values in the map file to make sure this was applied correctly.

          0x200008d0                __heap_start__ = .

          0x20000cd0                __heap_end__ = .

          It is applied correctly.

    5. This is my main() function.

        #include <stdio.h>

        char __heap_buf[1024] __attribute__ ((section (".heap")));

        int main(void)

        {

            printf ("hello world\r\n");

        }

    Thank you.

  • Hi Sungwoo,

    Sorry, I didn't realize you were using GNU.  Let me check with our SW GURUs for an answer.