cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to run the example code provided for STM32F207-Evaluation board on STM32F407-Discovery board

vikram2399
Associate II
Posted on May 11, 2012 at 07:55

I have purchased the STM32F407-Discovery board.

Earlier I had been working on the STM32 20-21-45-46 G-EVAL board that had STM32F207 series microcontroller.

I had successfully implement own application on STM32F207 series on microcontroller.

Now I am trying to check if the example codes provided with STM32F207 evaluation board such MSC are able to run directly on STM32F407 discovery board without any modification since both the STM32F207 & STM32F407 are pin compatible.

However even though the project is build and loaded on the STM32F407 evaluation board it does not run and states that there has been error in recognizing the device.

Can some one help how to port the code related to STM32F207 on the STM32F407.

#stm32f407
6 REPLIES 6
frankmeyer9
Associate II
Posted on May 11, 2012 at 09:00

Welcome to the world of embedded software engineering.

''pin compatible'' does not mean that memory layout, peripherals, boot behavior and timing are identical. There is hardly a way around adjusting all this issues to the F407.

If your F207 based code uses CMSIS and the PeripheralDriverLib, your task might be relatively easy. If you got down to register level directly, you've probably got some more to do.

By the way, the hardware of the STM32F4Discovery will definitely not match that of your STM32F207 dev board, irrespective of the controller. You should first check if your applications are portable at all.

vikram2399
Associate II
Posted on May 11, 2012 at 09:14

Thanks for your quick response.

Yes the STM32F207 evaluation board example codes are using CMSIS & STM32F2xx_StdPeriph_Driver library.

So what am I suppose to do if I want to make the codes used for STM32F207 evaluation board to run successfully on STM32F407.

Thanks for making it clear what the term pin compatible means.

Does this not makes a false impression created by ST

frankmeyer9
Associate II
Posted on May 11, 2012 at 12:15

> Does this not makes a false impression created by ST

Not in my opinion.

''pin compatible'' means, you can replace an F207 based hardware easily with an F407 based design, and don't necessarily need to create a new layout.

Peripherals often tend to be the same, sometimes with improvments, and often even at the same address. But, for instance, the F407 can be clocked up to 168MHz, and has an FPU, so it's not identical.

There is still some software adaption required, but much less than, e.g., porting it to an LPC1769, which is also a Cortex M3.

vikram2399
Associate II
Posted on May 11, 2012 at 13:51

Thanks once again.

While I was using the application earlier I found an Application note with number AN3427 which is basically an article named ''Migrating a microcontroller application from STM32F1 to STM32F2 series.

I tried to search the same between STM32F2 & STM32F4 but did not get any.

Will you by chance have any idea about the same

The reason I want this as this will give an idea of what is the difference in the STM32F2 & STM32F4 and how I can modify those difference

Posted on May 11, 2012 at 13:51

Yes the STM32F207 evaluation board example codes are using CMSIS & STM32F2xx_StdPeriph_Driver library. So what am I suppose to do if I want to make the codes used for STM32F207 evaluation board to run successfully on STM32F407.

 

You'd make a project using the STM32F4xx_StdPeriph_Driver library, and make sure to tell the IDE what chip and clocks are being used on the new board, for starters. Then you'd need to identify what peripheral and other changes are required.

Does this not makes a false impression created by ST

Hardly, it's not billed as pin and code compatible, pins are physical, software is more ethereal. The library should make the transition relatively easy, but won't stop you from needing to understand both designs and the differences. I've cut-n-pasted code between F1, F2 and F4 designs, it really isn't that hard if you're paying attention.

Can some one help how to port the code related to STM32F207 on the STM32F407.

That would probably depend on your hourly rate, and scope of the changes, ST maintains a list of consultants.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 11, 2012 at 14:01

The reason I want this as this will give an idea of what is the difference in the STM32F2 & STM32F4 and how I can modify those difference

 

 

The primary area is going to be the clocks settings, trees, and the rate of the timers, etc. If you have used hard coded values instead of #defines, and computing settings on the fly. ie if you have a timer generating a 30 KHz PWM, then your code should be able to identify the input clock, and factor the prescaler/period values as required. I've built my code to be agnostic to CPU speed, not least because I want to be able to drop or change the max frequency without rewriting my entire code base. There are plenty of things you can do to make code portable. For one thing don't used hard constants.

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