2021-12-16 05:05 AM
Ubuntu STM32CubeIDE 1.8/1.7
File -> New -> STM32 Project
Choose STM32L100RB -> Next -> Project Name : "removeMe2" -> Finish
In Device Configuration Tool:
Pinout&Configuration -> Connectivity -> SPI1 -> Mode: Full Duplex Master
Project Manager -> Advanced Setting -> Driver Selector -> SPI: LL
Save and generate code.
Project -> Build All
.........
./Core/Src/main.c: In function 'MX_SPI1_Init':
../Core/Src/main.c:210:3: warning: implicit declaration of function 'LL_SPI_SetStandard' [-Wimplicit-function-declaration]
210 | LL_SPI_SetStandard(SPI1, LL_SPI_PROTOCOL_MOTOROLA);
| ^~~~~~~~~~~~~~~~~~
........
Build Failed. 3 errors, 0 warnings. (took 901ms)
And I can't open declaration (Hotkey - F3) of LL_SPI_SetStandard(). (For other functions IDE try to open *.c file at first, but not *.h. Definition of LL_SPI_SetStandard() in the stm32l1xx_ll_spi.h)
2021-12-16 06:00 AM
Error in library.
#if defined(SPI_CR2_FRF)
/**
* @brief Set serial protocol used. TI Mode not supported for Category 1 and 2.
* @note This bit should be written only when SPI is disabled (SPE = 0) for correct operation.
* @rmtoll CR2 FRF LL_SPI_SetStandard
* @param SPIx SPI Instance
* @param Standard This parameter can be one of the following values:
* @arg @ref LL_SPI_PROTOCOL_MOTOROLA
* @arg @ref LL_SPI_PROTOCOL_TI
* @retval None
*/
__STATIC_INLINE void LL_SPI_SetStandard(SPI_TypeDef *SPIx, uint32_t Standard)
{
MODIFY_REG(SPIx->CR2, SPI_CR2_FRF, Standard);
}
/**
* @brief Get serial protocol used
* @rmtoll CR2 FRF LL_SPI_GetStandard
* @param SPIx SPI Instance
* @retval Returned value can be one of the following values:
* @arg @ref LL_SPI_PROTOCOL_MOTOROLA
* @arg @ref LL_SPI_PROTOCOL_TI
*/
__STATIC_INLINE uint32_t LL_SPI_GetStandard(SPI_TypeDef *SPIx)
{
return (uint32_t)(READ_BIT(SPIx->CR2, SPI_CR2_FRF));
}
#endif
Adding next simbols in the Project -> Properties -> C/C++ General - >Path and Symbols -> Symbols solves the problem (I think, it should be in CMSIS).