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

Integration of H5 family #320

Merged
merged 16 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
family: [F0, F1, F2, F3, F4, F7, G0, G4, H7, L0, L1, L4, L5, U5, WB, WL, MP1]
family: [H5]
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is incorrect. H5 need to be added without removing others. I suppose it was for tests

fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion cmake/stm32/common.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(STM32_SUPPORTED_FAMILIES_LONG_NAME
STM32F0 STM32F1 STM32F2 STM32F3 STM32F4 STM32F7
STM32G0 STM32G4
STM32H7_M4 STM32H7_M7
STM32H5 STM32H7_M4 STM32H7_M7
STM32L0 STM32L1 STM32L4 STM32L5
STM32U5
STM32WB_M4 STM32WL_M4 STM32WL_M0PLUS
Expand Down
23 changes: 23 additions & 0 deletions cmake/stm32/h5.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
set(STM32_H5_TYPES
H503xx H562xx H563xx H573xx
)

set(STM32_H5_TYPE_MATCH
"H503.." "H562.." "H563.." "H573.."
)
set(STM32_H5_RAM_SIZES
32K 640K 640K 640K
)
set(STM32_H5_CCRAM_SIZES
0K 0K 0K 0K
)

stm32_util_create_family_targets(H5)

target_compile_options(STM32::H5 INTERFACE
-mcpu=cortex-m33 -mfloat-abi=hard -mfpu=fpv5-d16 -mthumb
)

target_link_options(STM32::H5 INTERFACE
-mcpu=cortex-m33 -mfloat-abi=hard -mfpu=fpv5-d16 -mthumb

Choose a reason for hiding this comment

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

What is the source information for using fpv5-d16 FPU?

I was kinda not sure how to find this out so I opted to let STM32CubeMx generate an empty makefile project for STM32H5 and checked it's compiler options. CubeMx used fpv4-sp-d16 there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I could not find the answer easily. For what I can tell https://www.st.com/resource/en/programming_manual/pm0264-stm32-cortexm33-mcus-programming-manual-stmicroelectronics.pdf states that m33 devices support fpv5 instructions...
Not quite sure for this one... @atsju any input ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry for delay. I don't have much time right now so I just answer the question here.

I have read this and others: https://community.st.com/t5/stm32cubemx-mcus/bug-in-cubemx-generating-makefile-missing-some-cpu-info/m-p/110239

For me correct answer is fpv5-sp-d16. v5 as pointed out by @Hish15 but sp only as cubeMx and datasheets stating it's single point FPU. Do not hesitate to redo a test with latest cubeMx and to ask ST

)
8 changes: 4 additions & 4 deletions cmake/stm32/utilities.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ endfunction()
include(FetchContent)

# A CMSIS or HAL driver can specify 'cube' as version number to indicate that the driver is taken from the Cube repository
set(STM32_FETCH_FAMILIES F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4 L5 MP1 U5 WB WL )
set(STM32_FETCH_CUBE_VERSIONS v1.11.2 v1.8.4 v1.9.3 v1.11.2 v1.26.1 v1.16.1 v1.4.1 v1.4.0 v1.9.0 v1.12.0 v1.10.3 v1.17.0 v1.4.0 1.5.0 v1.0.0 v1.12.0 v1.1.0)
set(STM32_FETCH_CMSIS_VERSIONS v2.3.5 v4.3.3 v2.2.5 v2.3.5 v2.6.6 v1.2.6 v1.4.0 v1.2.1 v1.10.0 v1.9.1 v2.3.2 v1.7.1 v1.0.4 cube v1.0.0 v1.9.0 v1.1.0)
set(STM32_FETCH_HAL_VERSIONS v1.7.5 v1.1.8 v1.2.7 v1.5.5 v1.7.12 v1.2.9 v1.4.1 v1.2.1 v1.10.0 v1.10.4 v1.4.4 v1.13.0 v1.0.4 cube v1.0.0 v1.9.0 v1.1.0)
set(STM32_FETCH_FAMILIES F0 F1 F2 F3 F4 F7 G0 G4 H5 H7 L0 L1 L4 L5 MP1 U5 WB WL )
set(STM32_FETCH_CUBE_VERSIONS v1.11.2 v1.8.4 v1.9.3 v1.11.2 v1.26.1 v1.16.1 v1.4.1 v1.4.0 v1.0.0 v1.9.0 v1.12.0 v1.10.3 v1.17.0 v1.4.0 1.5.0 v1.0.0 v1.12.0 v1.1.0)
set(STM32_FETCH_CMSIS_VERSIONS v2.3.5 v4.3.3 v2.2.5 v2.3.5 v2.6.6 v1.2.6 v1.4.0 v1.2.1 v5.6.0 v1.10.0 v1.9.1 v2.3.2 v1.7.1 v1.0.4 cube v1.0.0 v1.9.0 v1.1.0)
set(STM32_FETCH_HAL_VERSIONS v1.7.5 v1.1.8 v1.2.7 v1.5.5 v1.7.12 v1.2.9 v1.4.1 v1.2.1 v1.0.0 v1.10.0 v1.10.4 v1.4.4 v1.13.0 v1.0.4 cube v1.0.0 v1.9.0 v1.1.0)

FetchContent_Declare(
STM32-CMSIS
Expand Down
16 changes: 16 additions & 0 deletions docs/MAINTAIN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Supporting new families

## Write device file

a file <family>.cmake must be added to the folder cmake/stm32
This file containes the differents devices and the regex used to parse them.
It also give information on the RAM and CCRAM available

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Maintainer must check than Flash sizes correspond to usual suffix. Some families have exceptions.
  • add the suffix or hint file containing the sufix to size code

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can you make a suggestion with all the changes you want here ?

## Add family to list of know families

Update the list `STM32_SUPPORTED_FAMILIES_LONG_NAME` located in the cmake/stm32/common.cmake file


Hish15 marked this conversation as resolved.
Show resolved Hide resolved
## Add family to CI

Update the cmake.yml workflow file to include the new family
atsju marked this conversation as resolved.
Show resolved Hide resolved