PRoC BLE can not run floating point math

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JeSy_1305731
Level 4
Level 4
First like received

Is there a way to do floating point math on PRoC  BLE?  I turn on Project->Build Settings->Linker-> use nano lib float  and this appears to overflow on compile?  how much ROM and Ram space does this use?  Is there different ways to turn this on or use this to do printf of a float variable on the uart?  the BLE Stack takes up over 100K space of the 128K ROM,  is there a way to shrink the BLE Stack size?   I am using the Pioneer Demo Board  with cybl10563 PRoC module so I can run on CYBLE022001 module

0 Likes
1 Solution

BLE stack is expected to take up space (to support full protocol implementation) and I don't think there are ways to shrink the stack size.

If you need more Flash, SRAM, Security and other resources, please try PSoC 6 MCU.

View solution in original post

3 Replies
SrikanthD_56
Employee
Employee
25 sign-ins First question asked First comment on blog

Hi

Could you please share the project here? Which PSoC Creator version are you using?

Meanwhile, try setting the Compiler Optimization Level to Size (under Build Settings) and see that resolve the overflow issue.

0 Likes

NO I can not post a project here that contains Intellectual Property of a Company,  I am using PSoC Creator 3.3 so maybe I will try 4.0?  the entire program compiles and runs just fine.  After build I get

Flash used: 129152 of 131072 bytes (98.5 %). Bootloader: 7296 bytes. Application: 121728 bytes. Metadata: 128 bytes.

SRAM used: 14796 of 16384 bytes (90.3 %). Stack: 2048 bytes. Heap: 2048 bytes.

Then if I turn on nano float library as listed in first post I get :

ERROR: .\CortexM0\ARM_GCC_493\Debug\PRoC_BLE_Battery_Level01.elf section `i.smp_passkey_handler' will not fit in region `rom'

ERROR: section .cy_checksum_exclude loaded at [0001fc80,0001ff7f] overlaps section i.se_smp_pairing_rsp_handler loaded at [0001fc08,0001fe77]

ERROR: section i.se_smp_pairing_stk_handler loaded at [0001fe78,0001feb3] overlaps section .cy_checksum_exclude loaded at [0001fc80,0001ff7f]

ERROR: section .cyloadablemeta loaded at [0001ffc0,0001ffff] overlaps section i.se_smp_user_passkey_handler loaded at [0001ff50,0001ffe3]

ERROR: section i.smp_passkey_handler loaded at [0001ffe4,000201d7] overlaps section .cyloadablemeta loaded at [0001ffc0,0001ffff]

ERROR: region `rom' overflowed by 0 bytes

collect2.exe: error: ld returned 1 exit status

The command 'arm-none-eabi-gcc.exe' failed with exit code '1'.

I am not sure how it can tell me ROM overflowed, but then turn around and say 'rom' overflowed by 0 bytes?

so turning on optimization to Size gets a good compile,  however this will not help me in stepping through the code in the debugger mode.  compile with <Size> gives me:

Flash used: 123520 of 131072 bytes (94.2 %). Bootloader: 7296 bytes. Application: 116096 bytes. Metadata: 128 bytes.

SRAM used: 14828 of 16384 bytes (90.5 %). Stack: 2048 bytes. Heap: 2048 bytes.

and compile with Optimization set to <Debug> gives me this result:  which I can probably use?

Flash used: 125952 of 131072 bytes (96.1 %). Bootloader: 7296 bytes. Application: 118528 bytes. Metadata: 128 bytes.

SRAM used: 14860 of 16384 bytes (90.7 %). Stack: 2048 bytes. Heap: 2048 bytes.

But I still have the same question,  Why does the BLE stack take up so much space?  around 100K of 128K total?

Also updating to PSoC 4.1 and components update actually made the problem worse now <Debug> compile gives me

Flash used: 128520 of 131072 bytes (98.1 %). Bootloader: 7296 bytes. Application: 121096 bytes. Metadata: 128 bytes.

SRAM used: 15012 of 16384 bytes (91.6 %). Stack: 2048 bytes. Heap: 2048 bytes.

0 Likes

BLE stack is expected to take up space (to support full protocol implementation) and I don't think there are ways to shrink the stack size.

If you need more Flash, SRAM, Security and other resources, please try PSoC 6 MCU.