Skip to content

Conversation

@mathieuchopstm
Copy link
Contributor

#4184 introduced st,stm32-ccm and the associated /chosen/zephyr,ccm to support the ST-specific CCM (Core-Coupled Memory) found in STM32F3 and STM32F4 series SoCs, back when the more generic zephyr,dtcm did not exist (it was introduced later by #17123).

Fast-forward years of tree evolution, the CCM can now easily be supported as a zephyr,dtcm: move to this more sensible solution which requires less maintenance and allows cleaning up various warts across the tree.

samples/boards/st/ccm is kept to allow validation of the feature but really is vendor-agnostic now (besides wording) so it could be moved out of samples/boards (to where is up for debate...)

Compatibility:

  • out-of-tree boards: no build failure but linker warnings (warning: orphan section '.dtcm_noinit' from '...' being placed in section '.dtcm_noinit')
    • Leads to catastrophic runtime failures...
    • Fixed by a simple s/zephyr,ccm/zephyr,dtcm in DTS
  • aliases provided for __ccm_<...>_section type annotations
    • Allows building app as long as zephyr,dtcm is built properly
    • The macro is marked with __DEPRECATED_MACRO which allows finding and replacing usage easily
    • These backwards compatibility macros will be removed in the next release (v4.5)
  • no aliases provided for section symbols (e.g., __ccm_start), which should not have been used much if ever
    • Build error unknown identifier __ccm_<XXX> at use site

Rename the CCM memory region for STM32F3 and STM32F4 series such that the
CCM node can be used as a `zephyr,dtcm`.

Signed-off-by: Mathieu Choplain <[email protected]>
The STM32 CCM can be used as `/chosen/zephyr,dtcm` - transition all boards
to this chosen to allow deprecation/removal of the legacy `zephyr,ccm`.

Signed-off-by: Mathieu Choplain <[email protected]>
Update the ST CCM usage sample to be compatible with CCM as `zephyr,dtcm`.

Signed-off-by: Mathieu Choplain <[email protected]>
doc: dts: api: remove documentation of chosen `zephyr,ccm`

The `zephyr,ccm` chosen was an ST-specific property which has been replaced
by the generic `zephyr,dtcm`. Remove region initialization code from the
common arch init code (+ BSS zeroing from common XIP init code).

Signed-off-by: Mathieu Choplain <[email protected]>
Remove section names and symbols relating to the STM32 CCM region,
`/chosen/zephyr,ccm`, which is replaced by the standard DTCM region
`/chosen/zephyr,dtcm`.

For backwards compatibility, the old `__ccm_<...>_section` attribute
macros are aliased to `__dtcm_<...>_section` (until release 4.5).

Signed-off-by: Mathieu Choplain <[email protected]>
The `st,stm32-ccm` is now used though the generic DTCM mechanism: remove
all SoC-specific code which was used to implement support for it.

Signed-off-by: Mathieu Choplain <[email protected]>
The `zephyr,ccm` chosen was an ST-specific property which has been replaced
by the generic `zephyr,dtcm`. Remove it from the DTS documentation.

Signed-off-by: Mathieu Choplain <[email protected]>
Document remplacement of the ST-specific `zephyr,ccm` by `zephyr,dtcm`
along with actions to take in application code in the migration guide.

Signed-off-by: Mathieu Choplain <[email protected]>
@mathieuchopstm
Copy link
Contributor Author

Once this PR is merged, I will open the backwards compatibility macros removal PR for v4.5.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 5, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants