Page 1 of 1

GPIO / Clocks / etc.

Posted: Wed Jan 29, 2014 2:37 am
by SpacedCowboy
Hi,

I'm trying to port some code from a previous app (running bare-metal on the STM32F4) and I'm getting stuck on things like:

Code: Select all

/**************************************************************************\
|* Enable the FSMC clock
\**************************************************************************/
 // RCC_AHB3PeriphClockCmd(RCC_AHB3Periph_FSMC, ENABLE);
rccEnableAHB3(RCC_AHB3LPENR_FSMCLPEN, 1);   

where the first line is what I would have used previously, and the second is the closest thing I can find. Obviously it's not portable, but at this point I don't really care - it's only ever going to run on an STM32F4.

Any pointers as to how to get down to the low-level stuff ?

Cheers
Simon

Re: GPIO / Clocks / etc.

Posted: Wed Jan 29, 2014 9:10 am
by Giovanni
Hi,

You can also use the original code or use the HAL low level macros like rccEnableAHB3(RCC_AHB3LPENR_FSMCLPEN, 1). Note that you should not use the "LP" version of those definitions, the second parameter affects the low power mode.

Look into the xxx_lld_start() functions present in the various device drivers, there you can find examples of most of those low level initializations (clocks, IRQs, DMAs).

Giovanni

Re: GPIO / Clocks / etc.

Posted: Wed Jan 29, 2014 5:39 pm
by SpacedCowboy
Hmm. That doesn't seem to be working for me :(

No matter which form I use, I get undefined symbols. I'll have a look in the the device drivers and see what extra headers they're including...

Never mind, I was being an idiot. For some reason I'd commented out the #include "hal.h" so it wasn't finding the definitions...