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

Ram corruption #15

Open
fabiodl opened this issue Apr 16, 2021 · 1 comment
Open

Ram corruption #15

fabiodl opened this issue Apr 16, 2021 · 1 comment

Comments

@fabiodl
Copy link

fabiodl commented Apr 16, 2021

Here is the result of 3 days of head scratching (huge thanks for this project, btw!) ;)

USBHost.c has

__at(0x0000) unsigned char __xdata RxBuffer[MAX_PACKET_SIZE];
__at(0x0100) unsigned char __xdata TxBuffer[MAX_PACKET_SIZE];

but the SDCC manual (page 42) reports
The compilerdoesnotreserve any space for variables declared in this way (they are implemented with an equate in the assembler).
and indeed I had memory corruption.

__at(0x0000) unsigned char __xdata RxBuffer[MAX_PACKET_SIZE]={0};
__at(0x0100) unsigned char __xdata TxBuffer[MAX_PACKET_SIZE]={0};

fixes it

@atc1441
Copy link
Owner

atc1441 commented Apr 16, 2021

Thank you :)

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