Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new stm32 nucleo l552ze board #1256

Closed
wants to merge 10 commits into from
4 changes: 2 additions & 2 deletions cores/arduino/stm32/backup.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static inline void setBackupRegister(uint32_t index, uint32_t value)
LL_RTC_BKP_SetRegister(BKP, index, value);
#elif defined(STM32G0xx)
LL_RTC_BKP_SetRegister(TAMP, index, value);
#elif defined(STM32G4xx)
#elif defined(STM32G4xx) || defined(STM32L5xx)
LL_RTC_BKP_SetRegister(RTC, index, value);
#else
#ifdef ENABLE_BACKUP_SUPPORT
Expand All @@ -143,7 +143,7 @@ static inline uint32_t getBackupRegister(uint32_t index)
return LL_RTC_BKP_GetRegister(BKP, index);
#elif defined(STM32G0xx)
return LL_RTC_BKP_GetRegister(TAMP, index);
#elif defined(STM32G4xx)
#elif defined(STM32G4xx) || defined(STM32L5xx)
return LL_RTC_BKP_GetRegister(RTC, index);
#else
#ifdef ENABLE_BACKUP_SUPPORT
Expand Down
2 changes: 2 additions & 0 deletions cores/arduino/stm32/stm32_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
#include "stm32l1xx.h"
#elif defined(STM32L4xx)
#include "stm32l4xx.h"
#elif defined(STM32L5xx)
#include "stm32l5xx.h"
#elif defined(STM32MP1xx)
#include "stm32mp1xx.h"
#elif defined(STM32WBxx)
Expand Down
15 changes: 11 additions & 4 deletions cores/arduino/stm32/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ extern "C" {
#endif

#if defined(TIM1_BASE) && !defined(TIM1_IRQn)
#if defined(STM32F0xx) || defined(STM32G0xx)
#if defined(STM32L5xx)
#define TIM1_IRQn TIM1_UP_IRQn
#define TIM1_IRQHandler TIM1_UP_IRQHandler
#elif defined(STM32F0xx) || defined(STM32G0xx)
#define TIM1_IRQn TIM1_BRK_UP_TRG_COM_IRQn
#define TIM1_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler
#elif defined(STM32F1xx) ||defined(STM32G4xx)
Expand All @@ -63,17 +66,19 @@ extern "C" {
#define TIM1_IRQHandler TIM1_UP_IRQHandler
#endif
#endif

#if defined(TIM6_BASE) && !defined(TIM6_IRQn)
#if defined(DAC_BASE) || defined(DAC1_BASE)
#if defined(STM32G0xx)
#define TIM6_IRQn TIM6_DAC_LPTIM1_IRQn
#define TIM6_IRQHandler TIM6_DAC_LPTIM1_IRQHandler
#elif !defined(STM32F1xx) && !defined(STM32L1xx) && !defined(STM32MP1xx)
#elif !defined(STM32F1xx) && !defined(STM32L1xx) && !defined(STM32L5xx) && !defined(STM32MP1xx)
#define TIM6_IRQn TIM6_DAC_IRQn
#define TIM6_IRQHandler TIM6_DAC_IRQHandler
#define TIM6_IRQHandler TIM2_DAC_IRQHandler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change to TIM2_DAC_IRQHandler

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moreover TIM2_DAC_IRQHandler does not exist.

#endif
#endif
#endif

#if defined(TIM7_BASE) && !defined(TIM7_IRQn)
#if defined(STM32G0xx) && defined(LPTIM2_BASE)
#define TIM7_IRQn TIM7_LPTIM2_IRQn
Expand All @@ -89,11 +94,13 @@ extern "C" {
|| defined(STM32H7xx)
#define TIM8_IRQn TIM8_UP_TIM13_IRQn
#define TIM8_IRQHandler TIM8_UP_TIM13_IRQHandler
#elif defined(STM32F3xx) || defined(STM32G4xx) || defined(STM32L4xx) || defined(STM32MP1xx)
#elif defined(STM32F3xx) || defined(STM32G4xx) || defined(STM32L4xx)\
|| defined(STM32L5xx) || defined(STM32MP1xx)
#define TIM8_IRQn TIM8_UP_IRQn
#define TIM8_IRQHandler TIM8_UP_IRQHandler
#endif
#endif

#if defined(TIM9_BASE) && !defined(TIM9_IRQn)
#if defined(STM32F1xx) || defined(STM32F2xx) ||defined(STM32F4xx) || defined(STM32F7xx)
#define TIM9_IRQn TIM1_BRK_TIM9_IRQn
Expand Down
3 changes: 3 additions & 0 deletions cores/arduino/stm32/usb/usbd_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ extern "C" {
#elif defined(STM32L1xx)
#define USB_IRQn USB_LP_IRQn
#define USB_IRQHandler USB_LP_IRQHandler
#elif defined(STM32L5xx)
#define USB_IRQn USB_FS_IRQn
#define USB_IRQHandler USB_FS_IRQHandler
#endif

#endif /* USB_BASE */
Expand Down
6 changes: 3 additions & 3 deletions libraries/SrcWrapper/src/stm32/analog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,8 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
#endif
#if !defined(STM32F1xx) && !defined(STM32F2xx) && !defined(STM32F3xx) && \
!defined(STM32F4xx) && !defined(STM32F7xx) && !defined(STM32G4xx) && \
!defined(STM32H7xx) && !defined(STM32L4xx) && !defined(STM32MP1xx) && \
!defined(STM32WBxx)
!defined(STM32H7xx) && !defined(STM32L4xx) && !defined(STM32L5xx) && \
!defined(STM32MP1xx) && !defined(STM32WBxx)
AdcHandle.Init.LowPowerAutoPowerOff = DISABLE; /* ADC automatically powers-off after a conversion and automatically wakes-up when a new conversion is triggered */
#endif
#ifdef ADC_CHANNELS_BANK_A
Expand Down Expand Up @@ -913,7 +913,7 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)

AdcChannelConf.Channel = channel; /* Specifies the channel to configure into ADC */

#if defined(STM32L4xx) || defined(STM32WBxx)
#if defined(STM32L4xx) || defined(STM32L5xx) || defined(STM32WBxx)
if (!IS_ADC_CHANNEL(&AdcHandle, AdcChannelConf.Channel)) {
#elif defined(STM32G4xx)
if (!IS_ADC_CHANNEL(&AdcHandle, AdcChannelConf.Channel)) {
Expand Down
6 changes: 3 additions & 3 deletions libraries/SrcWrapper/src/stm32/interrupt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static gpio_irq_conf_str gpio_irq_conf[NB_EXTI] = {
{.irqnb = EXTI4_15_IRQn, .callback = NULL}, //GPIO_PIN_13
{.irqnb = EXTI4_15_IRQn, .callback = NULL}, //GPIO_PIN_14
{.irqnb = EXTI4_15_IRQn, .callback = NULL} //GPIO_PIN_15
#elif defined (STM32MP1xx)
#elif defined (STM32MP1xx) || defined (STM32L5xx)
{.irqnb = EXTI0_IRQn, .callback = NULL}, //GPIO_PIN_0
{.irqnb = EXTI1_IRQn, .callback = NULL}, //GPIO_PIN_1
{.irqnb = EXTI2_IRQn, .callback = NULL}, //GPIO_PIN_2
Expand Down Expand Up @@ -246,7 +246,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
}
}

#if defined (STM32G0xx) || defined (STM32MP1xx)
#if defined (STM32G0xx) || defined (STM32MP1xx) || defined (STM32L5xx)
/**
* @brief EXTI line detection callback.
* @param GPIO_Pin Specifies the port pin connected to corresponding EXTI line.
Expand Down Expand Up @@ -369,7 +369,7 @@ void EXTI4_IRQHandler(void)
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_4);
}

#if !defined(STM32MP1xx)
#if !defined(STM32MP1xx) && !defined(STM32L5xx)
/**
* @brief This function handles external line 5 to 9 interrupt request.
* @param None
Expand Down
3 changes: 3 additions & 0 deletions libraries/SrcWrapper/src/stm32/system_stm32yyxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
#ifdef STM32L4xx
#include "system_stm32l4xx.c"
#endif
#ifdef STM32L5xx
#include "system_stm32l5xx.c"
#endif
#ifdef STM32MP1xx
#include "system_stm32mp1xx.c"
#endif
Expand Down