Skip to content

Add STM32MP2 support #282

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

youssefz24
Copy link

This PR adds *-pinctrl.dtsi, HAL and LL files for the STM32MP2xx series

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

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

See comments.

Otherwise, initial commit is too large to be practically reviewed.
Would you be able to split into at least another commit which introduces the common ll part ?

Regarding the -pinctrl.dtsi, there is a change being merged, so it would be required that you generate a new batch based on #279.

Thanks!

Comment on lines 67 to 71
<<<<<<< HEAD
stm32mp13x
=======
stm32mp2x
>>>>>>> 2c2a354d (CMakeLists.txt: add stm32mp2x and cm33)
Copy link
Member

Choose a reason for hiding this comment

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

Clean this conflict

Copy link
Author

Choose a reason for hiding this comment

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

Done

Comment on lines 38 to 50
--> please check that the following list is still valid:

* Initial version

See release_note.html from STM32Cube
Copy link
Member

Choose a reason for hiding this comment

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

Minimum required changes in initial coimmit should be:

*Changes from official delivery:
-dos2unix applied
-trailing white spaces removed

Then (could be done in another commit):
*Provision to enable hal & ll asserts added
-Added stm32cube/stm32n6xx/drivers/include/stm32_assert.h
-Removed unused stm32cube/stm32n6xx/drivers/include/stm32_assert_template.h

Finally (could be done in another commit)
*Fix to remove PAGESIZE definition which conflicts with POSIX
Impacted files:
drivers/include/Legacy/stm32_hal_legacy.h

#define HAL_DCACHE_MODULE_ENABLED
#define HAL_DCMI_MODULE_ENABLED
#define HAL_DCMIPP_MODULE_ENABLED
/* #define HAL_DDR_MODULE_ENABLED */
Copy link
Member

Choose a reason for hiding this comment

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

If this differs from HAL, this should be documented in README.

Copy link
Author

Choose a reason for hiding this comment

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

This actually is the same in the STM32CubeMP2 repo.
Should I mention this too in the README ?

#define HAL_HSEM_MODULE_ENABLED
#define HAL_I2C_MODULE_ENABLED
#define HAL_I2S_MODULE_ENABLED
/* #define HAL_I3C_MODULE_ENABLED */ /* Disabled because I3C HAL not available yet */
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

Copy link
Author

Choose a reason for hiding this comment

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

Same here.

#define HAL_IWDG_MODULE_ENABLED
#define HAL_LPTIM_MODULE_ENABLED
#define HAL_LTDC_MODULE_ENABLED
// #define HAL_LVDS_MODULE_ENABLED
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Copy link
Author

Choose a reason for hiding this comment

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

I added it to the README as advised. :)

@arnopo arnopo self-requested a review May 22, 2025 09:37
@arnopo
Copy link
Contributor

arnopo commented May 22, 2025

To split commits you can have a look to #266 as example.

Provide the stm32cube HAL and LL for the stm32mp2x series mcu
Origin: ST Microelectronics
License: BSD-3-Clause
URL: https://github.com/STMicroelectronics/STM32CubeMP2
Commit: 1b1ff6b48df3c9b7417ac411dbd8dfd097f0bb04
Purpose: HAL and LL for stm32mp2
Maintained-by: External

Signed-off-by: Youssef Zini <[email protected]>
Disable the lvds module in the stm32mp2xx HAL because it is not
available.

Signed-off-by: Youssef Zini <[email protected]>
Add CMakeLists.txt to enable support of the hal and ll files for the
stm32mp2x series MCU as zephyr libraries.

Signed-off-by: Youssef Zini <[email protected]>
Add the stm32mp2x to the supported soc series.
Add the cortex-m33 to the zephyr compile definitions.

Signed-off-by: Youssef Zini <[email protected]>
Regenerate the ll headers to include the stm32mp2xx series

Signed-off-by: Youssef Zini <[email protected]>
Add the pinctrl address for stm32mp2 soc family to generate the
*-pinctrl.dtsi files.

Signed-off-by: Youssef Zini <[email protected]>
Add the pinctrl files for stm32mp2 soc series. These files are generated
from the open pin data repository, a subset of official release
STM32CubeMX 6.14.0, using the genpinctrl.py script.

Origin: ST Microelectronics
License: BSD-3-Clause
URL: https://github.com/STMicroelectronics/STM32_open_pin_data
Commit: 5e641448dc7df619ee46bb0c91796b7626005929
Purpose: *-pinctrl.dtsi for stm32mp2
Maintained-by: External

Signed-off-by: Youssef Zini <[email protected]>
@youssefz24 youssefz24 force-pushed the topic/stm32mp2_support branch from 1909a48 to 86c2658 Compare May 23, 2025 16:31
@youssefz24 youssefz24 requested a review from erwango May 23, 2025 16:37
youssefz24 added a commit to youssefz24/zephyr that referenced this pull request May 23, 2025
Update west.yml to add the STM32MP2x SoC support in the STM32 HAL.
This depends on the followin Pull Request:
zephyrproject-rtos/hal_stm32#282

Signed-off-by: Youssef Zini <[email protected]>
@erwango erwango dismissed their stale review May 28, 2025 13:30

Dismissing in order not to block PR next week

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

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

Successfully merging this pull request may close these issues.

3 participants