Skip to content

STM stm_spi_api.c:spi_frequency has a bug with a -1 index into the baudrate_prescaler_table #3735

Closed
@helmut64

Description

@helmut64

The problem occures e.g. on the STM32L4 when a 40 Mhz hz value is being used.
See file stm_spi_api.c:

handle->Init.BaudRatePrescaler = baudrate_prescaler_table[prescaler_rank-1];

With the 40000000 hz sample, the baudrate_prescaler_table is zero and initializes the Init.BaudRatePrescaler with random values. The previous hal implementation in spi_frequency file spi_api.c does not have this problem.
Regards Helmut

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