Skip to content

Conversation

@lukash
Copy link
Contributor

@lukash lukash commented Mar 29, 2025

I mainly went to add the serialized data length, but thought I'd fix some error handling when touching that part. I can split it off if needed.

The error handling motivation is primarily for the vesc_tool --xmlConfToCode ... to fail on errors. Right now it will generate the files even if there are errors and the user will likely not notice in the build output, meaning they find out after some time wasted investigating why the code doesn't work.

Regarding the serialized data length: I changed my package config storing to EEPROM to use the confparser serialization to save space. It works well (and saves over 40%), the only hurdle is there is no information about the size of the buffer needed, and with the current API it's not possible to check if the buffer is long enough. On write, I can recognize it after the fact (random memory was overwritten, very bad), on read I can't tell at all.

I thought it'd be easy to add the size (so that I can allocate the exact size for the buffer), but there are variable length strings in the config. AFAIK these are not supported in Custom Config, so that's one thing. The strings have the maxLength attribute, I used it, but looking at how it's handled, it seems it can be 0 too. I haven't entirely found if and when exactly the maxLength is enforced, and what's the situation when it's 0. Any advice, what do you think?

@vedderb vedderb merged commit e04f6f8 into vedderb:master Mar 30, 2025
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 30, 2025
@lukash lukash deleted the config-serialization branch October 17, 2025 15:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants