Skip to content

Commit e51e56e

Browse files
committed
minimal-printf: Disable floating point support by default
Mbed OS should not require floating point in its base configuration. This provides further code size savings out of the box.
1 parent 8f1bf43 commit e51e56e

File tree

3 files changed

+23
-24
lines changed

3 files changed

+23
-24
lines changed

TESTS/mbed_platform/minimal-printf/compliance/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242

4343
using namespace utest::v1;
4444

45+
// Enbale minimal-printf floating point support as it is disabled by default
46+
#define MBED_CONF_PLATFORM_MINIMAL_PRINTF_ENABLE_FLOATING_POINT 1
4547

4648
static control_t test_printf_d(const size_t call_count)
4749
{

platform/mbed_lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
},
141141
"minimal-printf-enable-floating-point": {
142142
"help": "Enable floating point printing when using mprintf profile",
143-
"value": true
143+
"value": false
144144
},
145145
"minimal-printf-set-floating-point-max-decimals": {
146146
"help": "Maximum number of decimals to be printed",

platform/source/minimal-printf/README.md

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Minimal printf is configured by the following parameters defined in `platform/mb
4141
},
4242
"minimal-printf-enable-floating-point": {
4343
"help": "Enable floating point printing when using minimal-printf profile",
44-
"value": true
44+
"value": false
4545
},
4646
"minimal-printf-set-floating-point-max-decimals": {
4747
"help": "Maximum number of decimals to be printed",
@@ -51,7 +51,7 @@ Minimal printf is configured by the following parameters defined in `platform/mb
5151
}
5252
```
5353

54-
By default, 64 bit integers, floating point and FILE stream printing are enabled.
54+
By default, 64 bit integers support is enabled.
5555

5656
If your target does not require some options then you can override the default configuration in your application `mbed_app.json` and achieve further memory optimisation (see next section for size comparison numbers).
5757

@@ -87,33 +87,30 @@ https://github.com/ARMmbed/mbed-os-example-blinky application compiled with the
8787

8888
Blinky application size on K64F/GCC_ARM
8989

90-
| | File stream | Floating point | 64 bit integers | Flash | RAM |
91-
| - | - | - | - | - | - |
92-
| mbed-printf | | | | 30,944 | 12,096 |
93-
| mbed-printf | | | X | 31,084 | 12,096 |
94-
| mbed-printf | | X | X | 33,824 | 12,096 |
95-
| mbed-printf | X | X | X | 34,304 | 12,096 |
96-
| std printf | X | X | X | 54,158 | 12,112 |
90+
| | Floating point | 64 bit integers | Flash | RAM |
91+
| - | - | - | - | - |
92+
| mbed-printf | | | 30,944 | 12,096 |
93+
| mbed-printf | | X | 31,084 | 12,096 |
94+
| mbed-printf | X | X | 34,304 | 12,096 |
95+
| std printf | X | X | 54,158 | 12,112 |
9796

9897
Blinky application size on K64F/ARMC6
9998

100-
| | File stream | Floating point | 64 bit integers | Flash | RAM |
101-
| - | - | - | - | - | - |
102-
| mbed-printf | | | | 31,543 | xxxxx |
103-
| mbed-printf | | | X | 31,691 | xxxxx |
104-
| mbed-printf | | X | X | 34,515 | xxxxx |
105-
| mbed-printf | X | X | X | 34,647 | xxxxx |
106-
| std printf | X | X | X | 37,458 | xxxxx |
99+
| | Floating point | 64 bit integers | Flash | RAM |
100+
| - | - | - | - | - |
101+
| mbed-printf | | | 31,543 | xxxxx |
102+
| mbed-printf | | X | 31,691 | xxxxx |
103+
| mbed-printf | X | X | 34,647 | xxxxx |
104+
| std printf | X | X | 37,458 | xxxxx |
107105

108106
Blinky application size on K64F/IAR
109107

110-
| | File stream | Floating point | 64 bit integers | Flash | RAM |
111-
| - | - | - | - | - | - |
112-
| mbed-printf | | | | 28,713 | 8,546 |
113-
| mbed-printf | | | X | 28,853 | 8,546 |
114-
| mbed-printf | | X | X | 30,661 | 8,546 |
115-
| mbed-printf | X | X | X | 32,047 | 8,594 |
116-
| std printf | X | X | X | 35,055 | 8,462 |
108+
| | Floating point | 64 bit integers | Flash | RAM |
109+
| - | - | - | - | - |
110+
| mbed-printf | | | 28,713 | 8,546 |
111+
| mbed-printf | | X | 28,853 | 8,546 |
112+
| mbed-printf | X | X | 32,047 | 8,594 |
113+
| std printf | X | X | 35,055 | 8,462 |
117114

118115
### Blinky bare metal application
119116

0 commit comments

Comments
 (0)