Show Contents

# MCA management application

You can use the mca_fw_updater command line application to update the firmware that runs on the Micro Controller Assist (MCA) of the ConnectCore 6UL and derived products.

The flash memory of the MCA is divided in two regions: program flash and NVRAM. Before writing the new firmware, this application completely erases the contents of the program flash through the MCA bootloader. By default, the NVRAM is also erased.

CAUTION!
The MCA firmware is a critical part of the system. If you are not sure of the origin of your new firmware image or the benefits of updating it, do not proceed.

Note The bootloader must restart the MCA to re-run the application stored in flash, and this involves restarting the complete system.

## Compatibility with MCA firmware

- ConnectCore 6UL SBC Express: all MCA firmware versions are supported
- ConnectCore 6UL SBC Pro: MCA firmware v0.12 or higher. Lower versions are not supported and should be updated using a debugger

## Command line options

Command line option | Action
--- | ---
mca_fw_updater -v, --version | Show the current version of the tool
mca_fw_updater -h, --help | Show the available options
mca_fw_updater -f FILE, --file | Erase the flash completely and update firmware with file FILE
mca_fw_updater -f FILE -k, --keep-nvram | Update firmware but keep current NVRAM contents

Option -f erases both program and NVRAM flash sectors before installing the new firmware. If this option is used together with -k, the NVRAM will not be erased. Option -k alone is not valid; it performs no action.

## Update MCA firmware

The firmware must be contained in a binary file, with read permissions for the user. When the program is invoked with option -f, it starts the update process:

    MCA update process

    root@ccimx6ulsbc:~# mca_fw_updater -f mca_cc6ul_v0.18.bin
    The update process may take 20 seconds or more - DO NOT POWER OFF OR RESET
    /

The program sends a message to the MCA firmware with the byte sequence for calling the bootloader and then checks that the bootloader is running. Then it performs the selected operations (update firmware, erase NVRAM). The process may take longer than 20 seconds, and the console displays a spinning bar. During this time, the system must be kept powered to successfully complete the update. Once the new firmware is written, resetting the MCA takes five seconds. Note that during the MCA reset process, the program appears to perform no action. The i.MX6UL CPU then reboots together with the MCA.

CAUTION! Do not abort the firmware update process
If the process is interrupted during the write phase, the MCA could be left in an inconsistent state. If the process fails you can retry manually, but success is not guaranteed. In this case, you can only recover the MCA by flashing the firmware with a debugger probe.

## Update I/O Expander firmware

The ioexp_fw_updater accepts the same command line options as the mca_fw_updater. After updating the firmware of the I/O Expander, the ConnectCore 6UL does not restart automatically. Digi recommends a manual reboot to re-synchronize the device settings with its Linux driver.

## Detect invalid firmware images

The tool has a limited capability of detecting if a firmware can cause irreversible damage to the MCA flash. Consequently, it will not install firmware that:

- Does not fit in the program flash memory, or
- Can overwrite critical flash settings and prevent further updates (for example: lock flash against erasing or change clock settings).

    Detection of invalid images

    root@ccimx6ulsbc:~# mca_fw_updater -f bad_binary
    INVALID FIRMWARE - it can damage the MCA.
    Update aborted
    root@ccimx6ulsbc:~# du -h a_very_big_file
    4.9M    a_very_big_file
    root@ccimx6ulsbc:~# ./mca_fw_updater -f a_very_big_file
    The firmware image does not fit in flash.
    Update aborted.

If an invalid image that still passes these filters is written to flash, the functionality of the system will be lost. If this happens, a valid firmware image for the MCA must be flashed by using a debugger. The application cannot re-program an MCA that contains invalid firmware; bootloader mode is required to program new firmware, and invalid MCA firmware cannot set the bootloader to bootloader mode.

To avoid problems that may arise from flashing an invalid firmware image:

- Only write firmware provided by Digi International Inc, designed for the MCA and fully supported by other software components.
- Check the file name before pressing Enter.

## Troubleshooting

- Following Linux convention, the application returns 0 for success and a negative error code otherwise. Upon error, you can check the return code with echo $?.

- If the update process fails unexpectedly but the application does not complain about the binary file size or format, retry the process. If this still does not work, the MCA firmware can still be updated with a debugger probe.

If you are able to enter U-Boot, you can use the following commands to probe the devices connected to the I2C1 bus (bus index 0):

    => i2c dev 0
    Setting bus to 0
    => i2c probe
    Valid chip addresses: 08 7E

The MCA has the slave address 0x7E. This means the MCA is present and running the firmware. If the address 0x7D is shown instead, the MCA is running the bootloader. If none of them is present, the MCA is faulty. If the MCA is running either the firmware or the bootloader, you can boot to Linux and try to update again.

© 2018 Digi International Inc. All rights reserved.
MCA management application updated on 22 January 2018 02:43:37 PM