Freescale Port Devices Driver



Table of Contents

  1. Freescale Port Devices Driver
  2. Freescale Port Devices Drivers
  3. Freescale Port Devices Driver Update
  4. Freescale Port Devices Driver Downloads
  5. Freescale Port Devices Driver Download

This content relates to a deprecated version of Mbed

This will allow the co-existence of Freescale's OSBDM-JM60 hardware while using a new driver for USBDM. Formerly both these BDMs used the same VID/PID and changes to the driver would not be possible without rendering the OSBDM-JM60 inoperable. Note: On Windows, libusb1.0 is a thin wrapper around the Microsoft winUSB low-level USB drivers. Scroll down to the LPT/ COM port then double click Prolific USB to Serial Comm Port; Click Driver in the Windows Properties section; The driver must be numbered as '2.0.2.8' and dates accordingly If the driver was not installed, remove the Serial adapter then run 'PL2303DriverInstaller.exe' again.

Driver

Mbed 2 is now deprecated. For the latest version please see the Mbed OS documentation.

For the latest information about Serial, please see The Windows Serial Driver.

The mbed serial port works by default on Mac and Linux, but Windows needs a driver. These instructions explain how to setup the mbed Microcontroller to use the USB serial port on Windows.

1. Download the mbed Windows serial port driver¶

Download the installer to your PC, e.g. your desktop.

2. Run the installer¶

With your mbed plugged in, and no explorer drive windows open, run the installer:

It will take some time (especially on Vista), and pop up a few 'unsigned driver' warnings, but after a while you should have a Serial port.

Where Next¶

Devices
  • SerialPC - Communication with a PC
  • Terminals - Guide to using terminal applications

Troubleshooting

If you have multiple mbed microcontrollers, but the serial port only appears for one of them:

Freescale port devices driver update
  • Make sure you run the installer for every mbed; windows loads the driver based on the serial number, so it needs to be run for each mbed you use

If the installer fails because 'No mbed Microcontrollers were found':

  • Check your mbed Microcontroller is plugged in

If the installer reports the message 'mbedWinSerial_nnnnn.exe is not a valid Win32 application':

  • It is likely you are using Internet Explorer to download the installer file, which sometimes seems to only download part of the installer application for an unknown reason
  • To solve this, download the installer with a different browser (Firefox, Chrome), and try again; this should solve the issue.

If the Installer appears to hang:

Freescale Port Devices Driver

  • Check if windows has popped-up a 'unsigned driver/permission' window; these often get hidden behind other windows with nothing to indicate so in the taskbar! Windows may be waiting for you to click 'OK'!

If you have any problems, or think this tutorial could be improved, please tell us in the Forum!

  1. Linux
    1. NVIDIA Tegra based Modules

The USB (Universal Serial Bus) standard specifies two roles USB host and USB peripheral (also known as USB function, USB peripheral device or sometimes just USB device). The bus can only have one USB host connected all other devices need to be in USB peripheral mode. Most PCs support USB host mode exclusively. However, embedded systems often have multiple USB controller supporting host or peripheral roles or supporting both roles on a single controller (dual-role controller). The dual-role controllers often also support the OTG (On-The-Go) specification which defines a host negotiation protocol allowing two devices to negotiate for the role of the host.

On Colibri modules the client port (USBC) is usually connected to a dual-role capable controller. By default the port is in peripheral mode. If a USB Micro-B OTG cable is used (which connects the ID pin to ground) the circuit on the carrier board automatically enables driving +5V onto VBUS in order to provide power to USB devices as required by a host. On the other hand VBUS is also connected to the Colibri USBC_DET signal (usually via a diode) allowing driver software to monitor and subsequently change the role. On Apalis modules a full OTG port (USBO1) is provided which makes use of the OTG ID pin using the USBO1_ID signal to determine its role and additionally the VBUS pin using the USBO1_VBUS signal to determine the actual connection status thereof allowing suspending the USB complex if not connected.

On Linux USB peripheral mode is supported through the Gadget API. This API abstracts the USB peripheral controller hardware as well as offers hardware neutral routines which allow to implement USB functions (e.g. USB CDC ACM or RNDIS). Traditionally the USB function had to be chosen at Kernel compile time (e.g. g_ether). The Linux USB gadget drivers received increasingly more attention and have evolved over time, especially since Android appeared. The Android variant of the Linux kernel added functionality allowing easy switching between USB functions using sysfs. Later in Linux 3.10 a similar functionality also landed in the upstream kernel which now allows configuring USB gadgets through configfs (the USB Gadget ConfigFS). Depending on the Linux kernel version provided by our BSP a different level of USB peripheral functionality and API is available.

USB peripheral devices need a vendor and product identification. Toradex has its own vendor ID (0x1b67) and assigns a product ID for each Colibri and Apalis product which you as a customer can use too. The USB Product ID is the sum of an offset of 0x4000 and the hexadecimal representation of the product identifier, e.g. 0x4000 + 12 = 0x400c (the product identifier is the first 4 digits of the Toradex Product Number, e.g. 0012 for Colibri VF61 256MB IT V1.1B).

Some platforms need device dependent and certified drivers (e.g. CDC ACM for Microsoft Windows) even for standard USB classes. While it is possible to use the driver delivered with Windows a custom inf file still needs to be provided. For better out-of-the-box experience the standard images typically use the default Linux USB product/vendor ID (e.g. 1d6b:0104 Linux Foundation Multifunction Composite Gadget).

U-Boot's CONFIG_USB_DEVICE config symbol allows for U-Boot to provide USB peripheral mode support. With recent versions we successfully tested ums (User Mode Storage) and dfu (Device Firmware Upgrade). Both USB functions conform to standardized USB classes.

Freescale Port Devices Driver

Since BSP V2.4 all modules use the same U-Boot version 2015.04. This common U-Boot version configures the USB peripheral device identification using the Toradex vendor ID and product ID.

The following exports the eMMC on SoMs with an eMMC or the SD card on the SoMs with raw NAND. Note that with CTRL+C you can abort the operation and regain control over U-Boot.

On the host connected to the SoM you will now see the following USB device. Assuming you have our regular BSP installed on an eMMC based SoM the following block devices will also appear and possibly mounted:

Note that ums currently can only export the user area of an eMMC but not its boot areas. This prevents you from updating the bootloader over this mechanism.

NXP/Freescale Vybrid/i.MX7/i.MX6ULL/i.MX6/i.MX8/i.MX8X based Modules

The NXP/Freescale Vybrid BSP (since V2.4 Beta 1) and the i.MX BSP (since V2.5 Beta 2) use the USB Gadget ConfigFS to configure the USB peripheral port.

The USB Gadget ConfigFS is a file system which allows to configure USB functions by using file system commands such as mkdir and creating/writing files. Typically the file system is mounted under /sys/kernel/config/. The official Linux kernel documentation has more information in Documentation/usb/gadget_configfs.txt on how to use the file system to enable USB functions. Matt Porter held a talk at ELC 2014 titled Kernel USB Gadget Configfs Interface cover the Gadget ConfigFS a bit more in depth.

Freescale Port Devices Driver

The library libusbgx (or its predecessor libusbg) allows to use the USB Gadget ConfigFS through a C API. This can be useful if embedded software needs to dynamically control USB functions provided by a device. The library also provides two utilities called gadget-import and gadget-export. This utilities allow to export a hand-crafted USB Gadget to a schema file and reimport it.
The BSP provides a default schema specifying an RNDIS configurations (USB functions) under /etc/usbg/g1.schema. A systemd service called usbg.service uses gadget-import to import this schema on startup (see this commit libusbg: add updated version of USB gadget library which initially added the functionality, then providing an RNDIS and CDC ACM composite device).

To alter the schema, one can either create a completely new gadget schema, alter the existing gadget and reexport it, or alter the schema directly (for simple changes).

This example shows how to create a completely new configuration., to create a Gadget configuration for the a single USB CDC (Communications Device Class) Ethernet (ECM).

Freescale Port Devices Drivers

First a new gadget needs to be created

Attention: If /sys/kernel/config/usb_gadget/ does not exist you need to load the libcomposite module: modprobe libcomposite

Then, one or multiple configurations can be assigned. A Gadget supporting multiple configurations (USB functions) is also known as a composite gadget. Note that depending on the operating system used on the USB host device, it might be problematic to use such configurations (see also Documentation/usb/gadget_multi.txt)

Functions can be created by creating a directory like functions/.ecmEthernet Control Model (CDC ECM)Ethernet Control ModeleemEthernet Emulation Model (EEM)Newer USB Ethernet standard that is somewhat simpler than CDC ECMncmNetwork Control Model (CDC NCM)Advanced protocol for EthernetffsFunction filesystem (FunctionFS)Allows to implement USB functions from user-space (e.g. for MTP)Documentation/usb/functionfs.txtmass_storageMass storageExports a regular file or block device as USB Mass Storage disk driveDocumentation/usb/mass-storage.txthidHID functionGeneric emulation of USB Human Interface Devices (HID)Documentation/usb/gadget_hid.txt

Another example how to create a mass storage device:

The Gadget testing documentation located at Documentation/usb/gadget-testing.txt of the Linux kernel also contains some valuable information how to use the USB Gadget functions.

To enable this configuration write the name of the USB controller to the UDC file (see /sys/class/udc/ for available USB Device Controllers). You need to disable the old configuration first before enabling the new one:

Freescale Port Devices Driver Update

Don't forget to store the configuration using gadget-export:

To make sure the g2 Gadget configuration gets loaded automatically, alter the systemd service located at /lib/systemd/system/usbg.service or name the schema g1.schema.

NVIDIA Tegra based Modules

Starting with our V2.x BSPs based on NVIDIA's L4T kernel we are using the Android multi gadget driver which allows various functionality to be exposed via a single USB device cable connection.

Mass Storage

USB Mass Storage allows exporting any block device from the target module to a PC and use it just in the same way as any regular USB memory stick.

Note: Whatever block device you export by using this method, it can not be in use on the target module side (e.g. by a file system driver). Otherwise the simultaneously accessing file system drivers would corrupt the file system on the block device!

The example below shows how a regular SD card inside one of the Apalis Evaluation board's slots can be shared:

Target

Freescale Port Devices Driver Downloads

Host

RNDIS

The Vibrante kernel in our V1.x BSPs contained the g_ether driver which acts as an Ethernet over USB controller (CDC Ethernet) by default. The later L4T kernel in our V2.x BSPs comes with the Android RNDIS Ethernet gadget driver. Most nowadays operating system (including Linux, Windows 7) include respective host drivers (plug and play). Our latest BSPs now run a DHCP server on the module to automatically assign your PC an IP address upon USB device connection.

USB Device Connection

Target (USB Device)

Configure IP address on device usb0 and test performance using iperf.

Host (USB Device)

Freescale Port Devices Driver Download

USB Device Disconnect