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

Align trajectory memory #1282

Merged
merged 1 commit into from
May 22, 2023
Merged

Align trajectory memory #1282

merged 1 commit into from
May 22, 2023

Conversation

krichardsson
Copy link
Contributor

This PR alignes the trajectory memory on 4 byte boundaries. This fixes a part of a problem that has become visible with V12 of the compiler.
The root problem is that the trajectory memory is defined as a uint8 array, when a trajectory is read, a pointer into the array is cast to a struct containing floats. Floats must be aligned and If the array is not aligned properly we get a hardfault. Most likely the array has (by chance) been aligned by the old compiler, but V12 does not and we get a hard fault.

There is still a secondary problem that this fix does not solve. It is possible to upload trajectories to an abitrary offset which can still mess up the alignment

@ataffanel ataffanel marked this pull request as ready for review May 22, 2023 11:16
@ataffanel ataffanel merged commit c492537 into master May 22, 2023
@ataffanel ataffanel deleted the krichardsson/traj-alignment branch May 22, 2023 11:16
@krichardsson krichardsson added this to the 2023.06 milestone Jul 3, 2023
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.

2 participants