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

Add support for modifying USB strings during runtime #3

Closed
wants to merge 3 commits into from

Conversation

jedrzejboczar
Copy link

This is to allow FX2 to set some USB strings that are being read from other devices.

@jedrzejboczar
Copy link
Author

Travis fails while linking boot-dfu because there is not enough RAM space, but I cannot reproduce this when building with exactly the same flags. Could it be related to SDCC version?

@whitequark
Copy link
Owner

whitequark commented Nov 29, 2019

You don't need any new code for this, just cast away the __code const qualifiers like here and replace them with __xdata. (Of course, this is only legal to do on the FX2, since 8051 code and xdata spaces don't have to address the same memory in general.)

That's a bit dirty, and perhaps it would be better to have all descriptors mutable and __xdata in the first place. But I think it should be one of those two options rather than adding any new code.

@jedrzejboczar
Copy link
Author

Thanks. This is of course much better solution. In fact I tried to do this, but missed the __xdata specifier. Should have known that with small memory model it is needed.

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.

None yet

2 participants