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

Rework STM32H7x clocking configuration #15502

Merged
merged 3 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 10 additions & 0 deletions targets/TARGET_STM/TARGET_STM32H7/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,13 @@ target_include_directories(mbed-stm32h7
)

target_link_libraries(mbed-stm32h7 INTERFACE mbed-stm mbed-stm32h7cube-fw)


# Add clock file depending on the frequency
if("STM32H7_480MHZ" IN_LIST MBED_TARGET_LABELS)
target_sources(mbed-stm32h7 INTERFACE clock_cfg/TARGET_STM32H7_480MHZ/system_clock.c)
elseif("STM32H7_550MHZ" IN_LIST MBED_TARGET_LABELS)
target_sources(mbed-stm32h7 INTERFACE clock_cfg/TARGET_STM32H7_550MHZ/system_clock.c)
elseif("STM32H7_280MHZ" IN_LIST MBED_TARGET_LABELS)
target_sources(mbed-stm32h7 INTERFACE clock_cfg/TARGET_STM32H7_280MHZ/system_clock.c)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ target_include_directories(mbed-stm32h723xg
target_sources(mbed-stm32h723xg
INTERFACE
${STARTUP_FILE}
system_clock.c
)

mbed_set_linker_script(mbed-stm32h723xg ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ add_library(mbed-nucleo-h743zi2 INTERFACE)
target_sources(mbed-nucleo-h743zi2
INTERFACE
PeripheralPins.c
system_clock.c
)

target_include_directories(mbed-nucleo-h743zi2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,4 @@ add_subdirectory(TARGET_STM32H745xI_CM7 EXCLUDE_FROM_ALL)

add_library(mbed-stm32h745xi INTERFACE)

target_sources(mbed-stm32h745xi
INTERFACE
system_clock.c
)

target_link_libraries(mbed-stm32h745xi INTERFACE mbed-stm32h7)
206 changes: 0 additions & 206 deletions targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H745xI/system_clock.c

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,4 @@ add_subdirectory(TARGET_PORTENTA_H7 EXCLUDE_FROM_ALL)

add_library(mbed-stm32h747xi INTERFACE)

target_sources(mbed-stm32h747xi
INTERFACE
system_clock.c
)

target_link_libraries(mbed-stm32h747xi INTERFACE mbed-stm32h7)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ add_library(mbed-portenta-h7-m4 INTERFACE)
target_sources(mbed-portenta-h7-m4
INTERFACE
PeripheralPins.c
system_clock_override.c
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you remove this file ?

Copy link
Contributor Author

@multiplemonomials multiplemonomials May 7, 2024

Choose a reason for hiding this comment

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

Now the overriding that was done in this file can be done in targets.json, because now the STM32H7 system_clock.c files support a wide range of HSE_VALUEs

Copy link
Collaborator

Choose a reason for hiding this comment

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

But you change default configuration for this portenta board ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But, I added new stuff to targets.json that should replicate what this clock override file was doing

portenta_power.cpp
)

Expand All @@ -25,7 +24,6 @@ add_library(mbed-portenta-h7-m7 INTERFACE)
target_sources(mbed-portenta-h7-m7
INTERFACE
PeripheralPins.c
system_clock_override.c
portenta_power.cpp
)

Expand Down
Loading
Loading