technexion-android / manifest

1 stars 5 forks source link

Reg. Flashing Android Image on imx7-pico-pi #3

Closed amsurana closed 5 years ago

amsurana commented 5 years ago

Hi,

I download the repo https://github.com/technexion-android/manifest/tree/tn-o8.0.0_1.0.0-ga and synced AOSP source code.

Can you please provide me right steps to flash the Android images on imx7 Pico PI board from TechNexion ?

After building the code for PicoPI - userdebug using "Lunch" and "Make" command, I am unable to figure out how to flash the Images to eMMC ?

Is there any documentation to:

  1. Create a Prebuilt installer IMG file containing all the system.img, recovery.img, boot.img, cache.img, vendor.img, etc. I can then flash via Serial Mode. But there's not such documentation.
  2. I flashed using flashcard program, but it seems I am stuck at a different issue below.

Importing environment from mmc ...
baseboard is pi
Error: "m4boot" not defined
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0(part 0) is current device
reading uEnv.txt
544 bytes read in 23 ms (22.5 KiB/s)
Loaded environment from uEnv.txt
Importing environment from mmc ...
reading zImage
9707456 bytes read in 313 ms (29.6 MiB/s)
reading imx7d-pico_pi.dtb
44582 bytes read in 22 ms (1.9 MiB/s)
reading uramdisk.img
Unable to read file uramdisk.img
boota mmc0
boota: bad boot image magic

Regards, Amit S

wigcheng commented 5 years ago

Do you try this instruction before? https://github.com/technexion-android/cookers/tree/tn-o8.0.0_1.0.0-ga

amsurana commented 5 years ago

Hi, Yes. I tried that. Please check out the flashing logs. I noticed that the AOSP code doesn't generate uramdisk.img. Not sure if it's relevant for Android. imx7_install_logs.txt

wigcheng commented 5 years ago

Seems you type the flashcard command with wrong place, it must be in the root folder of source code. Another way, generate the uramdisk.img manually: sudo mkimage -A arm -O linux -T ramdisk -C none -a 0x83800000 -n "Android Root Filesystem" -d ./out/target/product/pico_7d/ramdisk.img ./out/target/product/pico_7d/uramdisk.img then try again.

Thanks

amsurana commented 5 years ago

Great. This instruction helped. I did it manually and things worked as mentioned in the README file.

Is it possible to update the README file with instructions to prepare the IMG file that can be flashed using the installer ftp://ftp.technexion.net/development_resources/development_tools/installer/

Thank you!

wigcheng commented 5 years ago

We will update it on new installer in the future, thanks.

veerpawan commented 3 years ago

Hi, I tried to download the Technexion Android 8 SDK for i.MX6/i.MX7 Platforms by using repo tool but not able to download. May I know what is the minimum internet speed to download the source code?

wigcheng commented 3 years ago

Could you post your error message here? I think should be missing some repos because google sometimes could change/remove their repo.

wigcheng commented 3 years ago

Just tried and it works fine, please check your network on your side, thanks!

veerpawan commented 3 years ago

Hi. Successfully download the build using fast internet speed. Could you please provide the way to flash images on TechNexion Board? Gone through this link https://github.com/technexion-android/cookers/tree/tn-p9.0.0_2.0.1_8m-ga#technexion-android-9-sdk-for-imx8-platforms but bit confusing about UUU tool.

wigcheng commented 3 years ago

So which platform did you use, IMX6/IMX7 or IMX8? They're different flash ways..

veerpawan commented 3 years ago

IMX8 PICO MINI... Want to flash Android image.

wigcheng commented 3 years ago

Do you download demo image before? it has uuu tool inside the zip file with instruction. After installed uuu tool, then you can flash image manually or adapt lazy way: $ uuu_flashcard 7

Must be install uuu tool first.

veerpawan commented 3 years ago

Successfully download the UUU tool. can you please let me know where to put UUU tool and then how to flash the image. I am completely newby in TechNexion.

**Then install uuu to different environment:

Refer Q&A item 3 of Chapter 5 on User Manual**

Follow this step but not able to knwo how to install in differenet environement?

This is my directory of output image.

/home/chetu/TechNexionNew/out/target/product/pico_imx8mm

TannerDBlack commented 3 years ago

Pawan hopefully this will answer your questions https://github.com/TechNexion/u-boot-edm/wiki/Use-mfgtool-%22uuu%22-to-flash-eMMC

veerpawan commented 3 years ago

Getting this error

This script is validated with uuu 1.2.91 version, please align with this version. dtbo is supported dual slot is supported generate lines to flash partition-table-13GB.img to the partition of gpt generate lines to flash u-boot-imx8mm.imx to the partition of bootloader0 generate lines to flash dtbo-imx8mm.img to the partition of dtbo_a generate lines to flash boot.img to the partition of boot_a generate lines to flash system.img to the partition of system_a generate lines to flash vendor.img to the partition of vendor_a generate lines to flash vbmeta-imx8mm.img to the partition of vbmeta_a generate lines to flash dtbo-imx8mm.img to the partition of dtbo_b generate lines to flash boot.img to the partition of boot_b generate lines to flash system.img to the partition of system_b generate lines to flash vendor.img to the partition of vendor_b generate lines to flash vbmeta-imx8mm.img to the partition of vbmeta_b uuu script generated, start to invoke uuu with the generated uuu script ./uuu_imx_android_flash.sh: line 524: uuu: command not found root@chetuiwk2066:/home/chetu/TechNexionNew/out/target/product/pico_imx8mm#

wigcheng commented 3 years ago

Did you copy your downloaded 'uuu' binary into /usr/bin or /bin? It seems not yet...

veerpawan commented 3 years ago

By using the below commands successfully able to flash Android image. • $ sudo su • chmod +x uuu • chmod +x uuu_imx_android_flash.sh • sudo ./uuu_imx_android_flash.sh -f imx8mm -e • sudo su • ./uuu /tmp/uuu.lst

Now trying to setup the WIFI and Bluetooth driver in next step but not able to locate /device/fsl/pico_8m/wifi-firmware/ wifi-firmware folder.

tannermlx commented 3 years ago

Pawan, contact sales@technexion.com, they cannot distribute the 9377 drivers with AOSP due to licensing. But they will send them to you.

veerpawan commented 3 years ago

I already get the drivers from TechNexion sales Team but not able to find any folder name "wifi-firmware" In AOSP current directory I have is sourcefolder/device/fsl/imx8m.

As readme file mentioned---- After getting the firmware binary: .. Decompress the tarball and put all the firmware files into

/device/fsl/pico_8m/wifi-firmware/

tannermlx commented 3 years ago

You make the folder.

veerpawan commented 3 years ago

Make the folder and placed files provided by the TechNexion sales team and then again create build and flash on the board. Still not able to use WIF and Bluetooth.

tannermlx commented 3 years ago

Two lines above in the readme: This SDK is supporting Qualcomm(QCA) WLAN module - QCA9377 as default configuration, Because of the license restriction, please contact TechNexion FAE or Sales to get licensed firmware files, default is disabled.

You need to enable it in the build config for your board. There will be a commented out line in the config.

veerpawan commented 3 years ago

Where I can find the config file?

wigcheng commented 3 years ago

Could you show me what's your firmware files inside zip?

veerpawan commented 3 years ago

These are folders qca, qca6174, qca9377, wlan.

wigcheng commented 3 years ago

What's content inside the qca9377 folder?

veerpawan commented 3 years ago

bdwlan30.bin
CadenceLicense.txt Notice.txt otp30.bin qwlan30.bin utf30.bin

veerpawan commented 3 years ago

My current directory is home/chetu/TechNexionNew/device/fsl/pico_8m/ all folders od WIF qca, qca6174, qca9377, wlan.

wigcheng commented 3 years ago

$ mkdir -p /device/fsl/imx8m/pico_imx8mm/wifi-firmware/QCA9377 $ cp -rv /qca9377/ /device/fsl/imx8m/pico_imx8mm/wifi-firmware/QCA9377/ $ cp -rv /wlan /device/fsl/imx8m/pico_imx8mm/wifi-firmware/QCA9377/ $ cp -rv /qca/ /device/fsl/imx8m/pico_imx8mm/bluetooth/

Then re-compile again, should be works.

veerpawan commented 3 years ago

Bluetooth is working but WIFI still not working.

Do We Need to uncomment any config file?

Wi-Fi MAC Address 02:00:00:00:00:00

Bluetooth address a valid number

veerpawan commented 3 years ago

Hi, Could you please let me know the steps to enable WiFi?

veerpawan commented 3 years ago

Wi-Fi and Bluetooth working fine on the demo image but not working on the created new build of Android 9.

patusaembedded commented 2 years ago

@wigcheng

Hi,

I need build android 8 to my imx7d-pico, becuase I need RPMsg in my device (kernel 4.9.x)

I have issues.

e.g.: I flashed a ready-made technexion image from android 8 (using balenaEtcher) as well as i had the android things, but i need to prepare the RPMsg in the kernel first and then play the image in imx7d-pico

The commands I'm using and getting an error are as follows:

mkdir Android6 cd Android6 repo init -u https://github.com/technexion-android/manifest -b tn-o8.0.0_1.0.0-ga repo sync -j4 cd cookers docker build -t build_droid8 . sudo docker run --privileged=true --name mx8_build -v /home/neuberfran/Android6:/home/mnt -t -i build_droid8 bash sud docker ps -a sudo docker rm -v mx8_build sudo docker run --privileged=true --name mx8_build -v /home/neuberfran/Android6:/home/mnt -t -i build_droid8 bash (this command jumpe me to part 06)

But in home/neuberfran/Android6 I continue with this commands: sudo docker ps -a sudo docker start mx8_build sudo docker exec -it mx8_build bash

part 06 in root, because this command: sudo docker run --privileged=true --name mx8_build -v /home/neuberfran/Android6:/home/mnt -t -i build_droid8 bash this command jumpe me to / (directory root) of the container

I don't know why, I go to / in root mode

cd /home/mnt

source cookers/env.bash.imx7.pico.pi.lcd merge_restricted_extras cook -j4

cd /home/mnt/out/target/product/pico_7d flashcard /dev/sdd

Some of the errors I'm getting are?

mkimage: Can't open ./out/target/product/pico_7d/ramdisk.img: No such file or directory == download the system == dd: failed to open '/home/mnt/out/target/product/pico_7d/system_raw.img': No such file or directory == download the vendor == dd: failed to open '/home/mnt/out/target/product/pico_7d/vendor_raw.img': No such file or directory == download the recovery == dd: failed to open '/home/mnt/out/target/product/pico_7d/recovery.img': No such file or directory

Captura de tela de 2021-12-13 00-01-35

wigcheng commented 2 years ago

It seems you running flash image command in docker container, container cannot connect with outside physical storage such as eMMC or uSD card ( need additional tweaking).

So please issue flash command on host OS side, should be works, thanks.

patusaembedded commented 2 years ago

@wigcheng The command sudo docker run --privileged=true --name mx8_build -v /home/neuberfran/Android6:/home/mnt -t -i build_droid8 bash is correct? What is its function within this sequence of commands? Is it necessary? (from what you said in the answer above, such a command is not necessary as it is automatically throwing me to the root user and / (root) folder of the container.

wigcheng commented 2 years ago

Yes, if you choose docker container way, the stages as follows: Compile stage is in docker container. Flash image stage is back to in host PC side.

Sorry the instruction is not clearly ( default is assume the customers compile and flash image both on the host PC side)

patusaembedded commented 2 years ago

@wigcheng I don't have flashcard (or sudo flashcard) command in nowhere from the Android6 folder (which is where I threw the project)

Captura de tela de 2021-12-13 23-23-37

wigcheng commented 2 years ago

??? I thought your target OS is Android 8 as your above mention, isn't it? Android 6 does not support anymore here, thanks.

patusaembedded commented 2 years ago

@wigcheng Yes. it is android 8. Only the folder name is Android6

patusaembedded commented 2 years ago

@wigcheng Pls. tell me Where I will find flashcard command?

wigcheng commented 2 years ago

No flashcard?, it's impossible, did you source the cookers on host PC side first? $ cd (source folder) $ source cookers/env.bash.imx7d.pico-imx7.pi.lcd-5-inch $ flashcard /dev/sdx 3 sdx means your device node of eMMC mounted storage, 3 means the image size what you want (3GB).

It will auto search out folder and copy the relate match images to your eMMC. That's it.

patusaembedded commented 2 years ago

@wigcheng Sorry I forgot source cookers/env.bash.imx7.pico.pi.lcd. Because I restart PC after lunch. Now I have flashcard. Please, What about merge_restricted_extras command? What it's function?

What's difference between cook and heat ?

patusaembedded commented 2 years ago

@wigcheng No ftp is working here:

ftp://ftp.technexion.net/demo_software/

ftp://ftp.technexion.net/demo_software/PICO/IMX7/pico-imx7-emmc/Installer/pico-imx7_pico-nymph_ubuntu-16.04_installer_vga-640x480_20180313.zip

ftp://ftp.technexion.net/development_resources/development_tools/installer/

wigcheng commented 2 years ago

cook -> build all source code with rewrite defconfig throw && cook -> clean build heat -> re-build build all source code merge_restricted_extras -> install NXP extra libraries

New download link: https://download.technexion.com/

patusaembedded commented 2 years ago

Not Solved yet Captura de tela de 2022-01-07 18-57-49

patusaembedded commented 2 years ago

@wigcheng I need to do changes in kernel. But I have issues: steps: 1) make menuconfig in home/user/ndroid_build/vendor/nxp-opensource/kernel_imx 1.1) include RPMsg 2) heat -j8 in home/user/ndroid_build issue7

wigcheng commented 2 years ago

..........

I suggest you can study what's difference between Linux Kernel environment and Android Kernel environment, I cannot answer you for these kind of rookie questions one by one, sorry, hope you understand. This place is for technical issue report, not a school.

I can give you a way: In Android, all kernel output files include config file are in the path as follows: ( source )/out/target/product/pico_imx7d/obj/KERNEL_OBJ/, you should compile manually there.

Thanks

patusaembedded commented 2 years ago

@wigcheng I stay trying include imx_rpmsg_tty (module/driver) in my AOSP 8 project using this site (https://android.serverbox.ch/?p=1738&cpage=1#comment-329470) just as a command reference (except: repo init, repo sync ,merge_restricted_extras and flashcard.

I got compilation success, but in pico_7d the modules folder in /lib doesn't appear. Only the firmware folder. What is missing in my commands? Regarding the photo below (heat command and modules_install), how to include this in the link mentioned above in this post? Captura de tela de 2022-01-11 23-45-09

wigcheng commented 2 years ago

Refer Android 9 BoardConfig makefile setting for kernel module https://github.com/technexion-android/platform_device_fsl/blob/tn-p9.0.0_2.2.0-ga/imx7d/pico_imx7/BoardConfig.mk#L45

In Android , all kernel modules need assign manually in Makefile.

Don't refer Android 8's Makefile, it's dirty way, of course not made by me :)

patusaembedded commented 2 years ago

@wigcheng Can you directly enable imx_rpmsg_tty, imx_rpmsg_pingpong and virtio modules directly in technexion Android 9 original (in github) or not? (To make my job easier)