Commit 7bd9868
* [STM32F1 F4] Fix #1705 MBED_37
The transmit data register needs to be flushed at the initialisation of
the uart.
In case previous transmission was interrupted by a uart init, uart may
contain a char that will be transmitted at the next start.
This is the case in MBED_37 test (serial_auto_nc_rx).
The MCU is writting {{start}}\n
At the moment of the \n the main program is handling 'new serial'. The
next time the main program is handling a printf, the previous \n is
still present in the uart->DR register and is transmitted.
This cannot happen anymore with this commit
* [STM32_F1] Fix #1705 MBED_37 by resetting the uart
1 parent 13f0c1f commit 7bd9868
File tree
2 files changed
+25
-1
lines changed- libraries/mbed/targets/hal/TARGET_STM
- TARGET_STM32F1
- TARGET_STM32F4
2 files changed
+25
-1
lines changedLines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| 86 | + | |
| 87 | + | |
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| 92 | + | |
| 93 | + | |
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
| 98 | + | |
| 99 | + | |
92 | 100 | | |
93 | 101 | | |
94 | 102 | | |
| |||
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
| |||
186 | 185 | | |
187 | 186 | | |
188 | 187 | | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
205 | 207 | | |
206 | 208 | | |
207 | 209 | | |
208 | 210 | | |
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
| 214 | + | |
| 215 | + | |
212 | 216 | | |
213 | 217 | | |
214 | 218 | | |
| |||
217 | 221 | | |
218 | 222 | | |
219 | 223 | | |
| 224 | + | |
| 225 | + | |
220 | 226 | | |
221 | 227 | | |
222 | 228 | | |
| |||
226 | 232 | | |
227 | 233 | | |
228 | 234 | | |
| 235 | + | |
| 236 | + | |
229 | 237 | | |
230 | 238 | | |
231 | 239 | | |
| |||
235 | 243 | | |
236 | 244 | | |
237 | 245 | | |
| 246 | + | |
| 247 | + | |
238 | 248 | | |
239 | 249 | | |
240 | 250 | | |
| |||
244 | 254 | | |
245 | 255 | | |
246 | 256 | | |
| 257 | + | |
| 258 | + | |
247 | 259 | | |
248 | 260 | | |
249 | 261 | | |
| |||
253 | 265 | | |
254 | 266 | | |
255 | 267 | | |
| 268 | + | |
| 269 | + | |
256 | 270 | | |
257 | 271 | | |
258 | 272 | | |
| |||
262 | 276 | | |
263 | 277 | | |
264 | 278 | | |
| 279 | + | |
| 280 | + | |
265 | 281 | | |
266 | 282 | | |
267 | 283 | | |
| |||
0 commit comments