Skip to content

Commit 6ec82f6

Browse files
authored
Merge pull request #1321 from fpistm/config_cleanup
Review HAL/LL default configuration
2 parents 3bcd490 + db4eb1e commit 6ec82f6

File tree

5 files changed

+25
-31
lines changed

5 files changed

+25
-31
lines changed

boards.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ STM32MP1.build.mcu=cortex-m4
772772
STM32MP1.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
773773
STM32MP1.build.series=STM32MP1xx
774774
STM32MP1.build.cmsis_lib_gcc=arm_cortexM4l_math
775-
STM32MP1.build.extra_flags=-DCORE_CM4 -DUSE_FULL_LL_DRIVER -D{build.product_line} {build.enable_virtio} {build.xSerial}
775+
STM32MP1.build.extra_flags=-DCORE_CM4 -D{build.product_line} {build.enable_virtio} {build.xSerial}
776776

777777
# STM32MP157A-DK1 board
778778
STM32MP1.menu.pnum.STM32MP157A_DK1=STM32MP157A-DK1

cores/arduino/stm32/stm32yyxx_hal_conf.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
#define HAL_DMA_MODULE_ENABLED /* Required by other modules */
1010
#define HAL_FLASH_MODULE_ENABLED
1111
#define HAL_GPIO_MODULE_ENABLED
12+
#define HAL_HSEM_MODULE_ENABLED
13+
#define HAL_IPCC_MODULE_ENABLED
1214
#define HAL_PWR_MODULE_ENABLED
1315
#define HAL_RCC_MODULE_ENABLED
14-
#define HAL_HSEM_MODULE_ENABLED
1516

1617
/*
1718
* Optional HAL modules, can be enabled/disabled using
@@ -32,12 +33,25 @@
3233
#undef HAL_I2C_MODULE_ENABLED
3334
#endif
3435

36+
#if !defined(HAL_I2S_MODULE_DISABLED)
37+
#define HAL_I2S_MODULE_ENABLED
38+
#else
39+
#undef HAL_I2S_MODULE_ENABLED
40+
#endif
41+
3542
#if !defined(HAL_RTC_MODULE_DISABLED)
3643
#define HAL_RTC_MODULE_ENABLED
3744
#else
3845
#undef HAL_RTC_MODULE_ENABLED
3946
#endif
4047

48+
#if !defined(HAL_SAI_MODULE_DISABLED)
49+
#define HAL_SAI_MODULE_ENABLED
50+
#else
51+
#undef HAL_SAI_MODULE_ENABLED
52+
#endif
53+
54+
4155
#if !defined(HAL_SPI_MODULE_DISABLED)
4256
#define HAL_SPI_MODULE_ENABLED
4357
#else
@@ -50,18 +64,6 @@
5064
#undef HAL_TIM_MODULE_ENABLED
5165
#endif
5266

53-
#if !defined(HAL_I2S_MODULE_DISABLED)
54-
#define HAL_I2S_MODULE_ENABLED
55-
#else
56-
#undef HAL_I2S_MODULE_ENABLED
57-
#endif
58-
59-
#if !defined(HAL_SAI_MODULE_DISABLED)
60-
#define HAL_SAI_MODULE_ENABLED
61-
#else
62-
#undef HAL_SAI_MODULE_ENABLED
63-
#endif
64-
6567
/*
6668
* Not defined by default
6769
*/
@@ -85,10 +87,10 @@
8587
#undef HAL_ETH_MODULE_ENABLED
8688
#endif
8789

88-
#if !defined(HAL_SD_MODULE_DISABLED)
89-
/*#define HAL_SD_MODULE_ENABLED*/
90+
#if !defined(HAL_OSPI_MODULE_DISABLED)
91+
/*#define HAL_OSPI_MODULE_ENABLED*/
9092
#else
91-
#undef HAL_SD_MODULE_ENABLED
93+
#undef HAL_OSPI_MODULE_ENABLED
9294
#endif
9395

9496
#if !defined(HAL_QSPI_MODULE_DISABLED)
@@ -97,18 +99,17 @@
9799
#undef HAL_QSPI_MODULE_ENABLED
98100
#endif
99101

100-
#if !defined(HAL_OSPI_MODULE_DISABLED)
101-
/*#define HAL_OSPI_MODULE_ENABLED*/
102+
#if !defined(HAL_SD_MODULE_DISABLED)
103+
/*#define HAL_SD_MODULE_ENABLED*/
102104
#else
103-
#undef HAL_OSPI_MODULE_ENABLED
105+
#undef HAL_SD_MODULE_ENABLED
104106
#endif
105107

106108
/*
107109
* Disabled HAL modules, handled thanks Arduino menu
108110
*/
109111
/*#define HAL_UART_MODULE_ENABLED*/
110112
/*#define HAL_PCD_MODULE_ENABLED*/
111-
/*#define HAL_IPCC_MODULE_ENABLED*/
112113

113114
/*
114115
* Unused HAL modules
@@ -135,7 +136,6 @@
135136
HAL_HCD_MODULE_ENABLED
136137
HAL_HRTIM_MODULE_ENABLED
137138
HAL_ICACHE_MODULE_ENABLED
138-
HAL_IPCC_MODULE_ENABLED
139139
HAL_IRDA_MODULE_ENABLED
140140
HAL_IWDG_MODULE_ENABLED // IWD built-in library uses LL
141141
HAL_JPEG_MODULE_ENABLED

libraries/SrcWrapper/src/stm32/PortNames.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ GPIO_TypeDef *set_GPIO_Port_Clock(uint32_t port_idx)
103103
#endif
104104
#if defined GPIOG_BASE
105105
case PortG:
106-
#if defined(STM32L4xx) && defined(PWR_CR2_IOSV)
106+
#if defined(PWR_CR2_IOSV)
107107
// Enable VDDIO2 supply for 14 I/Os (Port G[15:2])
108108
HAL_PWREx_EnableVddIO2();
109109
#endif

libraries/SrcWrapper/src/stm32/pinmap.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,6 @@ void pin_function(PinName pin, int function)
9898
/* Enable GPIO clock */
9999
GPIO_TypeDef *gpio = set_GPIO_Port_Clock(port);
100100

101-
#if defined (STM32L5xx)
102-
/* Validate the VDDIO2 supply for electrical and logical isolation purpose. */
103-
__HAL_RCC_PWR_CLK_ENABLE();
104-
HAL_PWREx_EnableVddIO2();
105-
#endif /* STM32L5xx */
106-
107101
hsem_lock(CFG_HW_GPIO_SEMID, HSEM_LOCK_DEFAULT_RETRY);
108102

109103
/* Set default speed to high.

platform.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ compiler.objcopy.cmd=arm-none-eabi-objcopy
2828
compiler.elf2hex.cmd=arm-none-eabi-objcopy
2929
compiler.libraries.ldflags=
3030

31-
compiler.extra_flags=-mcpu={build.mcu} {build.flags.fp} -mthumb "@{build.opt.path}"
31+
compiler.extra_flags=-mcpu={build.mcu} {build.flags.fp} -DUSE_FULL_LL_DRIVER -mthumb "@{build.opt.path}"
3232

3333
compiler.S.flags={compiler.extra_flags} -c -x assembler-with-cpp {compiler.stm.extra_include}
3434

@@ -85,7 +85,7 @@ build.pid=0
8585
# that the preprocessor cannot detect.
8686

8787
# VirtIO RPMsg Serial Flags
88-
build.virtio_flags=-DVIRTIOCON -DHAL_IPCC_MODULE_ENABLED -DNO_ATOMIC_64_SUPPORT -DMETAL_INTERNAL -DMETAL_MAX_DEVICE_REGIONS=2 -DVIRTIO_SLAVE_ONLY -DVIRTIO_LOG
88+
build.virtio_flags=-DVIRTIOCON -DNO_ATOMIC_64_SUPPORT -DMETAL_INTERNAL -DMETAL_MAX_DEVICE_REGIONS=2 -DVIRTIO_SLAVE_ONLY -DVIRTIO_LOG
8989
build.virtio_extra_include="-I{build.system.path}/Middlewares/OpenAMP" "-I{build.system.path}/Middlewares/OpenAMP/open-amp/lib/include" "-I{build.system.path}/Middlewares/OpenAMP/libmetal/lib/include" "-I{build.system.path}/Middlewares/OpenAMP/virtual_driver"
9090

9191
# Build information's

0 commit comments

Comments
 (0)