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

Fixed ch32v003 random number example with native Linux and screen. #571

Closed
wants to merge 1 commit into from

Conversation

TheFlemoid
Copy link

@TheFlemoid TheFlemoid commented Mar 19, 2025

Just started working with this library yesterday, but wanted to throw up a PR for this in case what I have found is a problem and not the norm.

I'm running Ubuntu 24 native, trying to program the CH32V003F4P6, using screen as my tty uART utility. What I found was that the header definitions in the "random number" example didn't work as described, and I had to modify them to be more in line with the uartdemo header definitions. Additionally, simply returning a newline character resulted in suboptimal output from screen for me, which was rectified by switching to a newline followed by a carriage return character.

I am fairly positive that these are all things that people have dealt with, cause this is a fairly popular library and a fairly popular MCU, but I at least wanted to get my opinions out while they were fresh on my mind in case they were valuable. Feel free to tell me I'm dumb and close this as a no fix, I won't be offended.

@cnlohr
Copy link
Owner

cnlohr commented Mar 19, 2025

We always recommend debug-over-swd over debug-over-uart for all users in all situations by default. There are obviously limited and specific situations where debug-over-uart is better, but, it is not the default. The default run line should be make clean all monitor which will allow debug printf without any additional wires or anything.

As far as the spurious \r. Yes, we should remove that.

@TheFlemoid
Copy link
Author

I figured there was something I was missing with the debug statements 😑 sorry about that!

I really appreciate your response (and your amazing toolchain here). If it's okay with you, I'm going to go ahead and close this PR since 80% of it isn't relevant. I do think going through and adding return carriages to examples that use the uart is probably a good idea (and I'm more then happy to go ahead and do that if you think it's worthwhile, since I found it a helpful catch), but that's not really what the PR was started for, so I wasn't sure if you'd want it open.

Thank you for making this fantastic toolchain btw!

@cnlohr
Copy link
Owner

cnlohr commented Mar 25, 2025

Yes, feel free to close.

And thank you for the kind words. I still hope to keep this under steady improvement.

@TheFlemoid TheFlemoid closed this Mar 30, 2025
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

Successfully merging this pull request may close these issues.

2 participants