Skip to content

Commit f07d570

Browse files
bcostm0xc0170
authored andcommitted
NUCLEO_WB55RG: update STM common files
- Include RTC ll file from hal as in other families - STM32WB: update Flash API driver
1 parent 658c8b6 commit f07d570

File tree

8 files changed

+23
-8
lines changed

8 files changed

+23
-8
lines changed

targets/TARGET_STM/TARGET_STM32WB/TARGET_STM32WB55xG/device/stm32wbxx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
In this case, these drivers will not be included and the application code will
6363
be based on direct access to peripherals registers
6464
*/
65-
/*#define USE_HAL_DRIVER */
65+
#define USE_HAL_DRIVER
6666
#endif /* USE_HAL_DRIVER */
6767

6868
/**
@@ -84,7 +84,7 @@
8484
/** @addtogroup Device_Included
8585
* @{
8686
*/
87-
87+
#define STM32WB55xx // Added for MBED
8888
#if defined(STM32WB55xx)
8989
#include "stm32wb55xx.h"
9090
#else

targets/TARGET_STM/TARGET_STM32WB/device.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@
3737
/* WORKAROUND waiting for mbed-os issue 4408 to be addressed */
3838
#include "stm32wbxx_ll_usart.h"
3939

40+
#include "stm32wbxx_ll_rtc.h"
41+
4042
#endif

targets/TARGET_STM/TARGET_STM32WB/device/stm32wbxx_hal_conf.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@
200200
* @brief Include module's header file
201201
*/
202202

203+
#ifdef HAL_DMA_MODULE_ENABLED
204+
#include "stm32wbxx_hal_dma.h"
205+
#endif /* HAL_DMA_MODULE_ENABLED */
206+
203207
#ifdef HAL_ADC_MODULE_ENABLED
204208
#include "stm32wbxx_hal_adc.h"
205209
#endif /* HAL_ADC_MODULE_ENABLED */
@@ -220,10 +224,6 @@
220224
#include "stm32wbxx_hal_cryp.h"
221225
#endif /* HAL_CRYP_MODULE_ENABLED */
222226

223-
#ifdef HAL_DMA_MODULE_ENABLED
224-
#include "stm32wbxx_hal_dma.h"
225-
#endif /* HAL_DMA_MODULE_ENABLED */
226-
227227
#ifdef HAL_EXTI_MODULE_ENABLED
228228
#include "stm32wbxx_hal_exti.h"
229229
#endif /* HAL_EXTI_MODULE_ENABLED */

targets/TARGET_STM/TARGET_STM32WB/device/stm32wbxx_hal_rtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
/* Includes ------------------------------------------------------------------*/
2929
#include "stm32wbxx_hal_def.h"
30+
#include "stm32wbxx_ll_rtc.h"
3031

3132
/* Include low level driver */
3233
#include "stm32wbxx_ll_exti.h"

targets/TARGET_STM/TARGET_STM32WB/flash_api.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,11 @@ uint32_t flash_get_size(const flash_t *obj) {
207207
return FLASH_SIZE;
208208
}
209209

210+
uint8_t flash_get_erase_value(const flash_t *obj)
211+
{
212+
(void)obj;
213+
214+
return 0xFF;
215+
}
216+
210217
#endif

targets/TARGET_STM/gpio_irq_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
194194
}
195195

196196
/* Enable SYSCFG Clock */
197+
#if !defined(TARGET_STM32WB)
197198
__HAL_RCC_SYSCFG_CLK_ENABLE();
199+
#endif
198200

199201
uint32_t port_index = STM_PORT(pin);
200202
uint32_t pin_index = STM_PIN(pin);

targets/TARGET_STM/serial_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,12 @@ HAL_StatusTypeDef init_uart(serial_t *obj)
568568
#if defined(LPUART1_BASE)
569569
if (huart->Instance == LPUART1) {
570570
if (obj_s->baudrate <= 9600) {
571-
#if ((MBED_CONF_TARGET_LPUART_CLOCK_SOURCE) & USE_LPUART_CLK_LSE) && !TARGET_STM32H7
571+
#if ((MBED_CONF_TARGET_LPUART_CLOCK_SOURCE) & USE_LPUART_CLK_LSE) && !TARGET_STM32H7 && !TARGET_STM32WB
572572
HAL_UARTEx_EnableClockStopMode(huart);
573573
#endif
574574
HAL_UARTEx_EnableStopMode(huart);
575575
} else {
576-
#if !TARGET_STM32H7
576+
#if (!defined(TARGET_STM32H7) && !defined(TARGET_STM32WB))
577577
HAL_UARTEx_DisableClockStopMode(huart);
578578
#endif
579579
HAL_UARTEx_DisableStopMode(huart);

targets/TARGET_STM/trng_api.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ void trng_init(trng_t *obj)
3737
error("Only 1 RNG instance supported\r\n");
3838
}
3939

40+
#if !defined(TARGET_STM32WB)
41+
/* Because M0 core of WB also needs RG RNG is already clocked by default */
4042
#if defined(RCC_PERIPHCLK_RNG)
4143
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
4244

@@ -51,6 +53,7 @@ void trng_init(trng_t *obj)
5153
error("RNG clock configuration error\n");
5254
}
5355
#endif
56+
#endif //!defined(TARGET_STM32WB)
5457

5558
/* RNG Peripheral clock enable */
5659
__HAL_RCC_RNG_CLK_ENABLE();

0 commit comments

Comments
 (0)