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

minichlink debug support #28

Open
maxgerhardt opened this issue Jun 9, 2023 · 6 comments
Open

minichlink debug support #28

maxgerhardt opened this issue Jun 9, 2023 · 6 comments
Assignees
Labels
bug Something isn't working debugging

Comments

@maxgerhardt
Copy link
Member

With d451c46, we can now upload via minichlink. We can also start minichlink's GDB server and connect to it, however, the step into and step over controls in VSCode are broken because minichlink just hangs on the GDB step command. Thus, we depend on cnlohr/ch32v003fun#158.

Other oddities like not supporting load were worked-around with the preload load mode in PlatformIO.

It's also an open question on how to do a reset as GDB command.

@maxgerhardt maxgerhardt added bug Something isn't working debugging labels Jun 9, 2023
@maxgerhardt maxgerhardt self-assigned this Jun 9, 2023
@tmolteno
Copy link

tmolteno commented Jun 15, 2023

With the most recent version I am getting errors on trying to upload (I had been using the using Link-E) On debian linux.

Executing task: platformio run --target upload --environment genericCH32V305RBT6 --upload-port /dev/ttyACM0 

Processing 
genericCH32V305RBT6 (board: genericCH32V305RBT6; platform: ch32v; framework: noneos-sdk)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Tool Manager: Installing git+https://github.com/Community-PIO-CH32V/tool-minichlink.git#master
git version 2.39.2
Cloning into '/home/tim/.platformio/.cache/tmp/pkg-installing-s34sw55g'...
warning: Could not find remote branch master to clone.
fatal: Remote branch master not found in upstream origin
Error: VCS: Could not process command ['git', 'clone', '--recursive', '--depth', '1', '--branch', 'master', 'https://github.com/Community-PIO-CH32V/tool-minichlink.git', '/home/tim/.platformio/.cache/tmp/pkg-installing-s34sw55g']

 *  The terminal process "platformio 'run', '--target', 'upload', '--environment', 'genericCH32V305RBT6', '--upload-port', '/dev/ttyACM0'" terminated with exit code: 1.

Seems a bit random when this is happening... Choosing "Run without debugging" seems to still upload. Hitting the upload button causes this error.

@tmolteno
Copy link

tmolteno commented Jun 15, 2023

I think the problem is that the branch is called "main". Modifying this in the line in the .platformio directory,

platforms/ch32v/platform.json:      "version": "https://github.com/Community-PIO-CH32V/tool-minichlink.git#master",

to

platforms/ch32v/platform.json:      "version": "https://github.com/Community-PIO-CH32V/tool-minichlink.git#main",

Allows the upload to proceed further. Uploading now works.

@maxgerhardt
Copy link
Member Author

Thanks for the info, I'll investigate this later.

@maxgerhardt
Copy link
Member Author

maxgerhardt commented Jun 15, 2023

Might already be fixed with 131d250, can you reinstall the platform cleanly?

rm -rf ~/.platformio/platforms/ch32v
rm -rf ~/.platformio/packages/tool-minichlink

And, this is not documented yet, but you need to have libusb installed with I think brew on Mac so that the program can startup at all.

@tmolteno
Copy link

Seems to work now. Thanks

@maxgerhardt
Copy link
Member Author

maxgerhardt commented Nov 15, 2024

Debugging inside Windows with minichlink partly working with cnlohr/ch32v003fun#444, load GDB command still broken. Expected to be fixed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working debugging
Projects
None yet
Development

No branches or pull requests

2 participants