$ sudo screen /dev/ttyUSB0 115200

The Support Series #1
How to re-install a broken operating system on Blox

 Our Blox platform is built around the Nvidia Jetson processor series. And so it comes with the Nvidia Ubuntu reference operating system, which works for most out-of-the box  implementations, but our clients aren’t that standard. Actually, the whole edge ai market is for from being standard at the point, which is part of working with new technology. So the system needs to be tweaked, often resulting in spending a lot of energy in configuration, unstable behavior or – worst case – a broken system that doesn’t boot anymore. Not the kind of situation we like.

As AI-Blox, we want to deliver a complete system, ready to use, without any friction points for our clients. That’s why we’ll invest in our own operating system in the future, combined with some remote management functionalities. More on that to come soon...

In the meantime, we will support our customers with the Ubuntu reference operating system from NVIDIA. Therefore, I will explain how to reinstall the NVIDIA SDK on a Blox platform, after it got broken. 

Managing Disk Space

One of the NVIDIA SDK’s problems is that the suggested disk space is 32GB or bigger. We only use production Jetson modules, and those are shipped with 16GB of EMMC flash. Therefore we deliver all of our Blox devices including a free upgrade with a 32GB uSDCard.

 This means that the installation of the NVIDIA SDK needs to be done in 3 steps:

Step 1 :  Install the Linux OS without any additional SDK’s such as CUDA

Step 2 :  Prepare the uSD-card so that the /usr directory moves to the uSDCard

Step 3 : Install additional SDKs on the system which will mainly be placed on the external uSD-card

Reviving your Blox

It’s important to have the following items at your hand:

  • A Ubuntu 18.04 system with the latest NVIDIA SDK installed

  • Our Blox programmer cable 

  •      And of course your broken Blox

Step 1 : Connect the programmer cable

Every Blox has a programming connector, this programming connector can be found in the communication slot. Therefore you need to remove the red cover of the communication module. To connect the Blox programmer, you need to plug the pogo-pin connector of the programmer to the programming connector as shown in the picture below.

Step 2 : Start the SDK

First you need to place the Blox in recovery mode. For doing so, you have to hold the programming button whilst the BLOX is NOT powered. While holding the button, power the BLOX. When the BLOX has powered up, you can release the program button. The BLOX programmer also has the possibility to show the console terminal port. This can be done with following command

$ sudo screen /dev/ttyUSB0 115200

Where /dev/ttyUSB0 could be different on your system.  

The next step is to start the NVIDIA SDK. Once you have that you can follow the steps shown over there.

Step 3 : Install the SDK

This process consists of 4 steps, by following the on-screen instructions.

Step 3.1 
In the first screen in the SDK, you need to select your target hardware and your target operating system. 

You can verify if your BLOX is in programming mode by pressing the refresh button in the Target Hardware box. When the BLOX has been recognized, you will get a list of supported hardware targets as shown below.

Make sure you select the right module:

For the Jetson Nano (MX1010-x): P3448-0002
For the Jetson Xavier (MX1030-x): P3668-0002

When the right target hardware is selected, you can continue to next screen

Step 3.2
It’s important to select the Jetson OS only, and NOT the Jetson SDK Components. They will be installed in a later stadium. Check the license agreements, and you’re ready to continue to step 03.

Step 3.3:
when you have entered the root password of your host system, you’ll see the screen below. Here it’s important to select the Manual Setup in point 1. At point 7 you can keep the Pre-Config and choose a username and password for your root user. Aftwards, you can press the Flash button and the flashing process will start. In the console terminal, you can follow the progress. 

When flashing is finished, we need to install the right device-tree to the device. Before that, you need to download the correct device tree from our website. You can upload the device tree with following commands to the BLOX:

$ sftp ai-blox@xxx.xxx.xxx.xxx 
Connected to xxx.xxx.xxx.xxx.
sftp> put tegra210-p3448-0002-mx1010-1-a00.dts
Once uploaded, the file has to be moved to the right directory:

$ ssh ai-blox@
ai-blox@ubuntu:~$ sudo mv tegra210-p3448-0002-mx1010-1-a00.dt /boot/
ai-blox@ubuntu:~$ sudo chown root:root /boot/tegra210-p3448-0002-mx1010-1-a00.dts 

To load the right device-tree during boot, you need to modify the /boot/extlinux/extlinux.conf and the FDT parameter before the INITRD as shown below:

DEFAULT primary

 MENU TITLE L4T boot options

 LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      FDT /boot/tegra21p3448-0002-mx1010-1-a00.dts
      INITRD /boot/initrd
      APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1 nv-auto-config 

When this is done, you can reboot the device.

When the device is rebooted successfully, we need to prepare the SD-card. If you want to keep the current partition table, you can skip the next step and proceed to the formatting of the drive. 

We suggest having a 20GB partition for the /usr directory, and the rest of the 32GB as a mountable disk where you can store your own data. Paste the following script in a file called partition.table and then execute this script.

label: dos
label-id: 0x00000000
device: /dev/mmcblk1
unit: sectors
/dev/mmcblk1p1 : start=        2048, size=   62331904, type=5
/dev/mmcblk1p5 : start=        4096, size=   41943040, type=83
/dev/mmcblk1p6 : start=    41949184, size=  20384768, type=8

$ sudo sfdisk /dev/mmcblk1 < partition.table
When the partition table is created, you need to format the disk:

$ sudo mkfs -t ext4 /dev/mmcblk1p5
Afterwards, we can create the mount points and mount the first partition:

$ sudo mkdir /mnt/sdcard
$ sudo mkdir /mnt/mmc
$ sudo mount /dev/mmcblk1p5 /mnt/mmc
Now we can copy the /usr directory to the SD-card:

 $ sudo rsync -avzh /usr/* /mnt/mmc
To auto mount the SD-card during boot, we need to add 2 lines into the /etc/fstab file. For this we need the UUID of the 2 SD-card partitions:

$ sudo blkid
/dev/mmcblk1p5: UUID="daa19ccf-c70b-42a9-8ddc-861135cd8c66" TYPE="ext4"
/dev/mmcblk1p6: UUID="0972789d-ebdd-41cf-94ea-595ae7aa6363" TYPE="ext4"

Modify /etc/fstab so that the first partition will be mounted to /usr and the second to /mnt/sdcard 

# /etc/fstab: static file system information.
# These are the filesystems that are always mounted on boot, you can
# override any of these by copying the appropriate line from this file into
# /etc/fstab and tweaking it as you see fit. See fstab(5).
# <file system> <mount point> <type> <options> <dump> <pass> /dev/root / ext4 defaults 0 1 UUID=daa19ccf-c70b-42a9-8ddc-861135cd8c66 /usr ext4 defaults 0 2
UUID=0972789d-ebdd-41cf-94ea-595ae7aa6363 /mnt/sdcard ext4 defaults 0 2

Reboot the system so the settings get applied. 
$ sudo reboot

Now you can install the Jetpack SDK components. Most of them will be installed on the 

SD-card. And off you go! 

in Blog
# Blog
$ sudo screen /dev/ttyUSB0 115200

Edge technology as a catalyst for AI adoption