Can't connect to i.MX7 via fastboot - android

I have an IMX7 board from TechNexion. This is the board linked from the Android Things website as a supported board. On unboxing the board, I cannot connect to the device via Fastboot. I can access the boot prompt and default/shipped linux installation via a serial connection. It also connects via ethernet. But no Fastboot. I'd like to install the latest Android Things OS.
fastboot devices returns nothing. adb devices returns nothing. Rebooting adb has no impact. I've also tried starting Fastboot from the U-Boot prompt.
=> fastboot
Unknown command 'fastboot' - try 'help'
The documentation implies it's installed on the device.
I'm running the latest Android platform tools (26.0.0) on a Mac (10.12.6).
I don't have much experience with Fastboot or hardware, but I have connected to a few other boards without any problem. Any ideas appreciated.
EDIT: below is the output as seen from the serial connection. This is the bootloader output, and then also the initial part of the Linux boot sequence.
MMC: FSL_SDHC: 0, FSL_SDHC: 1
No panel detected: default to MCIMX28LCD
Display: MCIMX28LCD (800x480)
Video: 800x480x24
In: serial
Out: serial
Err: serial
switch to partitions #0, OK
mmc1(part 0) is current device
Net: FEC0
Warning: FEC0 MAC addresses don't match:
Address in SROM is 00:1f:7b:86:2e:3f
Address in environment is 00:1f:7b:aa:01:32
Normal Boot
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc1(part 0) is current device
switch to partitions #0, OK
mmc1(part 0) is current device
reading boot.scr
** Unable to read file boot.scr **
reading zImage
5726824 bytes read in 149 ms (36.7 MiB/s)
Booting from mmc ...
reading imx7d-pico_pi.dtb
44004 bytes read in 17 ms (2.5 MiB/s)
Kernel image # 0x80800000 [ 0x000000 - 0x576268 ]
## Flattened Device Tree blob at 83000000
Booting using the fdt blob at 0x83000000
Using Device Tree in place at 83000000, end 8300dbe3
Starting kernel ...
Booting Linux on physical CPU 0x0
Linux version 4.1.15-224683-gf3ba9d9 (tapani#triceratops) (gcc version 5.1.1 20150608 (Linaro GCC 5.1-2015.08) ) #4 SMP PREEMPT Tue Dec 20 17:50:41 HKT 2016

It looks like your board was not shipped with the fastboot bootloader necessary for Android Things, and instead has been pre-flashed with a Linux distro.
You will need to use the mfgtools package from NXP to re-flash your board with the proper bootloader to continue. The NXP Pico Quick Start Guide for Android Things describes where to get this tool (section 7.3) and how to use it to re-flash the bootloader with mfgtools (section 9.1).
After the bootloader has been updated, you should be able to follow the official flashing instructions to install Android Things using an image downloaded from the console.

Maybe try:
adb kill-server
It helped here Android Things - pico i.mx7 unable to connect

Related

Android emulator USB passthrough fails: " 'usb-host' is not a valid device model name"

When I try to use USB passthrough as described in https://androidstudio.googleblog.com/2020/08/emulator-30024-canary.html,
emulator -avd Pixel_3a_API_30_x86 -qemu -usb -device usb-host,vendorid=076B,productid=3821
I get the error message 'usb-host' is not a valid device model name. According to the Google link, USB passthrough should be supported from emulator version 30.0.24 and my emulator reports version 30.5.3.0 (build_id 7196367).
Has anyone succeeded in getting this to work?
No! Same with Android emulator version 30.5.4.0 (build_id 7243153).
If I look binary into the Linux version of the qemu emulator file,
I can still find the usb-host option. But it is totally left out
in the Windows Version.
So I guess Google must have switched the usb-host
support in Windows off.
Unfortunately the last Release Notes from the emulator is
from 30.4.5 (February 23, 2021)
Also I can't find any hint about this in the android-review AOSP
Don't know where else to look!?
[Update:]
I think I've found it, on the GitHub AOSP Mirror and android-review AOSP.
From Erwin Jansen committed on 3 Mar:
Revert "Enable usb host redirection for Windows"
# Libusb support on windows is not what we would like it to be
LIBUSB_FLAGS="--disable-libusb --disable-usb-redir"
It looks like the USB Pass Through Feature on Windows was just too buggy.
So, If one would get back to Version 30.5.2 (build_id 7175973) (Feb 27, 2021)
the usb-host will still be a valid device model name.
The DL was taking from a Canary Channel.
But it looks like Google is still working on it...
[Update 10.12.21]
Since Emulator Version 31.1.4 google implemented some new features and tools
to pass USB through.
I couldn't find the -list-usb parameter with emulator -help, but it works
if you run:
emulator -list-usb
VID:PID 058f:6387 (Bus 1, Port 5.1.1)
Manufacturer:
Product:
SerialNumber: 40A0FE0A
With this information, you can use the -usb-passthrough parameter
(-usb-passthrough vendorid=VID,productid=PID[,hostbus=BUS,hostport=PORT])
emulator -netdelay none -netspeed full -avd Pixel_4_API_31 -usb-passthrough vendorid=058f,productid=6387,hostbus=1,hostport=5.1.1
but it shows the error:
ERROR | Cannot load Android USB Assistant Driver for USB device "vendorid=058f". USB pass-through might not work.
Again a new tool Google added, with the prebuilt Windows drivers for USB passthrough one could try it again. Downloadable directly from the AOSP (tgz)
run as admin:
Install_Drivers.bat
Installing Android USB Assistant...
call Android_USB_Assistant_Install.bat
Microsoft PnP Utility
Processing inf : Android_USB_Assistant.inf
Successfully installed the driver.
Driver package added successfully.
Published name : oem89.inf
Total attempted: 1
Number successfully imported: 1
Installing Android Emulator USB Passthrough Assistance Driver
SERVICE_NAME: UsbAssist
TYPE : 1 KERNEL_DRIVER
STATE : 1 STOPPED
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
[SC] DeleteService SUCCESS
SERVICE_NAME: UsbAssist
TYPE : 1 KERNEL_DRIVER
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
PID : 0
FLAGS :
But trying it again, still shows the same error.
[Update 13.12.21]
Now it is working. The correct syntax is with the 0x and without
the usbhost and usbport keyword:
-usb-passthrough vendorid=0x058f,productid=0x6387
It still shows an error message:
qemu-system-x86_64.exe: libusb_kernel_driver_active: -12 [NOT_SUPPORTED]
And the Device is not recognized in the AVD,
but as soon as you root the AVD (Magisk Canary) with my script rootAVD from Github
with the parameters PATCHFSTAB GetUSBHPmodZ
rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-32\google_apis_playstore\x86_64\ramdisk.img PATCHFSTAB GetUSBHPmodZ
and install my usbhostpermissions.zip Magisk Module, an USB drive will
appear as Drive system-wide and an USB Serial Device can be accessed
through a USB Serial Terminal Apk. The APK USB Device Info will also
now show the connected USB Devices. I will update my XDA Guide asap
accordingly.
In order to pass more USB Devices through, just add another one behind the first i.e:
emulator -netdelay none -netspeed full -avd Pixel_4_API_32 -usb-passthrough vendorid=0x058f,productid=0x6387 -usb-passthrough vendorid=0x067b,productid=0x2303

Simpleperf cpu-cycles not supported in Android devices

I'm trying to make profiling with simpleperf in my Android ndk application but when I type simpleperf record command, the system reports this message:
simpleperf E 02-08 13:34:47 15380 15380 event_selection_set.cpp:68]
Event type 'cpu-cycles' is not supported by the kernel
I read this tutorial: https://android.googlesource.com/platform/system/extras/+/master/simpleperf/README.md
and I followed these steps:
Make android debuggable=true in the manifest.
adb shell setprop security.perf_harden 0
adb shell
shell#mako: run-as com.mysample.test
adb push bin/android/arm/simpleperf /data/local/tmp
shell#mako: cp /data/local/tmp/simpleperf .
shell#mako: ./simpleperf record -p 12083 --duration 30
Is that means that the nexus 4 cpu-cycles are not supported in the hardware or may i have not activated a specific security flag on the kernel?
I am using rooted nexus 4 device.
Ndk version 13b.
Android version: 5.1
Kernel version: 3.4.0-perf-gf75bb4f
pd: I tagged perf tag because of the similarity with perf.
Thanks in advance.
Unai.
Nexus 4 supports cpu-cycles event. I can't find the kernel version f75bb4f in git history, so I didn't test the same kernel. I have tested by flashing 5.1.1 (LMY48T) on nexus 4, using simpleperf in ndk-r13b, and it works. So I suspect the kernel you use disables perf events, and you can fix this by flashing a new image in https://developers.google.com/android/images#occam.

Can't send file to my phone with fastboot through ADB

I'm stuck in recovery mode cause I forgot to flash GAPPS on my LG G2 (D802) when I update from CM12 to CM12.1 ROM. My phone is now bootlooping.
As I can't use any external storage I'm trying to send GAPPS package to my phone with fastboot from my windows 7 PC.
But when I do adb devices I see my phone as unauthorized and I can't push files to it.
I have CWM 6.0.5.0 with PhilZ Touch 6.48.4 and touch GUI revision 1.30 and my ADB version is 1.0.32.
So, I wanted to know how to enable ADB on my device from the recovery mode or how to grant access to my device from the computer ? Or simply if there was another way to achieve this.
Thanks a lot.
I solved the problem in a other way with adb sideload.
To install flashable zip on your phone in recovery mode with CWM and ADB, follow these steps from the root of the main menu :
1 - Choose install zip
2 - Install zip from sideload
3 - Plug the phone to the computer
4 - Type `adb devices` in the windows command shell from the fastboot directory
5 - Phone should now be listed as "sideload"
6 - In the Windows command shell type `adb sideload <filename>`
7 - Wait while the file is send to your phone
8 - Once the transfer is complete the file is flashed automatically
9 - Once the flash is successful unplug your phone and restart it in normal mode
10 - You can **wipe cache and dalvik cache** to avoid errors
My phone is now able to run properly.
P.S: I don't get why this question get down votes at it was clear and concise + the answer was not that hard finally.

About flashing boot image of Android

I am not familiar with a Android kernel compile process.
But I encountered a problem recently, and it troubled me so much.
Here is the problem descrition:
Based on Android, I build customed images including boot.img, system.img and so on.
Then I need to flash those images to physical device in order to boot to Android Home Screen.
Before compiling those images files, I have set a new kernel command line:
CONFIG_CMDLINE="root=/dev/mtdblock2 rw init=/init console=ttyS0, 115200 mem=128M uard_dma android"
After compiling those images, I opened boot.img in vim and saw the following string in it:
"root=/dev/mtdblock2 rw init=/init console=ttyS0, 115200 mem=128M uard_dma android"
But when I flashed the boot.img into device, I got the different output like this:
**Kernel command line: console=ttyO2,115200n8 earlyprintk**
In other word, I set the kernel command line value, and it was wrote into boot.img, but when
flash boot.img into device, I got a different kernel command line value.
Has anybody ever encountered this problem and got it fixed?
Really appreciating your help.
Thanks advanced!
The bootloader will be passing a command line to the kernel.
For example if u-boot bootloader is used,
it will be contained in the u-boot variable bootargs
This can be verified at the bootloader prompt.
For example if the device is using u-boot bootloader.
Connect the device to your PC over a serial prompt.
Launch a serial emulator on your PC (minicom, teraterm, hyper-terminal).
Power-on the device.
Press any key to halt the device boot at the bootloader stage itself.
Now on the u-boot prompt enter the following command:
u-boot# printenv
This will list all the uboot-variables. Note the value of variable bootargs.
This can be modified by using the following command:
u-boot# setenv bootargs ''
To save this value across reboots use the following commmand:
u-boot# saveenv
Similar functionality is available in other bootloaders as well.

how do I insmod android SPI driver to running ubuntu PC

I am developing SPI driver on PC ubuntu, for my devkit8000 android.
I saw some example on how to build one.
But it seem like I can build my SPI driver and insmod it into the running kernel.
(here is the link)
http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=62
Current my understanding is point it to my ubuntu's "/lib/modules/..."
This part I managed.
But I am not able to "modprobe omap2_mcspi", which I think is a major component for my SPI driver for DevKit8000.
I hope someone can help me to verify is it true that I can insmod my SPI driver into the running kernel.
If that is possible, when I "make" which should I point to.
And how should I make modprobe appears.
I presume that you have cross-compiled your driver on your PC (x86 or x86_64 platform) for your Gumstix board (ARM Cortex- A8- platform) and that you have issued the modprobe command on the Gumstix board.
When you refer to your Ubuntu's /lib/modules, I presume that you mean an Ubuntu OS running on the Gumstix board (just to make sure that you don't try to insmod the module on the PC).
Now it is mandatory that the kernel version number of your module exactly matches the kernel version number of the kernel running on your Gumstix board (exactly means e.g. Linux 2.6.32-whatever-suffix-appended-here). If not, the kernel will reject your module.
Make sure that you have all modules installed the omap2_mcspi depends on.
If none of that was helpful, can you please post the error message the modprobe command throws?

Categories

Resources