- The following guide shows how to use mbed-Serial to communicate via UART.
- UART Pins: Pin P1_5(TX) and P1_4(RX).
- UART operating mode: 9600 8N1.
- On startup a welcome text is printed and afterwards all received characters are send back with an index number.
- Mbed CLI - Download and install mbed CLI.
Import mbed startup project from GitHub.
mbed import https://github.com/mbed-Infineon-XMC/Serial-Example.git
- GNU ARM toolchain - Download and install the last stable version of the ARM GCC toolchain.
- Open the file "mbed_settings.py" and add the ARM GCC install path.
Example:
#GCC_ARM_PATH = "home/bin/arm_gcc_toolchain/gcc-arm-none-eabi-5_4-2016q2/arm-none-eabi/bin"
Navigate into the project folder and execute the following command:
cd Serial-Example.git/
mbed compile -m XMC_4500_RELAX_KIT -t GCC_ARM
mbed creates a BUID directory where you can find the executables (bin, elf, hex ...).
- Segger JLink - Install the JLink software for your platform.
- Navigate to the BUILD directory and execute the following JLinkExe commands.
$ JLinkExe
J-LINK> device xmc4500-1024
J-LINK> h
J-Link> loadfile Serial-Example.git.hex
J-Link> r
J-Link> g
- Choose SWD, 4000kHz as interface settings!!