Skip to content

Commit 37fd53a

Browse files
committed
This set of minor patches to the STM32CubeU5 files is necessary to support
building for the STM32U545 chip. These changes have been provided to ST (STMicroelectronics/STM32CubeU5#41). However, they have fixed the issue internally and are awaiting a future release to push them out. I am in the process of creating a PR for Zephyr-proper to add support for the STM32U545 part as well as the Nucleo-U545RE-Q board. That PR is dependent on these changes. Signed-off-by: Rob Newberry <[email protected]>
1 parent 60c9634 commit 37fd53a

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

stm32cube/stm32u5xx/drivers/include/stm32u5xx_hal_nand.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
extern "C" {
2525
#endif
2626

27+
#if defined(FMC_BANK3)
2728

2829
/* Includes ------------------------------------------------------------------*/
2930
#include "stm32u5xx_ll_fmc.h"
@@ -368,6 +369,7 @@ uint32_t HAL_NAND_Read_Status(const NAND_HandleTypeDef *hnand);
368369
* @}
369370
*/
370371

372+
#endif /* FMC_BANK3 */
371373

372374
#ifdef __cplusplus
373375
}

stm32cube/stm32u5xx/drivers/include/stm32u5xx_hal_nor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
extern "C" {
2525
#endif
2626

27+
#if defined(FMC_BANK1)
2728

2829
/* Includes ------------------------------------------------------------------*/
2930
#include "stm32u5xx_ll_fmc.h"
@@ -316,6 +317,7 @@ HAL_NOR_StatusTypeDef HAL_NOR_GetStatus(NOR_HandleTypeDef *hnor, uint32_t Addres
316317
* @}
317318
*/
318319

320+
#endif /* FMC_BANK1 */
319321

320322
#ifdef __cplusplus
321323
}

stm32cube/stm32u5xx/drivers/include/stm32u5xx_hal_sram.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
extern "C" {
2525
#endif
2626

27+
#if defined(FMC_BANK1)
2728

2829
/* Includes ------------------------------------------------------------------*/
2930
#include "stm32u5xx_ll_fmc.h"
@@ -222,6 +223,7 @@ HAL_SRAM_StateTypeDef HAL_SRAM_GetState(const SRAM_HandleTypeDef *hsram);
222223
* @}
223224
*/
224225

226+
#endif /* FMC_BANK1 */
225227

226228
#ifdef __cplusplus
227229
}

stm32cube/stm32u5xx/drivers/include/stm32u5xx_ll_fmc.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ extern "C" {
3838
/** @addtogroup FMC_LL_Private_Macros
3939
* @{
4040
*/
41+
#if defined(FMC_BANK1)
4142

4243
#define IS_FMC_NORSRAM_BANK(__BANK__) (((__BANK__) == FMC_NORSRAM_BANK1) || \
4344
((__BANK__) == FMC_NORSRAM_BANK2) || \
@@ -95,6 +96,8 @@ extern "C" {
9596
#define IS_FMC_NORSRAM_EXTENDED_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NORSRAM_EXTENDED_DEVICE)
9697
#define IS_FMC_MAX_CHIP_SELECT_PULSE_TIME(__TIME__) (((__TIME__) >= 1U) && ((__TIME__) <= 65535U))
9798

99+
#endif /* FMC_BANK1 */
100+
#if defined(FMC_BANK3)
98101

99102
#define IS_FMC_NAND_BANK(__BANK__) ((__BANK__) == FMC_NAND_BANK3)
100103
#define IS_FMC_WAIT_FEATURE(__FEATURE__) (((__FEATURE__) == FMC_NAND_WAIT_FEATURE_DISABLE) || \
@@ -118,6 +121,7 @@ extern "C" {
118121
#define IS_FMC_HIZ_TIME(__TIME__) ((__TIME__) <= 254U)
119122
#define IS_FMC_NAND_DEVICE(__INSTANCE__) ((__INSTANCE__) == FMC_NAND_DEVICE)
120123

124+
#endif /* FMC_BANK3 */
121125

122126
/**
123127
* @}
@@ -129,14 +133,23 @@ extern "C" {
129133
* @{
130134
*/
131135

136+
#if defined(FMC_BANK1)
132137
#define FMC_NORSRAM_TypeDef FMC_Bank1_TypeDef
133138
#define FMC_NORSRAM_EXTENDED_TypeDef FMC_Bank1E_TypeDef
139+
#endif /* FMC_BANK1 */
140+
#if defined(FMC_BANK3)
134141
#define FMC_NAND_TypeDef FMC_Bank3_TypeDef
142+
#endif /* FMC_BANK3 */
135143

144+
#if defined(FMC_BANK1)
136145
#define FMC_NORSRAM_DEVICE FMC_Bank1_R
137146
#define FMC_NORSRAM_EXTENDED_DEVICE FMC_Bank1E_R
147+
#endif /* FMC_BANK1 */
148+
#if defined(FMC_BANK3)
138149
#define FMC_NAND_DEVICE FMC_Bank3_R
150+
#endif /* FMC_BANK3 */
139151

152+
#if defined(FMC_BANK1)
140153
/**
141154
* @brief FMC NORSRAM Configuration Structure definition
142155
*/
@@ -261,7 +274,9 @@ typedef struct
261274
uint32_t AccessMode; /*!< Specifies the asynchronous access mode.
262275
This parameter can be a value of @ref FMC_Access_Mode */
263276
} FMC_NORSRAM_TimingTypeDef;
277+
#endif /* FMC_BANK1 */
264278

279+
#if defined(FMC_BANK3)
265280
/**
266281
* @brief FMC NAND Configuration Structure definition
267282
*/
@@ -290,7 +305,9 @@ typedef struct
290305
delay between ALE low and RE low.
291306
This parameter can be a number between Min_Data = 0 and Max_Data = 255 */
292307
} FMC_NAND_InitTypeDef;
308+
#endif /* FMC_BANK3 */
293309

310+
#if defined(FMC_BANK3)
294311
/**
295312
* @brief FMC NAND Timing parameters structure definition
296313
*/
@@ -321,6 +338,7 @@ typedef struct
321338
on the memory space timing to be configured).
322339
This parameter can be a number between Min_Data = 0 and Max_Data = 254 */
323340
} FMC_NAND_PCC_TimingTypeDef;
341+
#endif /* FMC_BANK3 */
324342

325343

326344
/**
@@ -331,6 +349,7 @@ typedef struct
331349
/** @addtogroup FMC_LL_Exported_Constants FMC Low Layer Exported Constants
332350
* @{
333351
*/
352+
#if defined(FMC_BANK1)
334353

335354
/** @defgroup FMC_LL_NOR_SRAM_Controller FMC NOR/SRAM Controller
336355
* @{
@@ -515,7 +534,9 @@ typedef struct
515534
/**
516535
* @}
517536
*/
537+
#endif /* FMC_BANK1 */
518538

539+
#if defined(FMC_BANK3)
519540

520541
/** @defgroup FMC_LL_NAND_Controller FMC NAND Controller
521542
* @{
@@ -579,25 +600,30 @@ typedef struct
579600
/**
580601
* @}
581602
*/
603+
#endif /* FMC_BANK3 */
582604

583605

584606
/** @defgroup FMC_LL_Interrupt_definition FMC Low Layer Interrupt definition
585607
* @{
586608
*/
609+
#if defined(FMC_BANK3)
587610
#define FMC_IT_RISING_EDGE (0x00000008U)
588611
#define FMC_IT_LEVEL (0x00000010U)
589612
#define FMC_IT_FALLING_EDGE (0x00000020U)
613+
#endif /* FMC_BANK3 */
590614
/**
591615
* @}
592616
*/
593617

594618
/** @defgroup FMC_LL_Flag_definition FMC Low Layer Flag definition
595619
* @{
596620
*/
621+
#if defined(FMC_BANK3)
597622
#define FMC_FLAG_RISING_EDGE (0x00000001U)
598623
#define FMC_FLAG_LEVEL (0x00000002U)
599624
#define FMC_FLAG_FALLING_EDGE (0x00000004U)
600625
#define FMC_FLAG_FEMPT (0x00000040U)
626+
#endif /* FMC_BANK3 */
601627
/**
602628
* @}
603629
*/
@@ -614,6 +640,12 @@ typedef struct
614640
/** @defgroup FMC_LL_Private_Macros FMC_LL Private Macros
615641
* @{
616642
*/
643+
#if defined(FMC_BANK1)
644+
/** @defgroup FMC_LL_NOR_Macros FMC NOR/SRAM Macros
645+
* @brief macros to handle NOR device enable/disable and read/write operations
646+
* @{
647+
*/
648+
617649
/**
618650
* @brief Enable the FMC Peripheral.
619651
* @retval None
@@ -651,7 +683,9 @@ typedef struct
651683
/**
652684
* @}
653685
*/
686+
#endif /* FMC_BANK1 */
654687

688+
#if defined(FMC_BANK3)
655689
/** @defgroup FMC_LL_NAND_Macros FMC NAND Macros
656690
* @brief macros to handle NAND device enable/disable
657691
* @{
@@ -675,7 +709,9 @@ typedef struct
675709
/**
676710
* @}
677711
*/
712+
#endif /* FMC_BANK3 */
678713

714+
#if defined(FMC_BANK3)
679715
/** @defgroup FMC_LL_NAND_Interrupt FMC NAND Interrupt
680716
* @brief macros to handle NAND interrupts
681717
* @{
@@ -735,6 +771,7 @@ typedef struct
735771
/**
736772
* @}
737773
*/
774+
#endif /* FMC_BANK3 */
738775

739776

740777
/**
@@ -750,6 +787,7 @@ typedef struct
750787
* @{
751788
*/
752789

790+
#if defined(FMC_BANK1)
753791
/** @defgroup FMC_LL_NORSRAM NOR SRAM
754792
* @{
755793
*/
@@ -780,7 +818,9 @@ HAL_StatusTypeDef FMC_NORSRAM_WriteOperation_Disable(FMC_NORSRAM_TypeDef *Devic
780818
/**
781819
* @}
782820
*/
821+
#endif /* FMC_BANK1 */
783822

823+
#if defined(FMC_BANK3)
784824
/** @defgroup FMC_LL_NAND NAND
785825
* @{
786826
*/
@@ -810,6 +850,7 @@ HAL_StatusTypeDef FMC_NAND_GetECC(FMC_NAND_TypeDef *Device, uint32_t *ECCval, u
810850
/**
811851
* @}
812852
*/
853+
#endif /* FMC_BANK3 */
813854

814855

815856

0 commit comments

Comments
 (0)