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

Trouble Debugging CH32V203C8T6 Using Arduino #150

Open
wburchard opened this issue Sep 28, 2024 · 7 comments
Open

Trouble Debugging CH32V203C8T6 Using Arduino #150

wburchard opened this issue Sep 28, 2024 · 7 comments

Comments

@wburchard
Copy link

The marked sentence in the below image leads me to think that Arduino should be able to debug code on CH32V boards, but Arduino seems to not be able to do this.

image

Am I misunderstanding this sentence? If so, could you please direct me to a description of how to debug code on these chips?

Thank you!

@maxint-rd
Copy link
Contributor

maxint-rd commented Sep 28, 2024

In the past months I've been able to use the debugger within Arduino 2.3.2 IDE (in Windows 11) to debug the CH32V003 quite successfully. Break, step into, watch, etc. all work fine. All I needed to do was to compile with debug symbols and debug optimization.

Unfortunately at the moment I don't have the CH32V203, but coincidentally earlier today I ordered some of these chips (the F8P6 model). Hopefully within a few weeks I can upload some code and then let you know my experience.

In the mean time:
What is your environment?
Do you perhaps also have the V003 to try first?

@wburchard
Copy link
Author

wburchard commented Sep 29, 2024 via email

@maxint-rd
Copy link
Contributor

If debugging isn't working for the CH32V003 either, you may not have the latest version of the CH32 Arduino core installed.

Please note that the latest published release is 1.0.4 (dated december 2023), but many new features that have been added are not in that release. For those features you need the code in the main branche.

Debugging was merged in PR #68 "Add debug feature" in february 2024. In the last comment of that PR you can read what someone else did to get debugging working.

(BTW. This core is maintained by @TianpeiLee in his spare time. Although it would be nice to have the latest code published into a proper release, this is the better than no support at all).

@wburchard
Copy link
Author

wburchard commented Sep 29, 2024 via email

@maxint-rd
Copy link
Contributor

Could you possibly point me to instructions on how to build and use the latest CH32 Arduino core?

I installed release 1.0.4 using the library manager and then copied over the newer sources. Read this post for more details.

In my version I've also made some other changes, for instance to have interrupt driven Serial1 and be able to read VCC. For my CH32V003 projects I also modified the board.txt to allow enabling modules in the IDE. For using watchdog and sleep I modified Adafruit_SleepyDog.

@wburchard
Copy link
Author

wburchard commented Oct 1, 2024 via email

@maxint-rd
Copy link
Contributor

Good to see you got it working! When I got debugging working I was very pleased.
It allowed me to implement features that would otherwise be very hard, such as my PR for I2C-slave and interrupt driven Serial1 to fix lost data in Serial.read().

Congratulations and happy debugging!

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

2 participants