If you wish to use printf-style retargeting via the UART, follow these steps:
- In the Manage Run-Time Environment window select:
- Device:SDK Utilities:debug_console
- Compiler:I/O:STDOUT User
- Compiler:I/O:STDIN User
- Compiler:I/O:STDERR User
Required components for printf debugging
- Copy the file
retarget_user.c
from <PACK_root>\Templates
to \<project_dir>
and add it to the project
- In the Project window, browse to Device:fsl_debug_console.c, right-click and select Options for Component Class 'Device'. On the C/C++ tab, define
fputc=fputc_sdk fgetc=fgetc_sdk
.
- Note
- You need to install the Mbed Windows serial driver to be able to communicate via printf/UART. Download and install the driver from here: Windows serial driver.
Continue by building and debugging the project.