-
Notifications
You must be signed in to change notification settings - Fork 339
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
Default STM32_CUBE_family_PATH is not being set #240
Comments
Thank you for reporting this issue. It may be linked to a recent merge of #226. I had no issue running on windows. just for notification: @rmspacefish |
Message Changes to cmake: message("Before First If: " ${STM32_CUBE_${FAMILY}_PATH})
if((NOT STM32_CMSIS_${FAMILY}_PATH) AND (NOT STM32_CUBE_${FAMILY}_PATH))
set(STM32_CUBE_${FAMILY}_PATH $ENV{STM32_CUBE_${FAMILY}_PATH} CACHE PATH "Path to STM32Cube${FAMILY}")
endif()
message("After First If: " ${STM32_CUBE_${FAMILY}_PATH})
if((NOT STM32_CMSIS_${FAMILY}_PATH) AND (NOT STM32_CUBE_${FAMILY}_PATH))
set(STM32_CUBE_${FAMILY}_PATH /opt/STM32Cube${FAMILY} CACHE PATH "Path to STM32Cube${FAMILY}" )
message(STATUS "Neither STM32_CUBE_${FAMILY}_PATH nor STM32_CMSIS_${FAMILY}_PATH specified using default STM32_CUBE_${FAMILY}_PATH: ${STM32_CUBE_${FAMILY}_PATH}")
endif()
message("End: " ${STM32_CUBE_${FAMILY}_PATH}) Messages Without Fixes: Before First If:
After First If:
-- Neither STM32_CUBE_F4_PATH nor STM32_CMSIS_F4_PATH specified using default STM32_CUBE_F4_PATH:
End: Messages With Fixes: Before First If:
After First If:
-- Neither STM32_CUBE_F4_PATH nor STM32_CMSIS_F4_PATH specified using default STM32_CUBE_F4_PATH: /opt/STM32CubeF4
End: /opt/STM32CubeF4 |
Thank you very much. |
I did not account for the ENV variable being empty. I might look into checking the existence of It might also be a good idea to check whether |
@BenArtes Side note about the PR: I think you misconfigured your email address localy. Github doesn't see "you" as author of commit. |
Updated the PR, to use defined envs, and check path for existence. Also updated local email address. |
Describe the bug
After a clean clone of this repository, I installed the STM32CubeF4 drivers to /opt/STM32CubeF4 and tried to build the blinky example. Instead of using the default path I was met with an error indicating that a blank path was being used and that CMSIS could NOT be found:
In FindCMSIS.cmake lines 74-81 there are two attempts to set
STM32_CUBE_${family}_PATH
, first from an ENV variable, then from the default value. Both use cmake'sset(... CACHE PATH)
and I'm wondering if the first attempt to set from the ENV variable is preventing the default from succeeding.Two different modifications to this file worked, but I'm not sure which is preferred:
1) Checking ENV variable before attempting to set STM32_CUBE_${FAMILY}_PATH
2) Forcing Default Setting using set's FORCE optional
A similar code is located in FindHAL.cmake Line74-81 and FinaBSP.cmake Lines 265-272, though these don't seem to cause the same issue.
I'm happy to create a pull request with these changes once I know which files to change and the preferred solution.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: