cancel
Showing results for 
Search instead for 
Did you mean: 

How to use STM Standard Peripheral Library with ST Visual Develop?

loder
Associate II
Posted on May 13, 2016 at 22:26

Hello forum,

i am currently trying to use the STM Standard Peripheral Library with ST Visual Develop & Cosmic C Compiler. I downloaded the Standard Peripheral Library and included the header files in 'Include Files' in my Project Directory. I inlcuded the header file 'stm8s_spi.h' but as soon as i want to use a SPI function (such as 'SPI_DeInit()' and compile i get an error like this:

Running Linker
clnk -m Debug\adxl345_spi.map -l
''C:\Program Files (x86)\COSMIC\FSE_Compilers\Lib''
-o Debug\adxl345_spi.sm8 Debug\adxl345_spi.lkf 
#error clnk Debug\adxl345_spi.lkf:1 symbol _SPI_DeInit not defined (Debug\main.o )
The command: 
''clnk -m Debug\adxl345_spi.map -l''
C:\Program Files (x86)\COSMIC\FSE_Compilers\Lib
'' -o Debug\adxl345_spi.sm8 Debug\adxl345_spi.lkf ''
has failed, the returned value 
is
: 1
exit code=1.

Do you have any idea what i miss? With best regards #i2c #spi #crosstalk #uart #stm8
1 REPLY 1
Posted on May 20, 2016 at 19:21

Header files don't contain code, you must also supply the compiled library code to the linker for it to have something to link too.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..