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

[stm32] Fix linkerscript veneer offset issues #763

Merged
merged 2 commits into from
Oct 25, 2021

Conversation

chris-durand
Copy link
Member

@chris-durand chris-durand commented Oct 23, 2021

There is a linkerscript bug that can cause code placed in RAM to be loaded to the wrong address because alignment is ignored. By chance the bug showed on some F0/L0 after the delete stub implementations were added 9 days ago.

We could reproduce the bug with the blink examples on F042, F030 and L031 devices but more devices are affected. It caused the delay to run with random durations. The instructions loading modm::platform::delay_fcpu_MHz from ram to a register were never executed.

This bug was most likely introduced in the last linkerscript refactoring in July.

Thanks to @salkinium for coming up with the fix after it was clear what the issue was.

@salkinium salkinium added this to the 2021q4 milestone Oct 23, 2021
@salkinium salkinium force-pushed the fix/linker branch 2 times, most recently from 81340c9 to 1b41daf Compare October 23, 2021 23:35
@salkinium salkinium added the ci:hal Triggers the exhaustive HAL compile CI jobs label Oct 23, 2021
@salkinium
Copy link
Member

I still need to validate this for all other devices, so not merging yet.

@salkinium salkinium added ci:hal Triggers the exhaustive HAL compile CI jobs and removed ci:hal Triggers the exhaustive HAL compile CI jobs labels Oct 25, 2021
@salkinium
Copy link
Member

Validated in hardware on all linkerscripts variants.
I also cleaned up some things in the templates so that looking at the generated linkerscripts is a little less painful.

@salkinium salkinium merged commit b78acd5 into modm-io:develop Oct 25, 2021
@chris-durand chris-durand deleted the fix/linker branch October 25, 2021 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced 🤯 ci:hal Triggers the exhaustive HAL compile CI jobs fix 💎
Development

Successfully merging this pull request may close these issues.

2 participants