Page 1 of 1

Floating point support on STM32F4

Posted: Fri Aug 01, 2014 5:56 pm
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.

Re: Floating point support on STM32F4

Posted: Fri Aug 01, 2014 7:05 pm
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

Re: Floating point support on STM32F4

Posted: Fri Aug 01, 2014 10:24 pm
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

Re: Floating point support on STM32F4

Posted: Thu Aug 07, 2014 12:05 pm
by exuvo
dflogeras take a look at the changelog and you will find what was fixed.