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

Undefined reference to Serial2 after updating from 2.1.0 to 2.3.0 #1903

Closed
Bambofy opened this issue Dec 21, 2022 · 1 comment
Closed

Undefined reference to Serial2 after updating from 2.1.0 to 2.3.0 #1903

Bambofy opened this issue Dec 21, 2022 · 1 comment
Labels
invalid This doesn't seem right

Comments

@Bambofy
Copy link

Bambofy commented Dec 21, 2022

Describe the bug
In previous versions of stm23duino I could reference the hardware Serial2 in my project, but after upgrading from 2.1.0 to 2.3.0 the compiler can no longer locate the Serial2 definition.

missing serial2 definition

Expected behavior
The Serial2 definition should be defined during compilation but it doesn't happen.

Screenshots

Desktop (please complete the following information):

  • OS: Windows
  • Arduino IDE version: 2.0
  • STM32 core version: 2.3
  • Upload method: SWD
    board options

Board (please complete the following information):

  • Name: Nucleo-64 L452RE

Additional context
I think that the "-DENABLE_HWSERIAL2" might have fixed this problem last time, but it no longer works.

hal_conf_extra.h

#define HAL_SAI_MODULE_ENABLED
#define HAL_TIM_MODULE_ENABLED
#define USE_FULL_ASSERT
#define HAL_ADC_MODULE_ENABLED
#define HAL_MODULE_ENABLED
#define HAL_MMC_MODULE_ENABLED
#define HAL_SD_MODULE_ENABLED
#define HAL_GPIO_MODULE_ENABLED
#define HAL_EXTI_MODULE_ENABLED
#define HAL_I2C_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
#define HAL_RCC_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
#define HAL_PWR_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
#define HAL_UART_MODULE_ENABLED
#define HAL_RTC_MODULE_ENABLED

build_opt.h

-DHAL_MODULE_ENABLED
-DHAL_SAI_MODULE_ENABLED
-DHAL_TIM_MODULE_ENABLED
-DHAL_ADC_MODULE_ENABLED
-DHAL_MMC_MODULE_ENABLED
-DHAL_SD_MODULE_ENABLED
-DHAL_GPIO_MODULE_ENABLED
-DHAL_EXTI_MODULE_ENABLED
-DHAL_I2C_MODULE_ENABLED
-DHAL_DMA_MODULE_ENABLED
-DHAL_RCC_MODULE_ENABLED
-DHAL_FLASH_MODULE_ENABLED
-DHAL_PWR_MODULE_ENABLED
-DHAL_CORTEX_MODULE_ENABLED
-DHAL_UART_MODULE_ENABLED
-DHAL_RTC_MODULE_ENABLED
-DENABLE_HWSERIAL2

Thanks

  • Richard
@fpistm
Copy link
Member

fpistm commented Dec 21, 2022

Hi @Bambofy
default Serial is SerialLP1 for this board not Serial2 since 2.0.0. With previous version it was Serial2 but move to SerialLP1 as the same pins can manage both IP and then use it for Low power.

About build_opt.h there is a regression with 2.3.0 that could explain why it does not work. It will be fixed with 2.4.0.

So instead of using Serial2 use SerialLP1 or better Serial which will be mapped on the correct instance.

@fpistm fpistm closed this as completed Dec 21, 2022
@fpistm fpistm added the invalid This doesn't seem right label Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants