Difference between revisions of "How to Upgrade X410-X440 MCU Firmware"
(→Abstract: tweak USRP specifics to be consistent) |
(Small tweaks for different rev# USRPs per Virendra's recommendation) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 18: | Line 18: | ||
This document details how to download, extract, and install the X410/X440 USRP microcontroller ("MCU") firmware updates. This specific guide shows how to do the update to MCU firmware version <code>0.0.13823-82c52e33a</code> for any revision X410/X440 USRP (currently 5, 6, or 7). | This document details how to download, extract, and install the X410/X440 USRP microcontroller ("MCU") firmware updates. This specific guide shows how to do the update to MCU firmware version <code>0.0.13823-82c52e33a</code> for any revision X410/X440 USRP (currently 5, 6, or 7). | ||
+ | |||
+ | The Procedure for the Read Only (RO) MCU firmware can be done from a Linux host computer/server or on the USRP itself assuming the X410/X440 USRP boots and can stay active and running for a minimum of 20 minutes. The Read/Write (RW) MCU firmware ''must'' be loaded from the Linux host computer/server; hence we recommend starting with the first Procedure on Step (1) and if that works then both the RO and RW MCU firmware will be successfully update. If you start with the second Procedure at Step (15) then only the RO portion will be updated, so you would then need to run the installer from the Linux host computer/server to get the RW portion updated. | ||
+ | |||
+ | Both are covered here; select the one that matches your current X410/X440 USRP situation & if possible, start with the first Procedure to try to get both the RO and RW firmware updated in one set of commands. | ||
+ | |||
+ | == Procedure from Linux Host == | ||
NOTE: This guide assumes the following: | NOTE: This guide assumes the following: | ||
Line 24: | Line 30: | ||
<li>A Linux host computer (we use Ubuntu / aptitude-based; others will work);</li> | <li>A Linux host computer (we use Ubuntu / aptitude-based; others will work);</li> | ||
<li>The X410/X440 USRP is accessible to the Linux host computer via a USB cable connected to the USRP USB JTAG port;</li> | <li>The X410/X440 USRP is accessible to the Linux host computer via a USB cable connected to the USRP USB JTAG port;</li> | ||
− | <li>The X410/X440 USRP has power but is ''not'' powered on / is shut down;</li> | + | <li>The X410/X440 USRP has power but is ''not'' powered on / is currently shut down;</li> |
− | <li>The X410/X440 USRP is the only USRP device connected in any form to the Linux host computer;</li> | + | <li>The X410/X440 USRP is the only USRP device connected in any form to the Linux host computer (just in case);</li> |
− | <li>This procedure ''should'' work regardless whether the USRP can boot or not.</li> | + | <li>This procedure ''should'' work regardless of whether the USRP can boot or not.</li> |
</ol> | </ol> | ||
− | == Procedure == | + | ==== Procedure ==== |
<ol> | <ol> | ||
Line 66: | Line 72: | ||
</li> | </li> | ||
− | <li>Download and extract the archive to the Linux host computer to the <code>~/Downloads</code> directory | + | <li>Download and extract the archive to the Linux host computer to the <code>~/Downloads</code> directory:<br> |
<code> | <code> | ||
− | |||
cd ~/Downloads<br> | cd ~/Downloads<br> | ||
+ | wget https://files.ettus.com/binaries/misc/upgrade_mcu_titanium_v0.0.13823-82c52e33a.tar.gz<br> | ||
tar zxf upgrade_mcu_titanium_v0.0.13823-82c52e33a.tar.gz<br> | tar zxf upgrade_mcu_titanium_v0.0.13823-82c52e33a.tar.gz<br> | ||
cd upgrade_mcu_titanium_v0.0.13823-82c52e33a<br> | cd upgrade_mcu_titanium_v0.0.13823-82c52e33a<br> | ||
Line 75: | Line 81: | ||
</li> | </li> | ||
− | <li>Run the MCU updater script:<br> | + | <li>Run the "from host" MCU updater script:<br> |
<code>sudo ./flash-firmware-from-host.sh</code><br> | <code>sudo ./flash-firmware-from-host.sh</code><br> | ||
NOTE: This script will print the following:<br> | NOTE: This script will print the following:<br> | ||
Line 139: | Line 145: | ||
</li> | </li> | ||
− | <li>After the USRP shuts down, power it back up. Repeat command (3) then at the <code>></code> prompt issue the command <code>version | + | <li>After the USRP shuts down, power it back up. Repeat command (3) then at the <code>></code> prompt issue the command <code>version</code>; the output should look like the following for when the <code>compat_rev</code> is <code>5</code>; the # <code>rev5</code> will match that from Step (5):<br> |
<code> | <code> | ||
Chip: stm stm32f412<br> | Chip: stm stm32f412<br> | ||
Line 157: | Line 163: | ||
NOTE:<br> | NOTE:<br> | ||
<ol style="list-style-type:lower-alpha"> | <ol style="list-style-type:lower-alpha"> | ||
− | <li>If you followed Steps (1) through (12) and if this command successfully finds the USRP then you are done! Congratulations on successfully upgrading the MCU firmware on your X410 | + | <li>If you followed Steps (1) through (12) and if this command successfully finds the USRP then you are done! Congratulations on successfully upgrading the MCU firmware on your X410/X440 USRP! |
</li> | </li> | ||
− | <li>If | + | <li>If the USRP does not boot or if this command does not succeed in finding the USRP, then try this whole procedure section again starting at Step (3). If you tried this already and the X410/X440 USRP is still having issues, contact Ettus support for assistance. |
</li> | </li> | ||
</ol> | </ol> | ||
Line 165: | Line 171: | ||
</ol> | </ol> | ||
+ | == Procedure on USRP device == | ||
+ | |||
+ | NOTE: This guide assumes the following: | ||
+ | |||
+ | <ol style="list-style-type:lower-alpha"> | ||
+ | <li>The X410/X440 USRP has internet access, or is networked to the Linux host computer via the RJ-45 1 GbE or 10/100 GbE QSFP28 ports;</li> | ||
+ | <li>The X410/X440 USRR is powered on; | ||
+ | </ol> | ||
+ | |||
+ | ==== Procedure ==== | ||
+ | |||
+ | <ol start="15"> | ||
+ | |||
+ | <li>Power on the USRP if it did not automatically do so after Step (13), or if jumping here because the USRP successfully boots. | ||
+ | </li> | ||
+ | |||
+ | <li>Make sure that the USRP is connected to the host computer via a QSFP28 10/100 GbE link and/or the RJ-45 1 GbE link and that the networking is configured for your desired use-case, then run the following and see if the device comes up:<br> | ||
+ | <code>uhd_find_devices</code><br> | ||
+ | NOTE: Assuming this command successfully finds the USRP note the <code>mgmt_addr</code>. Typical values are <code>192.168.10.2</code> through <code>192.168.40.2</code>, but this entirely depends on how the networking is configured. Let's call this value (whatever it actually is) <code>MGMT_ADDR</code>. | ||
+ | </li> | ||
+ | |||
+ | <li>Login to this USRP via the UHD-found <code>MGMT_ADDR</code>:<br> | ||
+ | <code>ssh root@MGMT_ADDR</code> | ||
+ | </li> | ||
+ | |||
+ | <li>Download the archive, either directly or from the networked host computer attached to the USRP:<br> | ||
+ | <code>wget https://files.ettus.com/binaries/misc/upgrade_mcu_titanium_v0.0.13823-82c52e33a.tar.gz</code> | ||
+ | </li> | ||
+ | |||
+ | <li>Extract the archive and move into the directory:<br> | ||
+ | <code>tar zxf upgrade_mcu_titanium_v0.0.13823-82c52e33a.tar.gz<br> | ||
+ | cd upgrade_mcu_titanium_v0.0.13823-82c52e33a</code> | ||
+ | </li> | ||
+ | |||
+ | <li>Run the "from device" MCU updater script:<br> | ||
+ | <code>./flash-firmware-from-device.sh</code><br> | ||
+ | NOTE: This script will print the following:<br> | ||
+ | <code>This script updates the microcontroller firmware (RO part). The change is persistent across power cycles. Incorrect updates may brick the device and may need you to use the host based update process. This script may take upto a minute to run successfully.<br> | ||
+ | Updating the microcontroller firmware (RO part) is only required if the Ettus Research support told you to do so.<br> | ||
+ | Press "y" to continue</code> | ||
+ | </li> | ||
+ | |||
+ | <li>Press the <code>y</code> key; the script will now print out something like the following:<br> | ||
+ | <code>This script will flash ec-titanium-rev5.RO.flat to the device<br> | ||
+ | old RO version: titanium_v0.0.13797-11efcf3e6<br> | ||
+ | new RO: titanium-rev5_v0.0.13823-82c52e<br> | ||
+ | Press "y" to continue</code> | ||
+ | </li> | ||
+ | |||
+ | <li>Press the <code>y</code> key (again); the script will now print out the following (note that the USRP here is <code>rev5</code>; <code>rev6</code>, <code>rev7</code> etc will show that revision number in the text instead of <code>5</code>; this revision number is automatically detected by the <code>device</code> version of the install script):<br> | ||
+ | <code># Disable periodic led control commands to reduce i2c activity to the controller.<br> | ||
+ | ledctrl led0 none<br> | ||
+ | /usr/sbin/ectool --interface=dev reboot_ec RW<br> | ||
+ | /usr/sbin/ectool --interface=dev flashread 0x0 262144 ec-titanium-rev5.RO.flat.old<br> | ||
+ | Reading 262144 bytes at offset 0...<br> | ||
+ | done.<br> | ||
+ | <nowiki>#</nowiki> This call may throw some i2c errors due to long erase times<br> | ||
+ | /usr/sbin/ectool --interface=dev flasheraseasync 0x0 262144<br> | ||
+ | Erasing 262144 bytes at offset 0...<br> | ||
+ | ioctl -1, errno 16 (Device or resource busy), EC result 255 (<unknown>)<br> | ||
+ | done.<br> | ||
+ | <nowiki>#</nowiki> Sleep and try erase again, this should succeed.<br> | ||
+ | sleep 3<br> | ||
+ | /usr/sbin/ectool --interface=dev flasheraseasync 0x0 262144<br> | ||
+ | Erasing 262144 bytes at offset 0...<br> | ||
+ | done.<br> | ||
+ | /usr/sbin/ectool --interface=dev flashwrite 0x0 ec-titanium-rev5.RO.flat<br> | ||
+ | Reading 84032 bytes from ec-titanium-rev5.RO.flat...<br> | ||
+ | Writing to offset 0...<br> | ||
+ | Write size 112...<br> | ||
+ | done.<br> | ||
+ | copying new firmware files<br> | ||
+ | 'ec-titanium-rev5.bin' -> '/lib/firmware/ni/ec-titanium-rev5.bin'<br> | ||
+ | 'ec-titanium-rev5.RW.bin' -> '/lib/firmware/ni/ec-titanium-rev5.RW.bin'</code> | ||
+ | </li> | ||
+ | |||
+ | <li>Reboot the USRP:<br> | ||
+ | <code>reboot</code> | ||
+ | </li> | ||
+ | |||
+ | <li>All done! If you want to verify that the firmware is updated, then repeat step (12) and the output for <code>RO</code> should now be the following for <code>rev5</code> USRPs; the other entries might still be different:<br> | ||
+ | <code>Chip: stm stm32f411<br> | ||
+ | Board: 0<br> | ||
+ | RO: titanium-rev5_v0.0.13823-82c52e<br> | ||
+ | RW: titanium-rev5_v0.0.13823-82c52e<br> | ||
+ | Build: titanium-rev5_v0.0.13823-82c52e<br> | ||
+ | 2024-03-04 15:58:54 @c09af2c5ef57</code><br> | ||
+ | <br> | ||
+ | For <code>rev6</code> and newer USRPs, the <code>rev#</code> text will not be present and the <code>Chip</code> might be different:<br> | ||
+ | <code>Chip: stm stm32f412<br> | ||
+ | Board: 0<br> | ||
+ | RO: titanium_v0.0.13823-82c52e<br> | ||
+ | RW: titanium_v0.0.13823-82c52e<br> | ||
+ | Build: titanium_v0.0.13823-82c52e<br> | ||
+ | 2024-03-04 15:58:54 @c09af2c5ef57</code> | ||
+ | </li> | ||
+ | |||
+ | </ol> | ||
[[Category:Application Notes]] | [[Category:Application Notes]] |
Latest revision as of 13:23, 28 August 2024
Contents
Application Note Number and Authors
AN-111 by Michael Dickens (draft of 2024-07-15)
Abstract
This document details how to download, extract, and install the X410/X440 USRP microcontroller ("MCU") firmware updates. This specific guide shows how to do the update to MCU firmware version 0.0.13823-82c52e33a
for any revision X410/X440 USRP (currently 5, 6, or 7).
The Procedure for the Read Only (RO) MCU firmware can be done from a Linux host computer/server or on the USRP itself assuming the X410/X440 USRP boots and can stay active and running for a minimum of 20 minutes. The Read/Write (RW) MCU firmware must be loaded from the Linux host computer/server; hence we recommend starting with the first Procedure on Step (1) and if that works then both the RO and RW MCU firmware will be successfully update. If you start with the second Procedure at Step (15) then only the RO portion will be updated, so you would then need to run the installer from the Linux host computer/server to get the RW portion updated.
Both are covered here; select the one that matches your current X410/X440 USRP situation & if possible, start with the first Procedure to try to get both the RO and RW firmware updated in one set of commands.
Procedure from Linux Host
NOTE: This guide assumes the following:
- A Linux host computer (we use Ubuntu / aptitude-based; others will work);
- The X410/X440 USRP is accessible to the Linux host computer via a USB cable connected to the USRP USB JTAG port;
- The X410/X440 USRP has power but is not powered on / is currently shut down;
- The X410/X440 USRP is the only USRP device connected in any form to the Linux host computer (just in case);
- This procedure should work regardless of whether the USRP can boot or not.
Procedure
- Make sure
openocd
is installed on the Linux host computer/server. The following command works for Ubuntu / aptitude-based:sudo apt-get -y install openocd
. - Make sure the USRP and host computer are connected via the USB cable as noted in (b) above.
- Use
screen
to access the MCU on serial port 2:
sudo screen /dev/serial/by-id/usb-Digilent_Digilent_USB_Device_XXXX-if02-port0 115200
NOTE:XXXX
will be some unique string for this specific serial device and Linux configuration, for example25163520B2FE
. If you copy/paste the first part of the command, up tousb-
and then press the<tab>
key once or twice then all the options will be listed; use the entry forif02
and then finish off the command as noted with115200
. - Press the
<return>
key and the prompt>
should appear; assuming it does then enter the command:
eepromdump mb
NOTE: The first few lines of output will look something like the following
For an X410 USRP:
cache hit mb
For an X440 USRP:
usrp_eeprom_board_info (0x10) pid: 0x0410, rev: 0x0005, compat_rev: 0x0005, serial: 320B2FE
usrp_eeprom_module_info (0x11) pid: 0xa410, rev: 0x0003, serial: 32190B4
cache hit mb
usrp_eeprom_board_info (0x10) pid: 0x0440, rev: 0x0006, compat_rev: 0x0006, serial: 3284FCB
usrp_eeprom_module_info (0x11) pid: 0xa440, rev: 0x0004, serial: 32896F8
- Note the
compat_rev
part ofusrp_eeprom_board_info
, in this case for the X410 USRP5
and for the X440 USRP6
; this value can currently be 5, 6, or 7 and, in the future, higher numbers.
- Detach from screen via pressing the keys
^a
(<control>
thena
) then\
, then for the prompt (at the bottom) press they
key, which will come back to the usual shell prompt. - Download and extract the archive to the Linux host computer to the
~/Downloads
directory:
cd ~/Downloads
wget https://files.ettus.com/binaries/misc/upgrade_mcu_titanium_v0.0.13823-82c52e33a.tar.gz
tar zxf upgrade_mcu_titanium_v0.0.13823-82c52e33a.tar.gz
cd upgrade_mcu_titanium_v0.0.13823-82c52e33a
- Run the "from host" MCU updater script:
sudo ./flash-firmware-from-host.sh
NOTE: This script will print the following:
This script updates the microcontroller firmware (RO and RW). The change is persistent across power cycles for the RO part. Running this script incorrectly can brick the device. This script may take upto a minute to run successfully.
Ensure that only one X410/X440 device is connected to the host machine at a time.
Steps:
1. Power off the X410/X440 device by running "shutdown -h now" or "poweroff" command from the Linux console. But leave the power connected and turned on.
2. Connect your X410/X440 device using the USB JTAG port to the host machine using a USB cable.
3. Ensure that only one X440/X410 device is connected at a time. No other USRP device should be connected.
4. Run this script.
5. Do not disconnect USB cable while the script is running as it may result in bricking of the device.
6. Power cycle the device after script has completed running successfully.
Updating the microcontroller firmware (RO part) is only required if the Ettus
Research support told you to do so.
Press "y" to continue
- Press the
y
key; the script will print:
Please enter the motherboard compat_rev number:
- Enter the
#
from thecompat_rev
info from step (5) (in this case5
for the X410 USRP or6
for the X440 USRP but use whatever you determined & the printout below will change accordingly), then press the<return>
key. The script will now print:The compat_rev 5 is within the supported range.
Hardare Rev: 5
Will use firmware file /home/uhd/Desktop/upgrade_mcu_titanium_v0.0.13823-82c52e33a/ec-titanium-rev5.bin
Press "y" to continue
- Press the
y
key; the script will now print out something like the following then terminate as well as try to boot the USRP:
Flashing ec-titanium-rev5.bin on hardware...
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
titanium
/home/uhd/Desktop/upgrade_mcu_titanium_v0.0.13823-82c52e33a
DEPRECATED! use 'adapter driver' not 'interface'
DEPRECATED! use 'adapter speed' not 'adapter_khz'
Info : clock speed 2000 kHz
Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x4)
Info : JTAG tap: stm32f4x.bs tap/device found: 0x06441041 (mfg: 0x020 (STMicroelectronics), part: 0x6441, ver: 0x0)
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : stm32f4x.cpu: external reset detected
Info : starting gdb server for stm32f4x.cpu on 3121
Info : Listening on port 3121 for gdb connections
Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x4)
Info : JTAG tap: stm32f4x.bs tap/device found: 0x06441041 (mfg: 0x020 (STMicroelectronics), part: 0x6441, ver: 0x0)
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080001f8 msp: 0x20000400
Info : device id = 0x30006441
Info : flash size = 512 kbytes
Info : JTAG tap: stm32f4x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x4)
Info : JTAG tap: stm32f4x.bs tap/device found: 0x06441041 (mfg: 0x020 (STMicroelectronics), part: 0x6441, ver: 0x0)
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080001f8 msp: 0x20000400
shutdown command invoked
- After the USRP shuts down, power it back up. Repeat command (3) then at the
>
prompt issue the commandversion
; the output should look like the following for when thecompat_rev
is5
; the #rev5
will match that from Step (5):
Chip: stm stm32f412
Board: 0
RO: titanium-rev5_v0.0.13823-82c52e
RW: titanium-rev5_v0.0.13823-82c52e
Build: titanium-rev5_v0.0.13823-82c52e
2024-03-04 15:58:54 @c09af2c5ef57
- Power on the USRP if it did not automatically do so after Step (12).
- Make sure that the USRP is connected to the host computer via a QSFP28 10/100 GbE link and/or the RJ-45 1 GbE link and that the networking is configured for your desired use-case, then run the following and see if the device comes up:
uhd_find_devices
NOTE:
- If you followed Steps (1) through (12) and if this command successfully finds the USRP then you are done! Congratulations on successfully upgrading the MCU firmware on your X410/X440 USRP!
- If the USRP does not boot or if this command does not succeed in finding the USRP, then try this whole procedure section again starting at Step (3). If you tried this already and the X410/X440 USRP is still having issues, contact Ettus support for assistance.
Procedure on USRP device
NOTE: This guide assumes the following:
- The X410/X440 USRP has internet access, or is networked to the Linux host computer via the RJ-45 1 GbE or 10/100 GbE QSFP28 ports;
- The X410/X440 USRR is powered on;
Procedure
- Power on the USRP if it did not automatically do so after Step (13), or if jumping here because the USRP successfully boots.
- Make sure that the USRP is connected to the host computer via a QSFP28 10/100 GbE link and/or the RJ-45 1 GbE link and that the networking is configured for your desired use-case, then run the following and see if the device comes up:
uhd_find_devices
NOTE: Assuming this command successfully finds the USRP note themgmt_addr
. Typical values are192.168.10.2
through192.168.40.2
, but this entirely depends on how the networking is configured. Let's call this value (whatever it actually is)MGMT_ADDR
. - Login to this USRP via the UHD-found
MGMT_ADDR
:
ssh root@MGMT_ADDR
- Download the archive, either directly or from the networked host computer attached to the USRP:
wget https://files.ettus.com/binaries/misc/upgrade_mcu_titanium_v0.0.13823-82c52e33a.tar.gz
- Extract the archive and move into the directory:
tar zxf upgrade_mcu_titanium_v0.0.13823-82c52e33a.tar.gz
cd upgrade_mcu_titanium_v0.0.13823-82c52e33a - Run the "from device" MCU updater script:
./flash-firmware-from-device.sh
NOTE: This script will print the following:
This script updates the microcontroller firmware (RO part). The change is persistent across power cycles. Incorrect updates may brick the device and may need you to use the host based update process. This script may take upto a minute to run successfully.
Updating the microcontroller firmware (RO part) is only required if the Ettus Research support told you to do so.
Press "y" to continue - Press the
y
key; the script will now print out something like the following:
This script will flash ec-titanium-rev5.RO.flat to the device
old RO version: titanium_v0.0.13797-11efcf3e6
new RO: titanium-rev5_v0.0.13823-82c52e
Press "y" to continue - Press the
y
key (again); the script will now print out the following (note that the USRP here isrev5
;rev6
,rev7
etc will show that revision number in the text instead of5
; this revision number is automatically detected by thedevice
version of the install script):
# Disable periodic led control commands to reduce i2c activity to the controller.
ledctrl led0 none
/usr/sbin/ectool --interface=dev reboot_ec RW
/usr/sbin/ectool --interface=dev flashread 0x0 262144 ec-titanium-rev5.RO.flat.old
Reading 262144 bytes at offset 0...
done.
# This call may throw some i2c errors due to long erase times
/usr/sbin/ectool --interface=dev flasheraseasync 0x0 262144
Erasing 262144 bytes at offset 0...
ioctl -1, errno 16 (Device or resource busy), EC result 255 (<unknown>)
done.
# Sleep and try erase again, this should succeed.
sleep 3
/usr/sbin/ectool --interface=dev flasheraseasync 0x0 262144
Erasing 262144 bytes at offset 0...
done.
/usr/sbin/ectool --interface=dev flashwrite 0x0 ec-titanium-rev5.RO.flat
Reading 84032 bytes from ec-titanium-rev5.RO.flat...
Writing to offset 0...
Write size 112...
done.
copying new firmware files
'ec-titanium-rev5.bin' -> '/lib/firmware/ni/ec-titanium-rev5.bin'
'ec-titanium-rev5.RW.bin' -> '/lib/firmware/ni/ec-titanium-rev5.RW.bin' - Reboot the USRP:
reboot
- All done! If you want to verify that the firmware is updated, then repeat step (12) and the output for
RO
should now be the following forrev5
USRPs; the other entries might still be different:
Chip: stm stm32f411
Board: 0
RO: titanium-rev5_v0.0.13823-82c52e
RW: titanium-rev5_v0.0.13823-82c52e
Build: titanium-rev5_v0.0.13823-82c52e
2024-03-04 15:58:54 @c09af2c5ef57
Forrev6
and newer USRPs, therev#
text will not be present and theChip
might be different:
Chip: stm stm32f412
Board: 0
RO: titanium_v0.0.13823-82c52e
RW: titanium_v0.0.13823-82c52e
Build: titanium_v0.0.13823-82c52e
2024-03-04 15:58:54 @c09af2c5ef57