You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on an M0 device that is utilizing a Mentor Graphics USB controller. When trying to compile any of the examples the compilation fails highlighting that taking an address of packed struct can result in an unaligned memory access. Specifically for M0 unaligned memory accesses will result in hard faults.
I have been able to get the a subset of the examples working, but I had to hack the source to not utilize structs e.g. tusb_control_request_t and manipulate registers directly.
I have the intention of upstreaming support for this device, so even though these changes are functional, it is not my end goal for my project.
How to reproduce ?
Not reproducible since the target device is not currently supported.
Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
Not applicable, binary will not compile.
Screenshots
Compiler Error:
<TINYUSB_INSTALL_PATH>/src/portable/mentor/musb/dcd_musb.c:239:24: error: taking address of packed member of 'struct ' may result in an unaligned pointer value [-Werror=address-of-packed-member]
239 | uint32_t p = (void)&_dcd.setup_packet;
| ^~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
I have checked existing issues, dicussion and documentation
I confirm I have checked existing issues, dicussion and documentation.
The text was updated successfully, but these errors were encountered:
I am working on an M0 device that is not public yet. Once it is public I plan on sending a PR for the device so that the device will be supported in mainline.
Operating System
Linux
Board
N/A
Firmware
Any example will not build.
What happened ?
I am working on an M0 device that is utilizing a Mentor Graphics USB controller. When trying to compile any of the examples the compilation fails highlighting that taking an address of packed struct can result in an unaligned memory access. Specifically for M0 unaligned memory accesses will result in hard faults.
I have been able to get the a subset of the examples working, but I had to hack the source to not utilize structs e.g. tusb_control_request_t and manipulate registers directly.
I have the intention of upstreaming support for this device, so even though these changes are functional, it is not my end goal for my project.
How to reproduce ?
Not reproducible since the target device is not currently supported.
Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
Not applicable, binary will not compile.
Screenshots
Compiler Error:
<TINYUSB_INSTALL_PATH>/src/portable/mentor/musb/dcd_musb.c:239:24: error: taking address of packed member of 'struct ' may result in an unaligned pointer value [-Werror=address-of-packed-member]
239 | uint32_t p = (void)&_dcd.setup_packet;
| ^~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
I have checked existing issues, dicussion and documentation
The text was updated successfully, but these errors were encountered: