Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 15 additions & 18 deletions scripts/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Introduction:

This module provides scripts to update the STM32Cube for Zephyr.
Follow below steps to update the STM32Cube HAL from the latest
version found in STM32CubeXX repositories.
versions found in STM32CubeXX repositories.

Step 1: Modify the code
***********************
Expand All @@ -18,15 +18,13 @@ Alternatively, in order to update STM32CubeXX versions one by one, run for examp

$ python3 ./update_stm32_package.py -s stm32f1

Note: This requires $ZEPHYR_BASE is set in your environment.

Check STM32CubeXX changes
=========================

Check that all existing change to modules are correctly reported
in the new hal_stm32 version
Check that all existing changes to modules are correctly reported
in the new hal_stm32 version.

Update each modified stm32cube/stm32XXxx/README in the last section,
Update each modified stm32cube/stm32XXxx/README file in their last section.

Remove the following line::
--> please check that the following list is still valid:
Expand All @@ -38,34 +36,33 @@ Step 2: Open a pull requests
hal_stm32 PR
============
Open a single pull request with 1 commit per stm32 familly (stm32xx)
in repo https://github.com/zephyrproject-rtos/hal_stm32
in repo https://github.com/zephyrproject-rtos/hal_stm32.


Modify the west.yml
===================
In order to benefit from this PR in zephyr, modify zephyrproject/zephyr/west.yml
so that hal_stm32 points to above pull request. Example::
In order to benefit from this pull request in Zephyr, modify
zephyrproject/zephyr/west.yml
so that hal_stm32 points to the above pull request. For example::

- name: hal_stm32
revision: pull/60/head
path: modules/hal/stm32


Open a 2nd pull request with west.yml in repo
https://github.com/zephyrproject-rtos/zephyr
https://github.com/zephyrproject-rtos/zephyr.


Step 3: After Merge
*******************

re-Modify the west.yml
Re-Modify the west.yml
======================

Once the hal_stm32 pull request is merged (see step 2), in the zephyrproject-rtos/hal_stm32

then change again the zephyrproject-rtos/zephyr/west.yml

to reflect the actual zephyrproject-rtos/hal_stm32 SHA1, example::
repo, change again the zephyrproject-rtos/zephyr/west.yml
to reflect the actual zephyrproject-rtos/hal_stm32 latest commit SHA1, for example::

- name: hal_stm32
revision: a813cd83b0cfbaaa625f4941d04baa3f93c37476
Expand All @@ -77,12 +74,12 @@ COMMENT:

- "set the SHA1 after merge of STM32Cube versions (modules/hal/stm32)"

See Example : https://github.com/zephyrproject-rtos/zephyr/pull/23259
See for example https://github.com/zephyrproject-rtos/zephyr/pull/23259.


clean
Clean
=====
once all is correct, clean .rej and .log files, with :
Once all is correctly merged, clean .rej and .log files, with :

::

Expand Down
37 changes: 13 additions & 24 deletions scripts/serie_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,32 +507,21 @@ def update_cmakelist(self):
if "_hal_rcc" in filename.name:
continue

if "_hal_" in filename.name:
# retrieve IP name from filename, like adc,
# which is delimited by
# * _hal_ on one side
# * and file extension on the other side
pattern = r".*_hal_(.*)\..*"
# Retrieve driver name from filename, like adc, spi, ...
# which is delimited by _ll_ or _hal_ or _util_ on the left side
# and file extension on the right side.
# If matching, make it be built upon its related config symbol.
pattern = re.compile(r".*_(ll|hal|util)_(.*)\..*")
match = pattern.match(filename.name)
if match:
drv_type = match.group(1)
drv_name = match.group(2)
cmakelists_new.write(
"zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_"
+ re.sub(pattern, r"\1", filename.name).upper()
+ " drivers/src/"
+ filename.name
+ ")\n"
)
if "_ll_" in filename.name:
# retrieve IP name from filename, like adc,
# which is delimited by
# * _ll_ on one side
# * and file extension on the other side
pattern = r".*_ll_(.*)\..*"
cmakelists_new.write(
"zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_"
+ re.sub(pattern, r"\1", filename.name).upper()
+ " drivers/src/"
+ filename.name
+ ")\n"
"zephyr_library_sources_ifdef("
f"CONFIG_USE_STM32_{drv_type.upper()}_{drv_name.upper()}"
f" drivers/src/{filename.name})\n"
)

self.os_cmd(("dos2unix", str(cmakelists_path)))

def generate_assert_file(self):
Expand Down
8 changes: 4 additions & 4 deletions stm32cube/common_ll/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ stm32f7xx 1.17.4
stm32g0xx 1.6.2
stm32g4xx 1.6.1
stm32h5xx 1.5.0
stm32h7rsxx 1.2.0
stm32h7rsxx 1.3.0
stm32h7xx 1.12.1
stm32l0xx 1.12.3
stm32l1xx 1.10.5
stm32l4xx 1.18.1
stm32l5xx 1.5.1
stm32l4xx 1.18.2
stm32l5xx 1.6.0
stm32mp13xx 1.2.0
stm32mp1xx 1.7.0
stm32mp2xx 1.2.0
stm32n6xx 1.2.0
stm32n6xx 1.3.0
stm32u0xx 1.3.0
stm32u3xx 1.2.0
stm32u5xx 1.8.0
Expand Down
53 changes: 0 additions & 53 deletions stm32cube/stm32g0xx/drivers/include/stm32_assert_template.h

This file was deleted.

1 change: 1 addition & 0 deletions stm32cube/stm32h7rsxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,4 @@ zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_UCPD drivers/src/stm32h7rsxx_ll
zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_USART drivers/src/stm32h7rsxx_ll_usart.c)
zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_USB drivers/src/stm32h7rsxx_ll_usb.c)
zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_UTILS drivers/src/stm32h7rsxx_ll_utils.c)
zephyr_library_sources_ifdef(CONFIG_USE_STM32_UTIL_I3C drivers/src/stm32h7rsxx_util_i3c.c)
20 changes: 13 additions & 7 deletions stm32cube/stm32h7rsxx/README
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Origin:
http://www.st.com/en/embedded-software/stm32cubeh7rs.html

Status:
version v1.2.0
version v1.3.0

Purpose:
ST Microelectronics official MCU package for STM32H7RS series.
Expand All @@ -23,7 +23,7 @@ URL:
https://github.com/STMicroelectronics/STM32CubeH7RS

Commit:
fc7bcafbad47f1a6f7986e236c9f00a46fc3b71f
c5da62bfcb09b7bb7c7dba71accd1c7b15a8cf04

Maintained-by:
External
Expand Down Expand Up @@ -53,13 +53,17 @@ Patch List:
the card identification sequence is skipped.
Impacted files:
stm32cube/stm32h7rsxx/drivers/src/stm32h7rsxx_hal_sdio.c

See also:
https://github.com/zephyrproject-rtos/hal_stm32/pull/281

*Fix SDIO polling mode data transfer issues
Fixes two related issues in the STM32H7RS SDIO driver: incorrect block count calculation
that caused the card to hang, and improper buffer size handling that led to misaligned FIFO writes.
Fixes two related issues in the STM32H7RS SDIO driver: incorrect block count calculation
that caused the card to hang, and improper buffer size handling that led to misaligned FIFO writes.
Together, these changes ensure correct and stable data transfer in polling mode.
Impacted file:
stm32cube/stm32h7rsxx/drivers/src/stm32h7rsxx_hal_sdio.c
Impacted file:
stm32cube/stm32h7rsxx/drivers/src/stm32h7rsxx_hal_sdio.c
See also:
https://github.com/zephyrproject-rtos/hal_stm32/pull/292

*Allow usage of HAL_DCMIPP_PIPE_SetConfig when DCMIPP is in READY state
Allow performing PIPE configuration when the DCMIPP device is not only
Expand All @@ -69,5 +73,7 @@ Patch List:
Impacted file:
stm32cube/stm32h7rsxx/drivers/src/stm32h7rsxx_hal_dcmipp.c
Internal reference: 215688
See also:
https://github.com/zephyrproject-rtos/hal_stm32/pull/304

See release_note.html from STM32Cube
15 changes: 14 additions & 1 deletion stm32cube/stm32h7rsxx/drivers/include/Legacy/stm32_hal_legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ extern "C" {
#if defined(STM32L4R5xx) || defined(STM32L4R9xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || \
defined(STM32L4S7xx) || defined(STM32L4S9xx)
#define DMA_REQUEST_DCMI_PSSI DMA_REQUEST_DCMI
#endif
#elif defined(STM32L4P5xx) || defined(STM32L4Q5xx)
#define DMA_REQUEST_PSSI DMA_REQUEST_DCMI_PSSI
#define LL_DMAMUX_REQ_PSSI LL_DMAMUX_REQ_DCMI_PSSI
#endif /* STM32L4R5xx || STM32L4R9xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx */

#endif /* STM32L4 */

Expand Down Expand Up @@ -564,6 +567,9 @@ extern "C" {
#define OB_nBOOT0_RESET OB_NBOOT0_RESET
#define OB_nBOOT0_SET OB_NBOOT0_SET
#endif /* STM32U0 */
#if defined(STM32H5)
#define FLASH_ECC_AREA_EDATA FLASH_ECC_AREA_EDATA_BANK1
#endif /* STM32H5 */

/**
* @}
Expand Down Expand Up @@ -2146,6 +2152,13 @@ extern "C" {
#define UFB_MODE_BitNumber UFB_MODE_BIT_NUMBER
#define CMP_PD_BitNumber CMP_PD_BIT_NUMBER

#if defined(STM32H7RS) || defined(STM32N6)
#define FMC_SWAPBMAP_DISABLE FMC_SWAPBANK_MODE0
#define FMC_SWAPBMAP_SDRAM_SRAM FMC_SWAPBANK_MODE1
#define HAL_SetFMCMemorySwappingConfig HAL_FMC_SetBankSwapConfig
#define HAL_GetFMCMemorySwappingConfig HAL_FMC_GetBankSwapConfig
#endif /* STM32H7RS || STM32N6 */

/**
* @}
*/
Expand Down
57 changes: 5 additions & 52 deletions stm32cube/stm32h7rsxx/drivers/include/stm32_assert.h
Original file line number Diff line number Diff line change
@@ -1,53 +1,6 @@
/**
******************************************************************************
* @file stm32_assert.h
* @author MCD Application Team
* @brief STM32 assert template file.
* This file should be copied to the application folder and renamed
* to stm32_assert.h.
******************************************************************************
* @attention
*
* Copyright (c) 2022 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright (c) 2025 STMicroelectronics
*/

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef STM32_ASSERT_H
#define STM32_ASSERT_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
#ifdef USE_FULL_ASSERT
/**
* @brief The assert_param macro is used for function's parameters check.
* @param expr If expr is false, it calls assert_failed function
* which reports the name of the source file and the source
* line number of the call that failed.
* If expr is true, it returns no value.
* @retval None
*/
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(uint8_t *file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */

#ifdef __cplusplus
}
#endif

#endif /* STM32_ASSERT_H */
#include <stm32h7rsxx_hal_conf.h>
Loading