GPIO / Clocks / etc.

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
SpacedCowboy
Posts: 5
Joined: Fri Oct 18, 2013 9:28 pm

GPIO / Clocks / etc.

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: GPIO / Clocks / etc.

Post 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
SpacedCowboy
Posts: 5
Joined: Fri Oct 18, 2013 9:28 pm

Re: GPIO / Clocks / etc.

Post 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...
Post Reply