cancel
Showing results for 
Search instead for 
Did you mean: 

Moving on from blinky, how?

rithers
Associate II
Posted on July 19, 2016 at 09:36

Hi my name is Etienne, I am new to microcontrollers and I'm still banging my head against the wall.  

I would like to run a simple USART printf function to get things going.  

To keep it short,  Ive got a Nucleo F103, Keil uVision5, using the 'pack installer' to load up a blinky program works fine,  but as soon as I try to use some of the library functions like

USART_StructInit();,  i get:

warning: implicit declaration invalid in C99,

then I go into RTE manager, add and resolve USART StdPeriph Drivers,

now USART_StructInit(); has too few arguments,  and USARTInit() is undefined.   

Is there any resource which explains how to use Peripheral Library functions, step by step?

I am having such a hard time finding code examples that work!

...spent a few hours trying to get the MCBSTM discovery examples to run, to no avail.  

...spent another few hours trying to step-by-step with the data sheet, still no luck.
11 REPLIES 11
rithers
Associate II
Posted on July 28, 2016 at 03:49

some questions -

-in which file do I need to define USE_STDPERIPH_DRIVER?

-Where can I learn more about this, (setting up the stm32fxxx_conf.h file, the proper includes, etc) besides combing forums and youtube instructionals?

/etienne

AvaTar
Lead
Posted on July 28, 2016 at 09:10

> -in which file do I need to define USE_STDPERIPH_DRIVER?

 

The best way to do this is -not- in a file, but instead with the project settings (depends on your IDE).

There is usually a item called ''preprocessor definitions''. Or add ''-DUSE_STDPERIPH_DRIVER'' to the compile flags.

> -Where can I learn more about this, (setting up the stm32fxxx_conf.h file, the proper includes, etc) besides combing forums and youtube instructionals?

 

Since ST repeatedly expressed the intention to abandon the SPL, probably only by inspecting working projects, and by experience.

The include directories for SPL projects are basically always the same - so just copy from another, working example.

The ''stm32fxxx_conf.h'' file assumed to be project specific, and is/should be copied into your project folder. The default state is to include everything. Just comment out or remove what you don't need.