2012-11-12 01:53 PM
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?
2012-11-12 03:00 PM
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.2012-11-13 05:58 AM
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?2012-11-13 06:57 AM
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.2012-11-13 12:55 PM
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?2012-11-13 01:10 PM
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?
2012-11-13 02:09 PM
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.