[CustomKernel] The Grinch 19.3.8 for Jetson TK1 / developed

See:
https://devtalk.nvidia.com/default/topic/763773/embedded-systems/problem-when-flashing-system/post/4268326/#4268326

The script uses losetup for loopback mounting, and simply does not check if /dev/loop0 is open or existing. Seems you already have a user of loop0.

I saw /dev/loop0 thru /dev/loop7. I discovered that /dev/loop1 had a different modification date from other /dev/loop* Then I tried again. I did a find/replace on all loop0 in the script with loop9 which didn’t exist. I thought 0-7 were already taken. It didn’t work, complaining that loop9 didn’t exist. Then I noticed loop2 had a new modification date too.

Since loop3 was next, I modified the flash.sh again and find/replaced all loop9 with loop3. That worked. At 40minutes per try to get to that point, it took a while. Now I have successfully flashed the board, done the gpio thing, and copied the firmware for the iwlwifi to /lib/firmware/. There’s a LED labeled wlan that is lighting up now beside the pcie card.

I can’t seem to get wifi setup with just the keyboard, so I’m charging batteries now for my wireless mouse. I paired it with the board, but it doesn’t seem to be working just yet. I’m hoping it’s just low batteries. Wireless keyboard seemed to connect and get stuck with tab pressed down. So I have some hope it works when the batteries are fresh.

Just run, as root (or sudo), “losetup --find” prior to flash. Then modify the flash.sh script to use the loop# it names. The --find will find the first unused device, and doing so as root will create it if it doesn’t exist. Much of /dev is dynamically generated, and a moving target, so reboot or other uses of loopN will change what is visible.

I can’t get the wireless mouse to work. It pairs, but it doesn’t actually function. My wireless keyboard works, but I can’t find a super key, so without a mouse, that makes it useless too.

To the command line! I try iwconfig, but I see no wlan0. If I dmesg | grep iwlwifi I see

loaded firmware version 22.1.7.0 op_mode iwlmvm
Detected Intel® Dual Band Wireless AC 7260
L1 Enabled; Disabling LOS
RF_KILL bit toggled to disable radio.
L1 Enabled; Disabling LOS
Cannot read NVM from section 0 offset 0, length 2048
Failed to read NVM: -132
Failed to run INIT ucode: -132

It seems the gpio hint that should fix the RF_KILL thing isn’t working for me.

Woooo! WiFi is working! Intel 7260.

If I reboot, gpio191 disappears. It seems I’m going to have to do this every time the system boots? :/

After doing the gpio dance, I had to

sudo modprobe -r iwlwifi
sudo modprobe iwlwifi

Then I can alt-F10 and see “Enable Wi-Fi” in the wireless menu. Selected my wireless and connected. Even loaded this page, but making a reply was too painful without a mouse :)

Edit: Santyago, if you’re ever in Phoenix, I owe you a beer! ;)

To make ubuntu automatically do the gpio dance, I added the following to /etc/rc.local:

#!/bin/sh -e

rc.local

This script is executed at the end of each multiuser runlevel.

Make sure that the script will “exit 0” on success or any other

value on error.

In order to enable or disable this script just change the execution

bits.

By default this script does nothing.

echo 191 > /sys/class/gpio/export;
echo out > /sys/class/gpio/gpio191/direction;
echo 1 > /sys/class/gpio/gpio191/value;
modprobe -r iwlwifi;
modprobe iwlwifi;

exit 0

UDF support, excellent. Does that include DVD-RAM UDF 2.01+? Or does UDF automatically include all of that? Also is there a way to flash without another Linux computer? Can a Windows computer be used?

Unpacking L4T requires preserving permissions. L4T basically creates a clone of the target. The NTFS file system cannot succeed, it does not understand linux file permissions. With a lot of work, it might be possible to pre-create the system.img and any other image on linux and then flash from windows, but creation of this from a windows file system is not even a remote possibility.

Add to this that part of the software in flashing is binary, designed to execute on linux…something like cygwin might be able to run these. Then you are back to the NTFS file system issue, even with cygwin. Care to invent windows support for ext4 with linux permissions supported in place of windows permissions?

Then is it possible to run Linux through VirtualBox on my Windows computer and accomplish a flash?

If (a) virtual box has a native ext4-capable file system (including linux file permissions), and (b) can run native x86 linux ELF executables, as well as loopback mount these, probably so. That would tend to make it a real linux install, even if it has a host o/s. But that’s cheating! :P

I have launched the Jetson in forced recovery mode and it is also detectable on the host computer. I suppose I have to login to the Jetson through the usb so that I can run the ./flash.sh script.

can anyone help me how can I login to the jetson after the recovery mode so that I can flash the board.

No, you dont have to log in at all (you would not be able to either).
You will find all th einfo/links to info here:

https://devtalk.nvidia.com/default/topic/764153/embedded-systems/missing-info-on-flashing-from-19-2-to-19-3/

@enthusl: great help, thanks for pointing out to documentation

Having trouble with flashing the card.

pluto@pluto-macbook:~/Downloads/Linux_for_Tegra$ ./flash.sh -S 14580MiB jetson-tk1 mmcblk0p1
copying dtbfile(/home/pluto/Downloads/Linux_for_Tegra/kernel/dtb/tegra124-pm375.dtb) to tegra124-pm375.dtb… done.
Making system.img… /home/pluto/Downloads/Linux_for_Tegra/rootfs 15288238080
making system.img failed.

Repeatedly getting system.img failed ?

Two possibilities. First, the system.img is the full size of the entire Jetson flashed using the -S option. So, if the size used was -S 14GiB, you need about 15 GB of hard drive on your host. Second, this system.img is loopback mounted as a full file system, and the script is hard wired to use /dev/loop0…but loop0 does not exist on some systems until root runs losetup --find; and sometimes loop0 is already there, but something is using it.

So first thing, make sure your host has enough hard drive space (once everything is unpacked you probably want at 18 GB or so of spare space). “df -h” is a good way to view.

Second, does “ls /dev/loop0” show it exists? If it does, then likely it is already being used. Using root or sudo, run “losetup --find”. If loop0 did not exist, this will create it temporarily; if it does exist, likely it’ll answer something like loop1 instead of loop0…for this latter case, edit your flash.sh wherever it says loop0, make it the new loop#, e.g., loop1.

See this for more loopback info:
https://devtalk.nvidia.com/default/topic/763773/embedded-systems/problem-when-flashing-system/post/4268326/#4268326

Can you provide the source code for the PWM_SYSFS? Or point it?

Great!

Intel Network 7260.HMWG WiFi Wireless-AC works fine.

So I flashed this onto my Jetson, and now it doesn’t boot. It gets a kernel panic because it wasn’t able to mount the root filesystem. It also gives me the error "no permission to look at /dev/loop. I’m going to try it with a different host computer.

What was your flash command line? Also, on the host you flashed from, does /dev/loop0 exist? What is the output of root (or sudo) running “losetup --find”?

@netphantm: ok, I will add autofs in next release

@cdsousa: I will upload patch tomorrow for you

@andzerb: do you flash as root?

Hello, new version of custom kernel 19.3.3:

  • Added USB Printers support
  • Added FTDI serial-to-USB driver (Arduino)
  • Added Quota support
  • Added AutoFS support
  • Backported DVB USB drivers: rtl28xxu
  • Backported tuners drivers: e4000, r820t
  • Default setting high level for GPIO 191
  • Enabled PWM controller in DTB file. PWM0 is assigned to PU3 pin (Pin 49 on J3A2)

Note: For autoset GPIO 191 for WiFi mPCIe adapters during boot and enable PWM0, PWM2, PWM3, flash whole system is required, because we need replace DTB file. Example use of PWM0 was added to Hint #4.

PWM0 test. At the moment only PWM0 is enabled. In the next release we will also PWM2 and PWM3.

DVB-T is working too. Tested with Not Only TV LV5TDeluxe (RTL2832U).

P.S. Please notice working devices in comments. Command: lspci -nn (for mPCIe devices) or lsub (for USB devices). eg.:

mPCIe: Qualcomm Atheros AR9285 Wireless Network Adapter (PCI-Express) [168c:002b] (rev 01)

Update

Here is updated file tegra124-pm375.dtb for enable PWM0, PWM2, PWM3.

Flash whole OS is required.

Check md5sum for tegra124-pm375.dtb file - is fixed pinmux for PU3, PU5, PU6. See Hint #4.