Skip to main content
IYetk
Associate III
Aug 25, 2019 11:36 PM UTC
Solved

write something to console for a M4 program - stm32mp157c-dk2

Hello,

I am reading a sensor on m4 side. And debugging in production mode for the target.

I have called printf function in main.c but I cant see anything when I run the program.

Is it normal that I cant see any console while the program running ?

This topic has been closed for replies.
Bumsik Kim
Bumsik KimBest answer
Senior
Aug 26, 2019 3:49 AM UTC

By default printf would do absolutely nothing, since there is no peripheral associated with stdout. You need to write your own _write() system call function.

To make _write() print out to the host Cortex-A, you probably want to look at OpenAMP examples in STM32CubeMP1.

2 replies

Bumsik Kim
Bumsik KimBest answer
Senior
Aug 26, 2019 3:49 AM UTC

By default printf would do absolutely nothing, since there is no peripheral associated with stdout. You need to write your own _write() system call function.

To make _write() print out to the host Cortex-A, you probably want to look at OpenAMP examples in STM32CubeMP1.

IYetk
IYetkAuthor
Associate III
Aug 26, 2019 6:07 AM UTC

I understand, thank you very much