Skip to content

Commit 7f2825f

Browse files
hugueskambaadbridge
authored andcommitted
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 7df8b58 commit 7f2825f

File tree

2 files changed

+21
-24
lines changed

2 files changed

+21
-24
lines changed

platform/mbed_lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
},
135135
"minimal-printf-enable-floating-point": {
136136
"help": "Enable floating point printing when using mprintf profile",
137-
"value": true
137+
"value": false
138138
},
139139
"minimal-printf-set-floating-point-max-decimals": {
140140
"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 | | | 32,972 | 11,608 |
93+
| mbed-printf | | X | 33,116 | 11,608 |
94+
| mbed-printf | X | X | 35,856 | 11,608 |
95+
| std printf | X | X | 55,766 | 12,104 |
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 | | | 33,585 | xxxxx |
102+
| mbed-printf | | X | 33,679 | xxxxx |
103+
| mbed-printf | X | X | 36,525 | xxxxx |
104+
| std printf | X | X | 39,128 | 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 | | | 31,439 | 8,493 |
111+
| mbed-printf | | X | 31,579 | 8,493 |
112+
| mbed-printf | X | X | 33,387 | 8,493 |
113+
| std printf | X | X | 36,643 | 8,553 |
117114

118115
### Blinky bare metal application
119116

0 commit comments

Comments
 (0)