<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ramin Nabati on Medium]]></title>
        <description><![CDATA[Stories by Ramin Nabati on Medium]]></description>
        <link>https://medium.com/@ramin.nabati?source=rss-ba51c497f767------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*c4WHCihT8oxTRegVPrlYmw.jpeg</url>
            <title>Stories by Ramin Nabati on Medium</title>
            <link>https://medium.com/@ramin.nabati?source=rss-ba51c497f767------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 20:54:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ramin.nabati/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Enabling CAN on Nvidia Jetson Xavier Developer Kit]]></title>
            <link>https://medium.com/@ramin.nabati/enabling-can-on-nvidia-jetson-xavier-developer-kit-aaaa3c4d99c9?source=rss-ba51c497f767------2</link>
            <guid isPermaLink="false">https://medium.com/p/aaaa3c4d99c9</guid>
            <category><![CDATA[can]]></category>
            <category><![CDATA[controller-area-network]]></category>
            <category><![CDATA[can-bus]]></category>
            <category><![CDATA[can-transceivers]]></category>
            <category><![CDATA[nvidia-jetson-xavier]]></category>
            <dc:creator><![CDATA[Ramin Nabati]]></dc:creator>
            <pubDate>Fri, 09 Nov 2018 05:50:00 GMT</pubDate>
            <atom:updated>2020-06-11T01:03:23.182Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nY5lfGwXe27gtfyL-IF2LQ.jpeg" /></figure><p>The <a href="https://developer.nvidia.com/embedded/buy/jetson-xavier-devkit">Nvidia Jetson Xavier</a> is equipped with two Controller Area Network (CAN) controllers, but it does not have any CAN transceivers. These transceivers can be easily added to the Jetson Xavier developer kit to enable CAN bus communication with other devices. In this tutorial I’ll go through all the steps needed to enable the CAN controllers on the Jetson Xavier developer kit. I start with configuring the GPIO pins on the Jetson Xavier and enabling the CAN controllers, and then go through the transceiver installation steps.</p><blockquote>A Chinese translation of this tutorial is now available <a href="https://steinslab.io/archives/1712">here</a>, thanks to <a href="https://steinslab.io/">Tuan Misaka</a>.</blockquote><h3>Part 1: Enabling CAN Controllers</h3><p>The CAN controllers in the Jetson Xavier developer kit can be accessed through the GPIO expansion header. By default, the CAN controllers’ pins are configured to have GPIO functionalities to comply with the Raspi 40-pin standard, so the first thing we need to do is to reconfigure these pins to enable CAN functionalities. According to <a href="https://devtalk.nvidia.com/default/topic/1042493/enable-can-on-xavier/">this post</a> on the Nvidia Xavier developer forum, there are two ways to reconfigure these pins. The first way involves flashing the Xavier with a particular pinmux configuration. Since I do not want to re-flash my Xavier, I’ll go with the second solution.</p><p>The second solution is using a register read/write tool to overwrite the register values corresponding to the CAN controller pins. The only catch in this solution is that these settings are not persistent, meaning that they need to be repeated every time the Jetson Xavier developer kit is powered on. We will take care of this problem by writing a configuration script that runs automatically at system startup. Let’s get started by opening a terminal on the Jetson Xavier and following the steps below.</p><ul><li>We start by installing a tool for changing the register values on the Xavier:</li></ul><pre>sudo apt-get install busybox</pre><ul><li>Then we need to reconfigure four register values corresponding to the CAN controllers’ pins. The following commands will reconfigure these pins:</li></ul><pre>sudo busybox devmem 0x0c303000 32 0x0000C400<br>sudo busybox devmem 0x0c303008 32 0x0000C458<br>sudo busybox devmem 0x0c303010 32 0x0000C400<br>sudo busybox devmem 0x0c303018 32 0x0000C458</pre><ul><li>Now that the register values are modified, we can mount the CAN controllers and load the drivers using the modprobe command:</li></ul><pre>sudo modprobe can<br>sudo modprobe can_raw<br>sudo modprobe mttcan</pre><ul><li>The next step is configuring the CAN Controllers according to your CAN bus and transceivers’ specifications. Here I set the CAN bitrate to 500 Kbps, enable the flexible data rate (FD), set the payload bitrate to 2 Mbps and enable the Bus Error Reporting. If you are not sure about all these settings, you can just set the bitrate value and ignore other options after that.</li></ul><pre>sudo ip link set can0 type can bitrate 500000 \<br>    dbitrate 2000000 berr-reporting on fd on<br>sudo ip link set can1 type can bitrate 500000 \<br>    dbitrate 2000000 berr-reporting on fd on</pre><ul><li>Now we just need to bring the CAN interfaces up:</li></ul><pre>sudo ip link set up can0<br>sudo ip link set up can1</pre><ul><li>To check if the CAN controllers are successfully enabled, use the ifconfig command. In the output you should be able to see can0 and can1 among your network devices as shown in the figure below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*bcuncODw-R6qvT7sk9uD6g.png" /></figure><ul><li>To make the above CAN controllers configuration automatically done at system startup, create a file named enable_CAN.sh in the root directory and make it executable:</li></ul><pre>touch /enable_CAN.sh<br>chmod 755 /enable_CAN.sh</pre><ul><li>Add the following lines to this file and save it. These are basically the same commands we ran to configure the CAN controllers.</li></ul><pre>#!/bin/bash</pre><pre>sudo busybox devmem 0x0c303000 32 0x0000C400<br>sudo busybox devmem 0x0c303008 32 0x0000C458<br>sudo busybox devmem 0x0c303010 32 0x0000C400<br>sudo busybox devmem 0x0c303018 32 0x0000C458</pre><pre>sudo modprobe can<br>sudo modprobe can_raw<br>sudo modprobe mttcan<br>sudo ip link set can0 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on<br>sudo ip link set can1 type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on<br>sudo ip link set up can0<br>sudo ip link set up can1<br><br>exit 0</pre><ul><li>If the file /etc/rc.local already exists on your Jetson Xavier, skip to the next step. If it does not exist, go ahead and create it by running the following commands in terminal:</li></ul><pre>printf &#39;%s\n&#39; &#39;#!/bin/bash&#39; &#39;exit 0&#39; | sudo tee -a /etc/rc.local<br>sudo chmod +x /etc/rc.local</pre><ul><li>Add the following line to the/etc/rc.local file before the exit 0 line:</li></ul><pre>sh /enable_CAN.sh &amp;</pre><ul><li>Your /etc/rc.local file should look like this now:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*anzRSeuIOeue8iLsr4LWgg.png" /></figure><p>Now the enable_CAN.sh script should be run automatically at system startup and configure the CAN controllers. To test it, reboot your Jetson Xavier and check if you still see the can0 and can1 devices when you run the ifconfig command in a terminal.</p><h3>Part 2: Installing the CAN Transceivers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*bKoMZWM3wD58h-ptY9RyFQ.jpeg" /><figcaption>KNACRO CAN Bus Transceivers</figcaption></figure><p>I’m using two <a href="https://www.amazon.com/KNACRO-SN65HVD230-Communication-transceiver-Arduino/dp/B01ILU2WP6/ref=sr_1_5?ie=UTF8&amp;qid=1541546295&amp;sr=8-5&amp;keywords=can+transceiver">KNACRO CAN bus transceivers</a> for my setup so that I can interface with two CAN buses at the same time. You can install just one transceiver if you need to communicate with one CAN bus only. The transceivers I use run at 3.3V and have 120 Ohm terminating resistors already soldered across the bus.</p><p>The pinout for the expansion header on the Jetson Xavier as well as the location of pin #1 is shown in the figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*H869GbwxNiazCuIguHMbnQ.png" /><figcaption>Nvidia Jetson Xavier Expansion Header Pinout</figcaption></figure><p>We start by connecting pin #29 (CAN0_DIN) and pin #31(CAN0_DOUT) of the Expansion Header connector to the CRX and CTX pins on one of the transceivers. Similarly, pin #37 (CAN1_DIN) and pin #33 (CAN1_DOUT) need to be connected to the CRX and CTX pins on the other transceiver. We also need to connect two sets of 3.3V and GND pins on the expansion header connector to the 3V3 and GND pins on the transceivers. The following diagram demonstrates how the transceivers’ pins are connected to the expansion header pins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*4MFE8J38Be-aK_zzIftLdQ.png" /><figcaption>Wiring Between the Transceivers and the Expansion Header</figcaption></figure><p>The CANH and CANL pins on the transceivers need to be connected to the CAN High and CAN Low wires of the two CAN buses that you want to communicate with. We will also need some kind of structure to fix the transceivers and the Jetson Xavier developer kit on. We have made a simple platform to mount the boards and the transceivers on. Figure below shows the transceivers connected to the Jetson Xavier developer kit and mounted on this platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FpmzIgXV_Lh5OwcP2QeXEg.jpeg" /></figure><p>As seen in the figure above, I used a DB-9 connector to interface with the CAN bus. The two sets of twisted wires are the CANH and CANL wires for CAN0 and CAN1. To keep the error rate low, the CAN High and CAN Low wires are usually twisted. On the DB-9 connector, I’ve used pins 1 and 8 for CAN0 Low and High and pins 2 and 7 for CAN1 Low and High, but you can use any other pinout that fits your application.</p><h3>Notes</h3><ol><li>According to the Jetson AGX Xavier Developer Kit Carrier Board Specification document, pins 37, 29, 33 &amp; 31 are pulled to 3.3V when system is powered on due to internal 3.3V pull-ups in the SoC enabled by default. So the transceiver you use must be able to handle the initial 3.3V on its CTX and CRX pins. The transceiver used in this tutorial seems to be handling this initial 3.3V with no problem.</li><li>A very good set of scripts for configuring and testing the CAN controllers on the Jetson Xavier is published by a Jetson Xavier user <a href="https://github.com/hmxf/can_xavier">in this repository</a>.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aaaa3c4d99c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing an NVMe SSD Drive on Nvidia Jetson Xavier]]></title>
            <link>https://medium.com/@ramin.nabati/installing-an-nvme-ssd-drive-on-nvidia-jetson-xavier-37183c948978?source=rss-ba51c497f767------2</link>
            <guid isPermaLink="false">https://medium.com/p/37183c948978</guid>
            <category><![CDATA[xavier]]></category>
            <category><![CDATA[nvme]]></category>
            <category><![CDATA[jetsons]]></category>
            <category><![CDATA[nvidia]]></category>
            <category><![CDATA[ssd]]></category>
            <dc:creator><![CDATA[Ramin Nabati]]></dc:creator>
            <pubDate>Sat, 06 Oct 2018 18:06:37 GMT</pubDate>
            <atom:updated>2020-05-22T17:01:08.578Z</atom:updated>
            <content:encoded><![CDATA[<h3>Installing an NVMe SSD on Nvidia Jetson Xavier</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*F70zVA0xcVASuWrnS0Palw.png" /><figcaption>Fig. 1: Jetson Xavier Developer Kit (Courtesy Nvidia)</figcaption></figure><p>The Nvidia Jetson Xavier has a 32 GB eMMC 5.1 Flash Storage. This may be enough to start exploring the Jetson Xavier and running simple deep learning algorithms, but you will probably end up needing more storage capacity and also faster read/write speeds for more serious applications. The Jetson Xavier Developer Kit has a USB3/eSATA port that could be used to power a 2.5&quot; SSD, but the Developer Kit also has an M.2 Key-M connector. This allows us to install an NVMe SSD which has a much smaller form factor. In this tutorial, I’ll go through the process of installing an NVMe M.2 SSD on the Nvidia Jetson Xavier developer kit. I assume you have already flashed the Jetson Xavier using Nvidia JetPack and you are able to power up the device and boot to Ubuntu.</p><p>I chose the 512GB Samsung 970 Pro NVMe SSD for my setup. The write speed of the 970 Pro is slightly higher than the 970 Evo model (2700 vs 2500 MB/s) which might be an important factor when using the Jetson Xavier for recording and processing video from multiple cameras in real time. Also the SSD lifespan, measured in Tera Bytes Written (TBW), is significantly higher in the Pro model (600 vs 300 TBW).</p><p>Now let’s get started installing the SSD!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i96yj-I4jZYV6_cMfnEXjQ.png" /><figcaption>Fig. 2: The 512 GB Samsung 970 Pro NVMe SSD and the Jetson Xavier developer kit</figcaption></figure><p>The M.2 connector on the Xavier developer kit is located under the heat sink. In order to access this connector, we need to remove the heat sink from the developer board. We start by removing the 4 screws attaching the heat sink to the board using a Phillips screwdriver. Turn the developer kit upside down and locate the screws shown in figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dd6d0LLcGZpTD1RQkcmOxA.png" /><figcaption>Fig. 3: Heat sink screws that need to be removed are shown in red circles</figcaption></figure><p>After removing the screws, we can remove the two stands from the board, as shown in Fig. 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*92bb36fGH8hK56MG20w_9g.png" /><figcaption>Fig. 4: The stands detached from the developer board</figcaption></figure><p>Now we need to gently pull the developer board up while holding the heatsink down, to detach the heatsink and Xavier chip from the developer board. There is a wire going from the heatsink to the board, so be careful not to pull the board too hard to damage this wire. You may need to wiggle the board a little bit to detach the connectors between the board and the heat sink. Fig. 5 shows the detached board and heat sink.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jK4a4gq0w4miHjmZWWmdMA.png" /><figcaption>Fig. 5: Developer board detached from the heatsink and Xavier chip</figcaption></figure><p>Just to make sure the wire is not accidentally damaged, gently remove the cable from the board by pulling the connector with a pair of tweezers. <em>Do not</em> pull the wire itself. Although we don’t really need to detach this connector, it makes installing the SSD much easier. If it is not detached, the developer board cannot lay flat on the desk because the wire is too short.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g6tnihCuzYwvZKAph3vm_A.png" /><figcaption>Fig. 6: Heat sink wire detached from the developer board</figcaption></figure><p>There is one screw on the developer board that holds the NVMe SSD device in place after installation. Locate and remove that screw before putting the SSD in place. Now insert the NVMe SSD with a 30 degrees angle in the M.2 connector and gently slide it in. You may need to wiggle it just a little bit to get it past the friction of the M.2 connector. If installed properly, the SSD should be hanging off the developer board as shown in figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1z8CwFg3OzSXt-M2MntNpA.png" /><figcaption>Fig. 7: NVMe SSD pushed into the M.2 connector</figcaption></figure><p>Gently push the SSD down until it is flat against the developer board and use the screw to hold it onto the board. If the screw holes on the board and SSD do not match perfectly, the SSD is probably not completely pushed into the M.2 connector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U6f1dSVXQGR0sv53SMgpJQ.png" /><figcaption>Fig. 8: The SSD installed and secured on the board</figcaption></figure><p>Now connect the heat sink connector back to the developer board and put the board on the heatsink. Make sure the Xavier module connector on the heat sink matches the connector on the developer board as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w_4ruXmURRrF-OXIVmSpgw.png" /><figcaption>Fig. 9: Wire connected and board ready to be put back on the heatsink</figcaption></figure><p>Gently push the board down until the connectors are completely engaged. Put the two stands back on the board and secure them with the screws. Done! The SSD is now successfully installed and ready to use. Now we just need to power up the board, format the SSD, create a partition and mount it. If you need help doing these steps, continue reading. If not, thanks for reading this tutorial and have fun with the (now even more) powerful Jetson Xavier!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LOZ8iVvVkAwsrwPs9bQTyg.png" /><figcaption>Fig. 10: Stands are put back in place</figcaption></figure><p>To set up the newly installed SSD, connect a monitor, keyboard, and mouse to the Xavier developer kit and power it up. Log in to your account in Ubuntu and open the Disks app. You should be able to see your SSD in the list of disks on the left, as shown in figure below. Note that your SSD may have a different name. From this window, you should be able to see the path to the newly installed SSD. In my case, the path is /dev/nvme0n1. We can format the disk and create partitions using the Disks app, but I prefer to do it in a terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*-HUkzN8F3CAiImO1J9lv2w.png" /></figure><p>Open a terminal and use the following command to specify the partitioning standard we want to use for the new SSD. Make sure you use the right path in this command because the path to your SSD may be different.</p><pre>sudo parted /dev/nvme0n1 mklabel gpt</pre><p>You need to confirm the above command by typing yes in terminal when prompted. This command should only take a few seconds to complete. Once completed, go to the Disks application again and select the SSD on the left. Now, there should be a + icon under the Volumes for creating partitions, as shown in figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*1ZxXlDQ-SIOmAkPMfGfA0A.png" /></figure><p>Click on the + to create a partition and choose the partition size. I want to have only one partition so I choose 512GB as my partition size and click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*EZBYsiox8wgtbJYMZ6memw.png" /></figure><p>Now we need to choose a name for the volume and select the partition format. Type in your partition name and choose the Ext 4 format and click on Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*Mu_dmKhRCmafgpiFiljFsw.png" /></figure><p>In my case, the path to the newly created partition is /dev/nvme0n1p1 . We need this path and also the device UUID for the next step, so have the Disks application open to be able to copy them when needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*BnBLztjM9AeLDx-Gm5ON2g.png" /></figure><p>Open a terminal and use the following commands to create a mount directory for mounting the partition. I prefer to have the partition mounted in /rootin a directory named xavier_ssd. I also change the mount directory permissions to 755 (readable by User, Group and World, writable by User, executable by User, Group and World). Use your own SSD device path in the mount command as it may be different from mine.</p><pre>sudo mkdir /xavier_ssd<br>sudo mount /dev/nvme0n1p1 /xavier_ssd<br>sudo chmod 755 /xavier_ssd</pre><p>To mount the partition automatically at boot, we need to add the new partition information to the /etc/fstab file. We don’t want to accidentally damage this file, so let’s make a backup first before editing it:</p><pre>sudo cp /etc/fstab /etc/fstab.bkup</pre><p>Now copy the SSD UUID from the Disks app, open the fstab file by typing sudo vim /etc/fstab in terminal. Add the following line at the very end of the file, replacing &lt;uuid&gt; with the device UUID we just copied from Disks:</p><pre>UUID=&lt;uuid&gt;  /xavier_ssd  ext4  defaults  0  2</pre><p>Save the changes and close the file. Now to check if everything is working, let’s unmount the device and mount it again:</p><pre>sudo umount /xavier_ssd<br>sudo mount -a</pre><p>You should be able to access the SSD partition now by typing cd /xavier_ssd in a terminal.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37183c948978" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>