-
Notifications
You must be signed in to change notification settings - Fork 127
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
unaligned access #17
Comments
Hi @dipsie84 . The address of nx_packet_prepend_ptr is required to be 4 bytes aligned for both IP and TCP header. Did you encounter real issue for unaligned access? |
Yes. I ported the "getting started" example from B-L475E-IOT01A to NUCLEO-H723ZG board. Connection to Azure IoT Hub fails with Hard fault on that line since nx_packet_prepend_ptr is 2B- aligned but not 4B-. |
There might be something not configured correctly. Please check the followings.
If the problem still exists, could you please dump the memory between |
Ok, I missed the |
The line
https://github.com/azure-rtos/netxduo/blob/f66451ca193a96b5734e9a99d6d0ed9de44c9ac5/common/src/nx_tcp_socket_packet_process.c#L109
might trigger an Hard fault because of "Unaligned access to memory" on some processors (eg. STM32H7 family).
Suggested workaround:
memcpy(&tcp_header_copy, packet_ptr -> nx_packet_prepend_ptr, sizeof(tcp_header_copy));
The text was updated successfully, but these errors were encountered: