cancel
Showing results for 
Search instead for 
Did you mean: 

Adopt STM32F4 Discovery Board Code to STM32F405

jim_wei
Associate II
Posted on March 22, 2014 at 10:18

My application board has STM32F405RG microcontroller.  I tried to use a project came from STM32F4 Discovery Board by just changing the microcontroller from Keil manual ''Project\Select Device for Target 'ST Link Flash..., selecting STM32F405RG, then Rebuild all target files.  The following error occured:

C:\Keil\ARM\CMSIS\Include\core_cm4.h(97): warning:  #1215-D: #warning directive: ''Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)''

The strange thing is that after I change the device back to STM32F407VG which is the original selection and Rebuild all target files, the same error occured again. 

Can anyone tell me why?

Thanks!

4 REPLIES 4
Posted on March 22, 2014 at 15:40

In the past, I've found that changing  the 'target device' setting on an existing  Keil project didn't work - it didn't update all the things that were done in creating the project.

It seemed that the setting was only (fully) used when creating  a new  project - not for updating an existing project.

Therefore, I've not tried it lately;  so don't know if that's still true - but your experience rather suggests that it is...
Posted on March 22, 2014 at 16:38

Well, you might want to go double check things like MicroLib, Use FPU, Include Paths, Defines, Target Memory Map, etc within the Project.

I don't recall having that much grief changing part designators, but as Andrew says the scope of what it changes is some what ill defined, the main reason I change it is to get the compiler to the right CPU, and define the Target memory map. I tend to make template/shell projects that work to my satisfaction, and then clone them. When porting to a different architecture (chip or fw library revision), I create a new shell project and then add back in the key files I need, and all the new files from the new target architecture. ie a Mix-n-Match approach. Then I go back in and fix any include file references, which I try to localize, and then fix the things that need changing to match the new architecture.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jim_wei
Associate II
Posted on March 25, 2014 at 03:01

Thanks clive1.  You pointed to the right direction.  I created a new project for STM32F405.  Then I checked the C/C++ tab of Options.  Here is what's different in the ''Compiler control string'' field:  

Original : 

-c –cpu Cortex-M4 –D__RTX –D__MICROLIB -g

New project I created for STM32F405:

-c --cpu Cortex-M4.fp -g

I tried to modified the content of this field.  But it can not be changed.  So it must be set from somewhere else and I don't know where.

Jim

Amel NASRI
ST Employee
Posted on March 25, 2014 at 11:25

In the ''Target'' tab of options, select ''Use MicroLIB''.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.