/
Loading Application Files via UART

Loading Application Files via UART

This note explains how to load files such as binary applications from Linux running on the target via UART. This is a useful procedure for those targets that do not provide an Ethernet link and have the serial console as the only communication channel.

  1. On the host, activate the Cortex-M cross-development environment:

    $ . ./ACTIVATE.sh $
  2. Create a simple "Hello, world" C application:

    [host] $ cd /tmp [host] $ vi test.c #include <stdio.h> int main(int argc, char *argv[]) { printf("Hello, i.MX RTxxxx\n"); return 0; }
  3. Build the application for the Cortex-M target:

    [host] $ ${CROSS_COMPILE_APPS}gcc -o test test.c
  4. If you have no uuencode installed in your system, then install it:

  5. Encode the application binary into an ASCII-only presentation so that the file can be transmitted over a serial line:

    The uudecode application on the target (in order to convert the ASCII-only file back into the application binary) is provided with busybox by default in the rootfs project.

  6. On the host, make sure that the serial port you use for the target console is configured for 115200 bps:

  7. If you have no picocom installed in your system, the install it:

  8. Start the target console:

    From the target, run the following to read a file from the serial console:

  9. On the host, exit the target console (Ctrl-A and then Ctrl-X in picocom).

  10. On the host, send the encoded ASCII file to the serial port used for the target console:

  11. When the transfer command finishes, enter the target console again:

  12. Type Ctrl-C to interrupt the cat command:

  13. Run uudecode to convert the ASCII file back to the binary file:

  14. Change mode to allow running the application binary:

  15. Finally, run the application:

Related content

NXP i.MXRT10XX: Managing U-Boot Environment from Linux
NXP i.MXRT10XX: Managing U-Boot Environment from Linux
Read with this
Loading Application Files via UART (uClinux)
Loading Application Files via UART (uClinux)
More like this
Using USB Flash with the USB High Speed Interfaces on the i.MX RT10XX
Using USB Flash with the USB High Speed Interfaces on the i.MX RT10XX
Read with this
Remote Debugging with GDB (uClinux)
Remote Debugging with GDB (uClinux)
More like this
NXP i.MXRT10XX: Running TCP/IP Stack in Linux
NXP i.MXRT10XX: Running TCP/IP Stack in Linux
Read with this
Building Linux Userspace Applications
Building Linux Userspace Applications
More like this