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

Some IO ranges only work with 32-bit access #9

Open
BBBSnowball opened this issue May 7, 2021 · 0 comments
Open

Some IO ranges only work with 32-bit access #9

BBBSnowball opened this issue May 7, 2021 · 0 comments

Comments

@BBBSnowball
Copy link

Byte access to the IO ranges only works for the lowest 8-bit of a 32-bit word. So far, I have only seen this bug on SYSCON_IOPAD and GPIO (because I haven’t used any others). Those will usually be accessed by whole word so the bug isn’t really a problem in practice. I have only noticed this because Python seems to access the memory with memcpy. Nonetheless, I think you should consider fixing it. Depending on which bus interface is used, the fix could be very simple and it may even make the logic slightly smaller. If it isn't fixed, workarounds like this are necessary. This function could be a one-liner without the workaround.

Here is a proof of concept for the bug. The output for my board is here. Usage: make && ./bug-ioaccess-byte. This reconfigures FUNC_SHARE[1:0] so make sure that nothing is connected to GPIO0 and GPIO1 on the pin header - just to be sure.

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

1 participant