Skip to main content
stst9180
Associate III
February 14, 2022
Solved

LL_SPI_SetStandard created for STM32L151 although Firmware does not support this call.

  • February 14, 2022
  • 6 replies
  • 1356 views

Hi Folks, Currently Stm32CubeMx Generator for STM32L151 creates an "LL_SPI_SetStandard" call in spi.c which is not available for that device. That seems to be a bug here.

This topic has been closed for replies.
Best answer by Sara BEN HADJ YAHYA

Hello @stst9180​  , @TDK​ 

Thanks for your feedback,

You are right, This is a CubeMX code generation bug, The LL_SPI_SetStandard is not supported for category 1 or category 2 STM32L1 devices as SPI_CR2_FRF bit is not defined for these devices.

The SPI_CR2_FRF bit, which represents the SPI TI mode, is only available in the category 3, category 4, category 5 and category 6 devices and not whole STM32L1 devices. 

The devices categories are described in the "section 1.5 Product category definition" of the RM0038 reference manual.

This issue was already detected and raised to the dev team to be fixed. I'll keep you posted with the updates.

Internal ticket number: 122799 (This is an internal tracking number and is not accessible or usable by customers).

Thanks @Amel NASRI​ ​ for flagging this to us.

If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)

Sara.

6 replies

TDK
February 14, 2022

It's only defined if SPI_CR2_FRF is defined, which for the STM32L151XB, it is not.

https://github.com/STMicroelectronics/STM32CubeL1/blob/master/Drivers/STM32L1xx_HAL_Driver/Inc/stm32l1xx_ll_spi.h#L359

https://github.com/STMicroelectronics/STM32CubeL1/blob/master/Drivers/CMSIS/Device/ST/STM32L1xx/Include/stm32l151xb.h

There are many "STM32L151" chips, I didn't check them all. Perhaps be more precise.

"If you feel a post has answered your question, please click ""Accept as Solution""."
stst9180
stst9180Author
Associate III
February 14, 2022

Sorry. I'm talking about STM32L151RBTxA.

So in the header it's not defined, you're right.

Unfortunately the CubeMX initializationcode generator still produces the call to that function in the LL initialization code.

Regards

Pascal

TDK
February 14, 2022

Yes, sounds like a CubeMX generation bug.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Amel NASRI
ST Technical Moderator
February 14, 2022

Hi @stst9180​ & @TDK​ ,

Thanks for reporting & investigating the issue.

@Sara BEN HADJ YAHYA​  could you please have a look?

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
Sara BEN HADJ YAHYA
ST Technical Moderator
February 15, 2022

Hello @stst9180​  , @TDK​ 

Thanks for your feedback,

You are right, This is a CubeMX code generation bug, The LL_SPI_SetStandard is not supported for category 1 or category 2 STM32L1 devices as SPI_CR2_FRF bit is not defined for these devices.

The SPI_CR2_FRF bit, which represents the SPI TI mode, is only available in the category 3, category 4, category 5 and category 6 devices and not whole STM32L1 devices. 

The devices categories are described in the "section 1.5 Product category definition" of the RM0038 reference manual.

This issue was already detected and raised to the dev team to be fixed. I'll keep you posted with the updates.

Internal ticket number: 122799 (This is an internal tracking number and is not accessible or usable by customers).

Thanks @Amel NASRI​ ​ for flagging this to us.

If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)

Sara.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
Sara BEN HADJ YAHYA
ST Technical Moderator
March 8, 2022

Hello @stst9180 ​,

This issue is fixed in STM32CubeMX latest release.

V6.5.0 is now available under this Link.

Thanks for your contribution.

Sara.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.