Skip to content

Possible error of LPUART RCC setting in serial_baud #8110

@Eman869

Description

@Eman869

Description

The RCC configuration looks wrong while setting serial_buad in STM devices LPUART.

In mbed-os/targets/TARGET_STM/serial_api.c

#if ((MBED_CONF_TARGET_LPUART_CLOCK_SOURCE) & USE_LPUART_CLK_LSE)
        if (baudrate <= 9600) {
            // Enable LSE in case it is not already done
            if (!__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY)) {
                RCC_OscInitTypeDef RCC_OscInitStruct = {0};
                RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
                RCC_OscInitStruct.HSIState       = RCC_LSE_ON;
                RCC_OscInitStruct.PLL.PLLState   = RCC_PLL_OFF;
                HAL_RCC_OscConfig(&RCC_OscInitStruct);
            }

RCC_OscInitStruct.HSIState       = RCC_LSE_ON;
should be 
RCC_OscInitStruct.LSEState       = RCC_LSE_ON;

Am I right?

Issue request type

[ ] Question
[ ] Enhancement
[x ] Bug

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions