Read or set MCU SRAM_CODE_MODE#113
Open
laoo wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
I know how it looks.
Yes, I don't have a clue how to program in rust and yes it is vibe coded.
But I just needed to be able to switch between various memory split models using wlink just like official WCH tools are able to.
So I plugged WCH-link to my USB Packet viewer, connected a devboard with CH32V307 and dumped transmission from few sets and gets of memory assignments.
Then I chatted with GPT-5.3-Codex and it parsed the logs, broke down the transmission, found that for this function is responsible a pair of 0x0d/0x17 and 0x0d/0x18 commands and added implementation of new
mem-splitCLI command.I tested it on a bunch of CH32V30X chips I have and it works. I don't have CH32V20X so I don't know how it will behave there, especially as GPT decided to use old 0x0d/0x04 and 0x0d/0x05 commads documented in protocol.md for it.
If someone would like to test it I made a release on my fork.
I have no idea whether it resulted with a good rust so I won't be worried if this PR will be declined but it would be great to add such function to main based on my research. I can add dumps of USB comminication and scripts to parse it when needed.
In case of a review I'd be happy to help but only I can do is to give it to the chat and hope that it will produce something ok-ish enough, as I said I don't speak rust :)