Skip to content

Commit

Permalink
minimal-printf: Disable floating point support by default
Browse files Browse the repository at this point in the history
Mbed OS should not require floating point in its base configuration.
This provides further code size savings out of the box.
  • Loading branch information
hugueskamba committed Sep 11, 2019
1 parent 8f1bf43 commit 03c484a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
2 changes: 1 addition & 1 deletion platform/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
},
"minimal-printf-enable-floating-point": {
"help": "Enable floating point printing when using mprintf profile",
"value": true
"value": false
},
"minimal-printf-set-floating-point-max-decimals": {
"help": "Maximum number of decimals to be printed",
Expand Down
43 changes: 20 additions & 23 deletions platform/source/minimal-printf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Minimal printf is configured by the following parameters defined in `platform/mb
},
"minimal-printf-enable-floating-point": {
"help": "Enable floating point printing when using minimal-printf profile",
"value": true
"value": false
},
"minimal-printf-set-floating-point-max-decimals": {
"help": "Maximum number of decimals to be printed",
Expand All @@ -51,7 +51,7 @@ Minimal printf is configured by the following parameters defined in `platform/mb
}
```

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

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).

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

Blinky application size on K64F/GCC_ARM

| | File stream | Floating point | 64 bit integers | Flash | RAM |
| - | - | - | - | - | - |
| mbed-printf | | | | 30,944 | 12,096 |
| mbed-printf | | | X | 31,084 | 12,096 |
| mbed-printf | | X | X | 33,824 | 12,096 |
| mbed-printf | X | X | X | 34,304 | 12,096 |
| std printf | X | X | X | 54,158 | 12,112 |
| | Floating point | 64 bit integers | Flash | RAM |
| - | - | - | - | - |
| mbed-printf | | | 32,972 | 11,608 |
| mbed-printf | | X | 33,116 | 11,608 |
| mbed-printf | X | X | 35,856 | 11,608 |
| std printf | X | X | 55,766 | 12,104 |

Blinky application size on K64F/ARMC6

| | File stream | Floating point | 64 bit integers | Flash | RAM |
| - | - | - | - | - | - |
| mbed-printf | | | | 31,543 | xxxxx |
| mbed-printf | | | X | 31,691 | xxxxx |
| mbed-printf | | X | X | 34,515 | xxxxx |
| mbed-printf | X | X | X | 34,647 | xxxxx |
| std printf | X | X | X | 37,458 | xxxxx |
| | Floating point | 64 bit integers | Flash | RAM |
| - | - | - | - | - |
| mbed-printf | | | 33,585 | xxxxx |
| mbed-printf | | X | 33,679 | xxxxx |
| mbed-printf | X | X | 36,525 | xxxxx |
| std printf | X | X | 39,128 | xxxxx |

Blinky application size on K64F/IAR

| | File stream | Floating point | 64 bit integers | Flash | RAM |
| - | - | - | - | - | - |
| mbed-printf | | | | 28,713 | 8,546 |
| mbed-printf | | | X | 28,853 | 8,546 |
| mbed-printf | | X | X | 30,661 | 8,546 |
| mbed-printf | X | X | X | 32,047 | 8,594 |
| std printf | X | X | X | 35,055 | 8,462 |
| | Floating point | 64 bit integers | Flash | RAM |
| - | - | - | - | - |
| mbed-printf | | | 31,439 | 8,493 |
| mbed-printf | | X | 31,579 | 8,493 |
| mbed-printf | X | X | 33,387 | 8,493 |
| std printf | X | X | 36,643 | 8,553 |

### Blinky bare metal application

Expand Down

0 comments on commit 03c484a

Please sign in to comment.