cancel
Showing results for 
Search instead for 
Did you mean: 

ModusToolbox Bluetooth SDK

Contributor II

I ported code from my MT 1.1 into an empty project.  It compiled fine on MT 1.1.  I am getting errors that look like it can't find routines in the floating point libs when it links.  I have included math.h

#include "CN0397.h"

#include "SPI_Comm.h"

#include "AD7798.h"

#include <math.h>

#include "sparcommon.h"

#include "wiced_bt_dev.h"

#include "wiced_bt_trace.h"

#include "wiced_hal_gpio.h"

#include "wiced_rtos.h"

#include "wiced_platform.h"

These are the errors that I am seeing

Linking output file EmptyWicedBluetooth.elf

C:/Users/mike/mtw2_0/CN0397/template/empty_wiced_bt/build/CYW920819EVB-02/Debug/cn0397.o: In function `CN0397_DisplayData':

C:\Users\mike\mtw2_0\CN0397\template\empty_wiced_bt/cn0397.c:111: undefined reference to `__aeabi_f2uiz'

C:\Users\mike\mtw2_0\CN0397\template\empty_wiced_bt/cn0397.c:111: undefined reference to `__aeabi_fmul'

C:/Users/mike/mtw2_0/CN0397/template/empty_wiced_bt/build/CYW920819EVB-02/Debug/cn0397.o: In function `CN0397_ConvertToVoltage':

C:\Users\mike\mtw2_0\CN0397\template\empty_wiced_bt/cn0397.c:146: undefined reference to `__aeabi_i2d'

C:\Users\mike\mtw2_0\CN0397\template\empty_wiced_bt/cn0397.c:146: undefined reference to `__aeabi_dmul'

C:\Users\mike\mtw2_0\CN0397\template\empty_wiced_bt/cn0397.c:146: undefined reference to `__aeabi_d2f'

C:\Users\mike\mtw2_0\CN0397\template\empty_wiced_bt/cn0397.c:146: undefined reference to `__aeabi_fdiv'

C:/Users/mike/mtw2_0/CN0397/template/empty_wiced_bt/build/CYW920819EVB-02/Debug/cn0397.o: In function `CN0397_SetBar':

C:\Users\mike\mtw2_0\CN0397\template\empty_wiced_bt/cn0397.c:268: undefined reference to `__aeabi_fcmpgt'

C:\Users\mike\mtw2_0\CN0397\template\empty_wiced_bt/cn0397.c:268: undefined reference to `__aeabi_fadd'

C:\Users\mike\mtw2_0\CN0397\template\empty_wiced_bt/cn0397.c:268: undefined reference to `__aeabi_fcmpge'

C:/Users/mike/mtw2_0/CN0397/template/empty_wiced_bt/build/CYW920819EVB-02/Debug/cn0397.o: In function `CN0397_SetAppData':

C:\Users\mike\mtw2_0\CN0397\template\empty_wiced_bt/cn0397.c:227: undefined reference to `__aeabi_i2f'

C:\Users\mike\mtw2_0\CN0397\template\empty_wiced_bt/cn0397.c:227: undefined reference to `__aeabi_fmul'

C:\Users\mike\mtw2_0\CN0397\template\empty_wiced_bt/cn0397.c:227: undefined reference to `__aeabi_fdiv'

Is there something that I need to add to the linker config?

Thanks,

Mike Roberts

0 Likes
Reply
1 Solution
Moderator
Moderator

Hi Mike,

Can you please add CY_RECIPE_EXTRA_LIBS+=-lgcc  in make file and try rebuild.

Regards,

Anjana

View solution in original post

6 Replies
Moderator
Moderator

Hi MiRo_263836​,

Can you please share your project or at least a minimal version of it so that I can debug the issue?

I tried including math.h in MTB 2.0 and using some of the functions defined in math.h and I was able to build the project directly without any errors.

Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes
Reply
Contributor II

I did an export general archive.

0 Likes
Reply
Contributor II

Any progress on this?

0 Likes
Reply
Moderator
Moderator

Hi Mike,

Can you please add CY_RECIPE_EXTRA_LIBS+=-lgcc  in make file and try rebuild.

Regards,

Anjana

View solution in original post

Contributor II

With that line in the makefile, it compiles without errors.  I removed that line and how it compiles without errors. I have another couple of projects that I need to import that use floating point libs as well.  I will try those and see how if they compile without errors.

Thank you.  I would never have been able to figure that out.

Moderator
Moderator

Hi Mike,

I have requested our software team to fix this issue.

Sorry for the inconvenience caused for you.

Regards,

Anjana

0 Likes
Reply