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 cmake refactor #13

Closed
wants to merge 5 commits into from
Closed

Stm32 cmake refactor #13

wants to merge 5 commits into from

Conversation

safesintesi
Copy link
Collaborator

@safesintesi safesintesi commented Dec 19, 2023

Fixes #12 .

FetchContent with low connection would waste time downloading the libraries.
A Flag not for FAT would force it to download freeRTOS-kernel a second time leading to a waste of time.
Since those repos are already includes through submodules, downloading is redundant.
This fix takes the configuration time down from minutes to ~0.7s.

With the occasion I refactored the Cmake file structure to fix some link dependencies and some flags:

  • Added targets for drivers and core
  • Fixed some libraries link
  • Defined STM32F411xE as default build in Drivers/CMSIS/.../stm32f4xx.h

This now builds with cmake but needs a tweek on FAT repo.
A pull request has been already made & changes are accepted and waiting to be merged:
FreeRTOS/Lab-Project-FreeRTOS-FAT#59

Edit: Also needs Cmake version bump to 3.18

Edit:

  • FAT pull request has been merged and now this repo has updated the submodule.
  • We want to fix the Thread lib too since we're at it, so this won't be merged until we solve the issue.

Added targets for drivers and core
Fixed some libraries link
Defined STM32F411xE as default build in
Drivers/CMSIS/.../stm32f4xx.h

This now builds with cmake but needs a tweek on FAT repo
A pull request has been already made:
FreeRTOS/Lab-Project-FreeRTOS-FAT#59
@BIRSAx2
Copy link

BIRSAx2 commented Dec 19, 2023

As of now, your pull request to the FAT repo has not been merged. I'll wait to review it until then because, as it stands, the project doesn't build.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did not include the Startup/startup_stm32f411xe.s file in the build, which specifies, among other things, the initial PC and sets the CPU in Thread mode.
As a result, the build throws the following warning: warning: cannot find entry symbol Reset_Handler; defaulting to 08000000.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, that file wasn't included even on the original cmake structure on stm32 branch. I'll fix it this afternoon.

@BIRSAx2
Copy link

BIRSAx2 commented Dec 20, 2023

I've reviewed the code, and it looks good overall.
The only issues I found are already mentioned: the inclusion of "startup_stm32f411xe.s," and the dependency on the FAT repo's pull request.
Once these are addressed, we can proceed with the merge. If there are delays with FAT repo, considering a fork might be a viable option. Thanks!

@safesintesi
Copy link
Collaborator Author

@BIRSAx2 Should be good now, can you please check?

@safesintesi safesintesi added the enhancement New feature or request label Dec 21, 2023
@safesintesi
Copy link
Collaborator Author

@gekoxyz seems like this is not the only step to take to fix the Thread issue.
I suggest keeping this pull request for the original purpose (fixing the FetchContent redundancy) and opening a new one for the linux port.
To do this we should revert the last changes, before merging and closing the pull request.

Copy link

@BIRSAx2 BIRSAx2 Dec 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the file task_gianluca.h has been deleted in this pull request. However, the build doesn't compile without it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On top of that, the previous two tasks Task1 and Task2 are not running when building with CMake (the led is not blinking), while they do when building with STM32CubeIDE

@MarcoTomma98 MarcoTomma98 deleted the stm32_cmake_refactor branch November 1, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Configuration time takes ~6 mins with cmake
3 participants