Skip to content

Add support for S32K148 SoC #509

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 5 commits into
base: master
Choose a base branch
from

Conversation

marcin-wierzbicki
Copy link
Contributor

@marcin-wierzbicki marcin-wierzbicki commented Feb 11, 2025

Add support for S32K148 SoC.

Drivers enabled: SYSMPU, GPIO, PORT, LPUART, ADC, FlexCAN, FTM, RTC, LMEM, WDOG, ENET.

@mmahadevan108
Copy link
Collaborator

mmahadevan108 commented Feb 11, 2025

Have the changes to the SDK drivers sent to the SDK team? Here is the repo incase this has not been submitted to the SDK driver.
https://github.com/nxp-mcuxpresso/mcux-sdk

@marcin-wierzbicki
Copy link
Contributor Author

Have the changes to the SDK drivers sent to the SDK team? Here is the repo incase this has not been submitted to the SDK driver. https://github.com/nxp-mcuxpresso/mcux-sdk

Thanks. We will take care of that (@KevShaju)

@marcin-wierzbicki marcin-wierzbicki force-pushed the s32k148_support_pr branch 2 times, most recently from 757c89a to e3b7e81 Compare February 23, 2025 20:32
@marcin-wierzbicki
Copy link
Contributor Author

marcin-wierzbicki commented Feb 23, 2025

@manuargue I managed to generate OsIf, clocks, and SoC related code using S32DS IDE with support for S32K1 + RTD for S32K1. Please, check.

@manuargue BTW If someone needed to adjust the configuration in the future, would they follow the same steps, or is there a recommended approach to ensure consistency? I’m wondering if there’s a way to make future modifications smoother, perhaps by retaining certain files as input or documenting key aspects of the process. I’d appreciate any thoughts you might have on this.

@manuargue
Copy link
Member

@manuargue I managed to generate OsIf, clocks, and SoC related code using S32DS IDE with support for S32K1 + RTD for S32K1. Please, check.

please split the changes into separate commits, e.g.:

  • adaptions to ADC headers
  • adaptions to ENET headers
  • adaptions to FlexCAN headers
  • generated SoC HAL code
  • patches over generated SoC HAL code
  • MCUX device glue code

Kindly write a small mention in https://github.com/zephyrproject-rtos/hal_nxp/blob/master/s32/README#L40-L44 of all patches applied to the original HAL headers/sources, in each respective commit. Some of them, like FTM and FlexCAN patches, were already mentioned.

@manuargue BTW If someone needed to adjust the configuration in the future, would they follow the same steps, or is there a recommended approach to ensure consistency? I’m wondering if there’s a way to make future modifications smoother, perhaps by retaining certain files as input or documenting key aspects of the process. I’d appreciate any thoughts you might have on this.

Great question. Above approach of splitting commits and documenting patches will ease keeping track of changes over time and roll back if needed, and should help at some extent to understand how the sources were added. Using both the RTD and MCUX drivers for the S32 devices is quite challenging and so far NXP have been taking care of doing the bring up of new boards. We are looking for ways to streamline the process and eventually document it.

@marcin-wierzbicki
Copy link
Contributor Author

@manuargue : please check

@manuargue
Copy link
Member

Changes LGTM. NXP is discussing internally these changes. I'll get back to you as soon as there is a resolution.

Copy link
Member

@manuargue manuargue left a comment

Choose a reason for hiding this comment

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

Merge branch 'zephyrproject-rtos:master' into s32k148_support_pr

Pls do not add merge commits (9ce54c0). Use rebase instead.
https://docs.zephyrproject.org/latest/contribute/contributor_expectations.html#pr-requirements

marcin-wierzbicki and others added 5 commits June 2, 2025 08:18
Configuration generated with S32 Design Studio for S32 Platform,
including Real-Time Drivers package for S32K148.

Signed-off-by: Marcin Wierzbicki <[email protected]>
Add S32K148 device definitions and overlays in order to reuse
existing MCUX SDK drivers on this SoC.
Drivers enabled:
SYSMPU, GPIO, PORT, LPUART, ADC, FlexCAN, FTM, RTC, LMEM, WDOG, ENET.

Signed-off-by: Marcin Wierzbicki <[email protected]>
In order to reuse existing device header with MCUX SDK ADC driver,
it is needed to rename these fields:
- CV[ADC_CV_COUNT] -> CV1,CV2
- ASC1X,SC1[ADC_SC1ZZ_COUNT] -> SC1[ADC_SC1_COUNT]
- ARX,R[ADC_RZZ_COUNT] -> R[ADC_R_COUNT]

Signed-off-by: Marcin Wierzbicki <[email protected]>
In order to reuse existing device header with MCUX SDK FLEXCAN driver
rename WMBn_CS -> CS, WMBn_ID -> ID, WMBn_D03 -> D03, WMBn_D47 -> D47.

Signed-off-by: Marcin Wierzbicki <[email protected]>
In order to reuse existing device header with MCUX SDK ENET driver,
rename IP_ENET_BASE_PTRS -> ENET_BASE_PTRS and add missing ENET macros.

Signed-off-by: Kevin Shaju <[email protected]>
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.

5 participants