Skip to main content
kisstibor
Visitor II
December 15, 2016
Question

stm32l1xx_ll_spi.h BUG and Warning

  • December 15, 2016
  • 2 replies
  • 929 views
Posted on December 15, 2016 at 18:16

Dear Sirs

File : stm32l1xx_ll_spi.h

Very ugly BUG !!!!

__STATIC_INLINE void LL_GPIO_ResetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)

{

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

&sharpif defined(GPIO_BRR_BR_0)   !!!!!!!   Correct : 

(GPIO_BRR)  !!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

WRITE_REG(GPIOx->BRR, PinMask);

&sharpelse

WRITE_REG(GPIOx->BSRR, (PinMask << 16));

&sharpendif /* GPIO_BRR_BR_0 */

}

OpenSTM32 rise a warning :

arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -D__weak=__attribute__((weak)) -D__packed=__attribute__((__packed__)) -DUSE_HAL_DRIVER -DSTM32L100xC

stm32l1xx_ll_spi.h:1137:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

__STATIC_INLINE void LL_SPI_TransmitData16(SPI_TypeDef *SPIx, uint16_t TxData)

{

*((__IO uint16_t *)&SPIx->DR) = TxData;

}

This code compiled without warning :

__STATIC_INLINE void LL_SPI_TransmitData8(SPI_TypeDef *SPIx, uint8_t TxData)

{

*((__IO uint8_t *)&SPIx->DR) = TxData;

}

Thanks

Tibor Kiss

#stm32l1xx_ll_spi.h-warning
This topic has been closed for replies.

2 replies

ST Technical Moderator
December 20, 2016
Posted on December 20, 2016 at 17:44

Dear

Kiss.Tibor

‌,

Please note that yourreported issueis tracked internally. It will bechecked andcome back to you.

All your feedback are welcome in order to improve our solutions.

Sorry for any inconvenience this may cause andThank you for your contribution.

Best Regards

-Imen-

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. Thanks
ST Technical Moderator
March 13, 2017
Posted on March 13, 2017 at 14:42

Hi,

After deep check in the firmware package, there is no issue faced with the GPIO_BRR_BR_0 definition.

Could you please explain your issue and the reason for giving your proposal?

Imen

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. Thanks