cancel
Showing results for 
Search instead for 
Did you mean: 

Can I port the StdPeriphDriver from discovery to other boards?

wbarkley
Associate II
Posted on November 12, 2012 at 22:53

I love the StdPeriphDriver files (inc, src) for all the discovery products.  I recently received a Keil MCBSTM32F400 evaluation board that uses a ST32F4407IG.  Question is can I port the StdPerhipDrivers from F4 Discovery examples and use on the Keil board?

6 REPLIES 6
Posted on November 13, 2012 at 00:00

Why would you need to port it? The StdPeriphDriver is a chip level abstraction, not a board one.

The board specific examples in the ''Utilities'' directory target specific EVAL boards, you might have to port them to address different pin and schematics changes of non-ST boards.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
wbarkley
Associate II
Posted on November 13, 2012 at 14:58

So can I take a STM32F4 Discovery example project as is and download into my Keil board?  Change target, linker, debug?

Or

Is it best to take the Blinky example project from the Keil board and add all the header files into that project?

Posted on November 13, 2012 at 15:57

Projects typically pull in the includes via stm324xx_conf.h, and have the include paths pointing to the assorted library directories.

You might start by looking at the DSP library, or USB one. The template in STM32F4xx_DSP_StdPeriph_Lib_V1.0.1\Project\STM32F4xx_StdPeriph_Templates\MDK-ARM being a good starting point from the include directory and define settings. It also has a richer set of examples for the peripherals.

I'm not sure of the practicality of pulling the STM32F4-Discovery demo over, you'd need to see if the external hardware matches in a meaningful way, and alter the GPIO assignments to match.

The Blinky example doesn't really use the library in a way that matches the way ST generally does things, so it might be more difficult to merge in other examples.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
wbarkley
Associate II
Posted on November 13, 2012 at 21:55

I just used \\STM32F4-Discovery_FW_V1.1.0\Project\Peripheral_Examples\IO_Toggle and have been trying to modify from there.

The only file that I can tell that is Discovery specific is the stm32f4_discovery.c/.h.  Is this where I would rename the file to something like stm32f4_KEILMCB.c/.h and make my GPIO align with my peripherials there?  Isn't the stm32f4xx_conf.c still be looking for the stm32f4_discovery file.  What specifically do I need to do to get the IO Toggle program to be able to download on my Keil board where I can then start developing?

wbarkley
Associate II
Posted on November 13, 2012 at 22:10

I am also trying to use that template Project you recommended - Is there anything I need to change to make things start working?  You said something about lining up the GPIO with the external hardware.  When I downloaded into my Keil board, will things immediate stop working?

Posted on November 13, 2012 at 23:09

You might want to check what defines the project is sending the compiler.

You will need to reconfigure the debug/flash options to reflect the JTAG pod you are using, and the algorithm to write the flash memory.

Downloading new code will erase the current/default application from the board.

You might also need to look at system_stm32f4xx.c and confirm if the Keil board uses a different HSE crystal, and that HSE_VALUE matches.

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