Floating point support on STM32F4

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
dflogeras
Posts: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Floating point support on STM32F4

Post by dflogeras »

Hi,

Using a STM32F407 discovery board with ChibiOS-2.6.3. GCC is 4.7.3, binutils-2.23.2, newlib-2.0.0

Now that I've gotten a working C++ setup, I am seeing this issue. I have this class template:

Code: Select all

template< typename T >
class foo {
  public:
    foo( T t ) { t_ = t; }
  private:
    T t_;
};


I have set up the Makefile with USE_FPU = YES.

When compiled, if I instantiate a foo<int> in main() it works as expected. When I instantiate a foo< float >, it immediately goes to the _unhandled_exception() handler. I cannot even single step into the constructor.

I have tried enabling DBG options chconf.h, as well as tried with mfloat-abi=hard, softfp and soft.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Floating point support on STM32F4

Post by Giovanni »

Try updating to 2.6.5, note that the configuration files and Makefiles are a bit different, take them from the latest version.

Most likely it is a compiler/library issue anyway.

Giovanni
dflogeras
Posts: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

Re: Floating point support on STM32F4

Post by dflogeras »

Upgrading to ChibiOS-2.6.5 made this problem go away.

Would you like to pursue the issue further to figure out why it fixed it, or does that hold any value?

Either way, thank you very much Giovanni
exuvo
Posts: 2
Joined: Thu Aug 07, 2014 11:30 am

Re: Floating point support on STM32F4

Post by exuvo »

dflogeras take a look at the changelog and you will find what was fixed.
Post Reply