@@ -18,16 +18,18 @@ Supports:
18
18
* %s: string.
19
19
* %p: pointer (e.g. 0x00123456).
20
20
21
- ## Enabling floating point and setting baud rate
21
+ ## Enabling floating point, 64 bit integers, new line conversion, and setting baud rate
22
22
23
23
In mbed_app.json:
24
24
25
25
```
26
26
"target_overrides": {
27
27
"*": {
28
28
"platform.stdio-baud-rate": 115200,
29
- "minimal-printf.floating-point": true,
30
- "minimal-printf.floating-point-max-decimals": 10
29
+ "platform.stdio-convert-newlines": false,
30
+ "minimal-printf.enable-floating-point": false,
31
+ "minimal-printf.set-floating-point-max-decimals": 6,
32
+ "minimal-printf.enable-64-bit": true
31
33
}
32
34
}
33
35
```
@@ -84,148 +86,12 @@ int main()
84
86
}
85
87
```
86
88
89
+ ### Full application size on K64F/GCC
87
90
88
- ### K64F GCC minimal printf without floating point
89
-
90
- ```
91
- +------------------------------------------+-------+-------+------+
92
- | Module | .text | .data | .bss |
93
- +------------------------------------------+-------+-------+------+
94
- | [fill] | 16 | 3 | 2102 |
95
- | [lib]/c.a/lib_a-init.o | 80 | 0 | 0 |
96
- | [lib]/c.a/lib_a-memcpy.o | 308 | 0 | 0 |
97
- | [lib]/c.a/lib_a-memset.o | 156 | 0 | 0 |
98
- | [lib]/misc/ | 248 | 4 | 28 |
99
- | main.o | 256 | 0 | 0 |
100
- | mbed-os/hal/mbed_gpio.o | 96 | 0 | 0 |
101
- | mbed-os/hal/mbed_pinmap_common.o | 212 | 0 | 0 |
102
- | mbed-os/hal/mbed_ticker_api.o | 214 | 0 | 0 |
103
- | mbed-os/hal/mbed_us_ticker_api.o | 44 | 0 | 24 |
104
- | mbed-os/platform/mbed_board.o | 90 | 0 | 0 |
105
- | mbed-os/platform/mbed_critical.o | 56 | 0 | 5 |
106
- | mbed-os/platform/mbed_error.o | 32 | 0 | 1 |
107
- | mbed-os/platform/mbed_retarget.o | 20 | 0 | 0 |
108
- | mbed-os/platform/mbed_sdk_boot.o | 74 | 0 | 0 |
109
- | mbed-os/platform/mbed_wait_api_no_rtos.o | 32 | 0 | 0 |
110
- | mbed-os/targets/TARGET_Freescale | 4758 | 12 | 384 |
111
- | mbed-printf/mbed_printf.o | 960 | 1 | 188 |
112
- | Subtotals | 7652 | 20 | 2732 |
113
- +------------------------------------------+-------+-------+------+
114
- Total Static RAM memory (data + bss): 2752 bytes
115
- Total Flash memory (text + data): 7672 bytes
116
- ```
117
-
118
-
119
- ### K64F GCC minimal printf with floating point
120
-
121
- ```
122
- +------------------------------------------+-------+-------+------+
123
- | Module | .text | .data | .bss |
124
- +------------------------------------------+-------+-------+------+
125
- | [fill] | 24 | 3 | 2102 |
126
- | [lib]/c.a/lib_a-init.o | 80 | 0 | 0 |
127
- | [lib]/c.a/lib_a-memcpy.o | 308 | 0 | 0 |
128
- | [lib]/c.a/lib_a-memset.o | 156 | 0 | 0 |
129
- | [lib]/gcc.a/_arm_addsubdf3.o | 880 | 0 | 0 |
130
- | [lib]/gcc.a/_arm_fixdfsi.o | 80 | 0 | 0 |
131
- | [lib]/gcc.a/_arm_muldivdf3.o | 1060 | 0 | 0 |
132
- | [lib]/misc/ | 248 | 4 | 28 |
133
- | main.o | 256 | 0 | 0 |
134
- | mbed-os/hal/mbed_gpio.o | 96 | 0 | 0 |
135
- | mbed-os/hal/mbed_pinmap_common.o | 212 | 0 | 0 |
136
- | mbed-os/hal/mbed_ticker_api.o | 214 | 0 | 0 |
137
- | mbed-os/hal/mbed_us_ticker_api.o | 44 | 0 | 24 |
138
- | mbed-os/platform/mbed_board.o | 90 | 0 | 0 |
139
- | mbed-os/platform/mbed_critical.o | 56 | 0 | 5 |
140
- | mbed-os/platform/mbed_error.o | 32 | 0 | 1 |
141
- | mbed-os/platform/mbed_retarget.o | 20 | 0 | 0 |
142
- | mbed-os/platform/mbed_sdk_boot.o | 74 | 0 | 0 |
143
- | mbed-os/platform/mbed_wait_api_no_rtos.o | 32 | 0 | 0 |
144
- | mbed-os/targets/TARGET_Freescale | 4758 | 12 | 384 |
145
- | mbed-printf/mbed_printf.o | 1160 | 1 | 188 |
146
- | Subtotals | 9880 | 20 | 2732 |
147
- +------------------------------------------+-------+-------+------+
148
- Total Static RAM memory (data + bss): 2752 bytes
149
- Total Flash memory (text + data): 9900 bytes
150
- ```
151
-
152
-
153
- ### K64F GCC standard printf
154
-
155
- ```
156
- +------------------------------------------+-------+-------+------+
157
- | Module | .text | .data | .bss |
158
- +------------------------------------------+-------+-------+------+
159
- | [fill] | 62 | 4 | 2071 |
160
- | [lib]/c.a/lib_a-callocr.o | 96 | 0 | 0 |
161
- | [lib]/c.a/lib_a-closer.o | 36 | 0 | 0 |
162
- | [lib]/c.a/lib_a-ctype_.o | 257 | 0 | 0 |
163
- | [lib]/c.a/lib_a-dtoa.o | 3948 | 0 | 0 |
164
- | [lib]/c.a/lib_a-errno.o | 12 | 0 | 0 |
165
- | [lib]/c.a/lib_a-fclose.o | 196 | 0 | 0 |
166
- | [lib]/c.a/lib_a-fflush.o | 404 | 0 | 0 |
167
- | [lib]/c.a/lib_a-findfp.o | 204 | 0 | 0 |
168
- | [lib]/c.a/lib_a-fputwc.o | 264 | 0 | 0 |
169
- | [lib]/c.a/lib_a-freer.o | 620 | 0 | 0 |
170
- | [lib]/c.a/lib_a-fstatr.o | 40 | 0 | 0 |
171
- | [lib]/c.a/lib_a-fvwrite.o | 752 | 0 | 0 |
172
- | [lib]/c.a/lib_a-fwalk.o | 84 | 0 | 0 |
173
- | [lib]/c.a/lib_a-impure.o | 0 | 1068 | 0 |
174
- | [lib]/c.a/lib_a-init.o | 80 | 0 | 0 |
175
- | [lib]/c.a/lib_a-isattyr.o | 36 | 0 | 0 |
176
- | [lib]/c.a/lib_a-locale.o | 42 | 364 | 0 |
177
- | [lib]/c.a/lib_a-localeconv.o | 28 | 0 | 0 |
178
- | [lib]/c.a/lib_a-lock.o | 16 | 0 | 33 |
179
- | [lib]/c.a/lib_a-lseekr.o | 44 | 0 | 0 |
180
- | [lib]/c.a/lib_a-makebuf.o | 240 | 0 | 0 |
181
- | [lib]/c.a/lib_a-mallocr.o | 1376 | 1040 | 52 |
182
- | [lib]/c.a/lib_a-mbtowc_r.o | 44 | 0 | 0 |
183
- | [lib]/c.a/lib_a-memchr.o | 160 | 0 | 0 |
184
- | [lib]/c.a/lib_a-memcpy.o | 308 | 0 | 0 |
185
- | [lib]/c.a/lib_a-memmove.o | 200 | 0 | 0 |
186
- | [lib]/c.a/lib_a-memset.o | 156 | 0 | 0 |
187
- | [lib]/c.a/lib_a-mprec.o | 1776 | 0 | 0 |
188
- | [lib]/c.a/lib_a-printf.o | 40 | 0 | 0 |
189
- | [lib]/c.a/lib_a-readr.o | 44 | 0 | 0 |
190
- | [lib]/c.a/lib_a-reallocr.o | 844 | 0 | 0 |
191
- | [lib]/c.a/lib_a-reent.o | 0 | 0 | 4 |
192
- | [lib]/c.a/lib_a-sbrkr.o | 36 | 0 | 0 |
193
- | [lib]/c.a/lib_a-snprintf.o | 152 | 0 | 0 |
194
- | [lib]/c.a/lib_a-stdio.o | 136 | 0 | 0 |
195
- | [lib]/c.a/lib_a-strlen.o | 220 | 0 | 0 |
196
- | [lib]/c.a/lib_a-svfiprintf.o | 252 | 0 | 0 |
197
- | [lib]/c.a/lib_a-svfprintf.o | 5370 | 0 | 0 |
198
- | [lib]/c.a/lib_a-vfiprintf.o | 148 | 0 | 0 |
199
- | [lib]/c.a/lib_a-vfprintf.o | 5754 | 0 | 0 |
200
- | [lib]/c.a/lib_a-wbuf.o | 176 | 0 | 0 |
201
- | [lib]/c.a/lib_a-wcrtomb.o | 84 | 0 | 0 |
202
- | [lib]/c.a/lib_a-wctomb_r.o | 28 | 0 | 0 |
203
- | [lib]/c.a/lib_a-writer.o | 44 | 0 | 0 |
204
- | [lib]/c.a/lib_a-wsetup.o | 200 | 0 | 0 |
205
- | [lib]/gcc.a/_aeabi_uldivmod.o | 48 | 0 | 0 |
206
- | [lib]/gcc.a/_arm_addsubdf3.o | 880 | 0 | 0 |
207
- | [lib]/gcc.a/_arm_cmpdf2.o | 272 | 0 | 0 |
208
- | [lib]/gcc.a/_arm_fixdfsi.o | 80 | 0 | 0 |
209
- | [lib]/gcc.a/_arm_muldivdf3.o | 1060 | 0 | 0 |
210
- | [lib]/gcc.a/_arm_unorddf2.o | 44 | 0 | 0 |
211
- | [lib]/gcc.a/_dvmd_tls.o | 4 | 0 | 0 |
212
- | [lib]/gcc.a/_udivmoddi4.o | 732 | 0 | 0 |
213
- | [lib]/misc/ | 248 | 4 | 28 |
214
- | main.o | 215 | 0 | 0 |
215
- | mbed-os/hal/mbed_gpio.o | 96 | 0 | 0 |
216
- | mbed-os/hal/mbed_pinmap_common.o | 212 | 0 | 0 |
217
- | mbed-os/hal/mbed_ticker_api.o | 214 | 0 | 0 |
218
- | mbed-os/hal/mbed_us_ticker_api.o | 44 | 0 | 24 |
219
- | mbed-os/platform/mbed_alloc_wrappers.o | 16 | 0 | 0 |
220
- | mbed-os/platform/mbed_board.o | 90 | 0 | 0 |
221
- | mbed-os/platform/mbed_critical.o | 56 | 0 | 5 |
222
- | mbed-os/platform/mbed_error.o | 32 | 0 | 1 |
223
- | mbed-os/platform/mbed_retarget.o | 646 | 4 | 266 |
224
- | mbed-os/platform/mbed_sdk_boot.o | 74 | 0 | 0 |
225
- | mbed-os/platform/mbed_wait_api_no_rtos.o | 32 | 0 | 0 |
226
- | mbed-os/targets/TARGET_Freescale | 4834 | 12 | 384 |
227
- | Subtotals | 34938 | 2496 | 2868 |
228
- +------------------------------------------+-------+-------+------+
229
- Total Static RAM memory (data + bss): 5364 bytes
230
- Total Flash memory (text + data): 37434 bytes
231
- ```
91
+ | | Floating point | 64 bit integers | Flash | RAM |
92
+ | - | - | - | - | - |
93
+ | mbed-printf | | | 7772 | 2752 |
94
+ | mbed-printf | | X | 8708 | 2752 |
95
+ | mbed-printf | X | | 10368 | 2752 |
96
+ | mbed-printf | X | X | 11360 | 2752 |
97
+ | std printf | X | X | 37354 | 5364 |
0 commit comments