Nano image behaves differently if flashed via recovery mode + usb or sd card

Hello all,

I’m running into a bit of a strange issue. I’ve created a custom image using yocto and meta-tegra, and have had great success. The goal is to create an image that can be flashed onto a nano dev-kit (the brains of a smart appliance), and have it ready to go on first boot.

There are elements that weren’t possible during the image creation. For these cases, I created one-shot services to run on first boot and then be disabled.

During development I flashed the nano using the toolkit provided by NVIDIA and running the doflash.sh script available in the image archive generated from Yocto. The layer also generated a script named dosdcard.sh that generates an sd card image. This image can be flashed to the sd card using software like balenaEtcher.

When flashing the nano in recovery mode and connected via micro USB, the image performs it’s cold boot and runs initial setup correctly. Rebooting after this setup has finished, it starts up perfectly fine and requires no additional work.

When booting from the flashed sd card, however, the system is not configured correctly. There is a node web app that is managed using pm2 (node process manager) and is run by a restricted user. During initial boot, the daemon service is configured to run the node app at boot. Running from the sd card flashed image, this daemon service never exists.

Additionally, the system runs significantly slower. There’s a startup script that turns on 8 GPIOs on boot with a 1 second delay. When running from a sd card flashed image, the gpios turn on with a delay of 2-2.5 seconds in between. The nano drived an OLED, but the response time is significantly slower on the sd card flashed image.

I’m wondering if anyone has noticed differences in using an image flashed to an sd card and inserted into the nano versus an image flashed onto the SD card via recovery-mode and micro-USB connection.

Also, I can provide more information as needed. I wanted to keep this post brief.

Thanks!

hello bsmerbeck,

could you please also point-out which toolkit you’re using.
thanks

Jerry,

I’m using the most up-to-date nvidia SDK and the doflash.sh tool that’s used across nvidia boards.

Basically after building the custom image based on jetson-nano-qspi-sd, I unzip the archive generated. Then I put the nano in recovery mode, power it via dc, connect a usb and run doflash.sh.

I’ve additionally tried another method of writing the image to an SD card. I’ve flashed the device in recovery mode via usb and ensured it was working and valid. I’ve then used win32diskimager to create a .img file of the image. Using balenaEtcher, I’ve written to a newly formatted SD card. After inserting the card and booting the system, nothing occurs. No boot at all.

EDIT I went ahead and tried dd to see if that would succeed. Same result, no boot.

hello bsmerbeck,

it should be flash.sh instead of doflash.sh
did you download and install the JetPack release image via SDKmanager?

Jerry,

I did. And sorry, the differences here are likely related to my using of meta-tegra available here: https://github.com/OE4T/meta-tegra

the doflash.sh script calls a helper script that uses tegraflash.py to handle the flashing.

I’ve included a gist that shows the three files being called: https://gist.github.com/bsmerbeck/3fb28b8f24c3c0f28bcec5409c814c7b

I’ll attempt with the release image, though I imagine this will work fine.

hello bsmerbeck,

FYI,
there’re two device types within the flash configuration file.
you may enter forced-recovery mode to execute flash commands to update both of them.
for example,
$OUT/Linux_for_Tegra/bootloader/t210ref/cfg/flash_l4t_t210_spi_sd_p3448.xml

<device type="spi" instance="0">
...
<device type="sdcard" instance="0">
...

UPDATE: I’ve been able to localize the issue that’s occurring when copying the image to an SD card.

The issue is apparently related to flashing the image via Windows. What I’ve been able to perform successfully is:

  • Flash the Jetson Nano via USB
  • Copy the image to a file using ddon an Ubuntu host
  • Using balenaEtcher on an Ubuntu host to write the image to a new microSD card
  • Successfully boot from the new microSD card

What causes the failure seems to be flashing the image using balenaEtcher for Windows. I’ll switching to ubuntu for flashing the microSD cards from now on, but wanted to post my results for reference.

Best,

Brenden