Skip to main content
jim_wei
Associate II
March 22, 2014
Question

Adopt STM32F4 Discovery Board Code to STM32F405

  • March 22, 2014
  • 4 replies
  • 1113 views
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!

    This topic has been closed for replies.

    4 replies

    Andrew Neil
    Super User
    March 22, 2014
    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...
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Tesla DeLorean
    Guru
    March 22, 2014
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    jim_wei
    jim_weiAuthor
    Associate II
    March 25, 2014
    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 Technical Moderator
    March 25, 2014
    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 "Best Answer" on the reply which solved your issue or answered your question.