Skip to content

STM32 opt file makes code analizer to fail #1534

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

Closed
jantje opened this issue Dec 12, 2022 · 2 comments
Closed

STM32 opt file makes code analizer to fail #1534

jantje opened this issue Dec 12, 2022 · 2 comments

Comments

@jantje
Copy link
Member

jantje commented Dec 12, 2022

When the code analizer runs when the target folder (Release) does not exist the code analizer returns an error and fall back to defaults making the indexer mis lots of knowledge.
The root cause is the opt file that is copied to Release/sketch/opt during the pre build step. Therefore the file is not guaranteed to exists and the code analizer may fail.
As there is no easy way to start the code analizer this is pretty annoying.
This issue is found as part of #1491

@jantje
Copy link
Member Author

jantje commented Dec 12, 2022

If you do not use the opt file (a file to allow for additional compile options) you can try following workaround
Modify platform.txt
replace
compiler.extra_flags=-mcpu=${build.mcu} ${build.fpu} ${build.float-abi} -DUSE_FULL_LL_DRIVER -mthumb "@${build.opt.path}"
with
compiler.extra_flags=-mcpu=${build.mcu} ${build.fpu} ${build.float-abi} -DUSE_FULL_LL_DRIVER -mthumb
and
replace
recipe.hooks.prebuild.1.pattern="${runtime.tools.STM32Tools.path}/win/busybox.exe" sh "${extras.path}/prebuild.sh" "${build.path}" "${build.source.path}" "${runtime.platform.path}"
with
#recipe.hooks.prebuild.1.pattern="${runtime.tools.STM32Tools.path}/win/busybox.exe" sh "${extras.path}/prebuild.sh" "${build.path}" "${build.source.path}" "${runtime.platform.path}"
after modification do the steps to propagate the change through the caches described here #1533

@jantje
Copy link
Member Author

jantje commented Jan 16, 2023

This one seems fixed :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant