Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulator: Printf not working at runtime | Simulator starts twice #54

Open
MasterTim17 opened this issue Apr 29, 2023 · 5 comments
Open

Comments

@MasterTim17
Copy link

Hello,
im using the simulator with platformio and used this repo example.
When i upload the project the simulator starts. When i close it another windows opens. This is essential for the following problem

I want to debug the code with printf command. So i defined following in platform.ini file:

-D LV_USE_LOG=1
-D LV_LOG_PRINTF=1

Default log level is : -D LV_LOG_LEVEL=LV_LOG_LEVEL_WARN
During runtime i dont get an output. When i close the Simulator window, the print output is now seen on the output. The second windows open, but the print output from it is not seen after closing.

However, when i change the log level to -D LV_LOG_LEVEL=LV_LOG_LEVEL_INFO the print output can now be seen during runtime. thi s isnt useful, because too much output is beeing listed.

I hope the problem is understandable. Is this a bug or is there a solution?

@3254547566
Copy link

I am also facing the same problem. Is there a solution now

@Yutu0k
Copy link

Yutu0k commented Sep 25, 2024

Still waiting for a solution...

@kisvegabor
Copy link
Member

Hi,

How do you print the logs? With lv_log() you need to append a "\n". E.g. lv_log("Hello %d world\n", 5). LV_LOG_USER("Hello %d world", 5) append the \n internally.

Recently fflush was added to printf logging. See here. Does it solve the problem?

@Yutu0k
Copy link

Yutu0k commented Oct 7, 2024

I think LV_LOG_USER("Hello world\n") works.
If I add std::cout and endl func in the code to flush the output, it also seems to work.

@kisvegabor
Copy link
Member

Does it mean the problem is solved? 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants