VIMs Ubuntu 20.04 V1.0.9-211217 OTA Release

Here we release new Ubuntu OTA update v1.0.9-211217 for VIMs

Change logs

Vendor u-boot(2015.01) && linux (4.9)

  • VIM1/VIM2

    • none
  • VIM3/VIM3L

    • fix i2s for VIM3L
    • improve ssh keys
    • fix wol
    • add more overlays
    • add ext borad support
    • update npu package to version 6.4.6.2
    • bug fixup

Mainline

  • VIM1/VIM2/VIM3/VIM3L

    • update to version 5.16-rc2
    • add npu support for VIM3/VIM3L
    • fix PCIe driver to support B+M key Coral for VIM3/VIM3L

Upgrade guidance

Base on image V0.9-20200530.

About Coral

Currently only the mainline firmware supports the use of coral.

If you encounter this error when installing the gasket-dkms package:

Setting up dkms (2.8.1-5ubuntu2) ...
Setting up gasket-dkms (1.0-17) ...
Loading new gasket-1.0 DKMS files...
Building for 5.16.0-rc2
Building initial module for 5.16.0-rc2
Error! Bad return status for module build on kernel: 5.16.0-rc2 (aarch64)
Consult /var/lib/dkms/gasket/1.0/build/make.log for more information.
dpkg: error processing package gasket-dkms (--configure):
 installed gasket-dkms package post-installation script subprocess returned error exit status 10

You can use our recompiled debian package.

$ wget https://github.com/yan-wyb/gasket-dkms-deb/raw/master/gasket-dkms_1.0-17_all.deb
$ sudo dpkg -i gasket-dkms_1.0-17_all.deb

About NPU

1. NPU version updated to 6.4.6.2.

If you want to use our demo on the latest version, please update all repositories to the latest version.

2. KSNN version update to v1.2.

  • Add RTSP Web Camera Demo for Yolo series
  • Fix naming bug
  • TODO LIST
    • handpose demo
    • Optimize printing information, add json format option
    • Optimize SSD post-processing
    • Pedestrian detection demo

3. About amlogic nn api

We will no longer maintain the repository.About pedestrian detection, we will re-implement it on ksnn.

If you need to use our demo to test the latest driver and our newly added demo, please refer to the latest documents.

3 Likes

Hi,
I have flashed new image and could succesfully install Coral TPU on Khadas VIM3 at M.2 port. But when running the demo app of Coral I get following error:

khadas@Khadas:~/coral/pycoral$ sudo python3 examples/classify_image.py --model test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite --labels test_data/inat_bird_labels.txt --input test_data/parrot.jpg
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py”, line 160, in load_delegate
delegate = Delegate(library, options)
File “/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py”, line 119, in init
raise ValueError(capture.message)
ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “examples/classify_image.py”, line 121, in
main()
File “examples/classify_image.py”, line 71, in main
interpreter = make_interpreter(*args.model.split(’@’))
File “/usr/lib/python3/dist-packages/pycoral/utils/edgetpu.py”, line 87, in make_interpreter
delegates = [load_edgetpu_delegate({‘device’: device} if device else {})]
File “/usr/lib/python3/dist-packages/pycoral/utils/edgetpu.py”, line 52, in load_edgetpu_delegate
return tflite.load_delegate(_EDGETPU_SHARED_LIB, options or {})
File “/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py”, line 162, in load_delegate
raise ValueError(‘Failed to load delegate from {}\n{}’.format(
ValueError: Failed to load delegate from libedgetpu.so.1

Could you please help me out?

@ms_de Which one image you used ?

VIM3_Ubuntu-gnome-focal_Linux-4.9_arm64_EMMC_V1.0.9-211217.img

And Boot VIM3.uboot-mainline.emmc.aml

@ms_de Just mainline kernel can use coral

what do you mean by “mainline kernel”? What should I do?

I found the mainline kernel images here: Khadas VIM3 Ubuntu Firmware | Khadas Documentation

But is it correct, we cannot install these images on emmc?

@ms_de You can install it to usb or sd card . then after the system boot, you can run this command sudo emmc-install to install your system to emmc

ok great, thank you!

@ms_de If you use mainline firmware. Don’t forget this

1 Like

thanx I did it, and it has installed dkms.

But I cannot see any device when giving command lspci -nn | grep 089a

I want to check if PCIE is enabled, but the app for switch USB3 - PCIE is not running on the desktop. And the command cat /sys/class/mcu/usb_pcie_switch_mode not running because folder mcu is not there.

Do you have another idea?

BTW, I see that my USB Keyboard is not detected correctly when I boot, I need to replug the USB dongle then it works…

1 Like

@ms_de You can use kbi command in uboot to switch to USB3.0

I need to have serial connection?

@ms_de Yes. If you don’t have a serial tool. you can try krescue.

ok thank you, let me try both ways.

I have checked via Serial, the PCIE is already activated. I activated again and rebooted. But the PCIE is still not recognized. very strange.

Before when I was working on the other image VIM3_Ubuntu-gnome-focal_Linux-4.9_arm64_EMMC_V1.0.9-211217.img then I could see the PCIE device, so the device should be not broken or so. Do you have any idea?

I have run this:

khadas@Khadas:~$ sudo lspci -vv
00:00.0 PCI bridge: Synopsys, Inc. DWC_usb3 / PCIe bridge (rev 01) (prog-if 00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 40
Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
I/O behind bridge: [disabled]
Memory behind bridge: [disabled]
Prefetchable memory behind bridge: [disabled]
Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
Expansion ROM at fc700000 [virtual] [disabled] [size=64K]
BridgeCtl: Parity- SERR+ NoISA- VGA- VGA16- MAbort- >Reset- FastB2B-
PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
Capabilities: [40] Power Management version 3
Flags: PMEClk- DSI- D1+ D2- AuxCurrent=375mA PME(D0+,D1+,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 0000000004679508 Data: 0000
Capabilities: [70] Express (v2) Root Port (Slot-), MSI 00
DevCap: MaxPayload 256 bytes, PhantFunc 0
ExtTag- RBE+
DevCtl: CorrErr+ NonFatalErr+ FatalErr+ UnsupReq+
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 256 bytes, MaxReadReq 256 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #0, Speed 5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <1us, L1 <2us
ClockPM- Surprise- LLActRep+ BwNot+ ASPMOptComp+
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s (ok), Width x1 (ok)
TrErr- Train- SlotClk+ DLActive+ BWMgmt- ABWMgmt-
RootCap: CRSVisible+
RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna+ CRSVisible+
RootSta: PME ReqID 0000, PMEStatus- PMEPending-
DevCap2: Completion Timeout: Range ABCD, TimeoutDis+, NROPrPrP+, LTR-
10BitTagComp-, 10BitTagReq-, OBFF Not Supported, ExtFmt-, EETLPPrefix-
EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
FRS-, LN System CLS Not Supported, TPHComp-, ExtTPHComp-, ARIFwd-
AtomicOpsCap: Routing- 32bit- 64bit- 128bitCAS-
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled ARIFwd-
AtomicOpsCtl: ReqEn- EgressBlck-
LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete-, EqualizationPhase1-
EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
Capabilities: [100 v2] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
AERCap: First Error Pointer: 00, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn-
MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
HeaderLog: 00000000 00000000 00000000 00000000
RootCmd: CERptEn+ NFERptEn+ FERptEn+
RootSta: CERcvd- MultCERcvd- UERcvd- MultUERcvd-
FirstFatal- NonFatalMsg- FatalMsg- IntMsg 0
ErrorSrc: ERR_COR: 0000 ERR_FATAL/NONFATAL: 0000
Capabilities: [148 v1] L1 PM Substates
L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2- ASPM_L1.1+ L1_PM_Substates+
PortCommonModeRestoreTime=55us PortTPowerOnTime=12us
L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2- ASPM_L1.1-
T_CommonMode=55us
L1SubCtl2: T_PwrOn=10us
Kernel driver in use: pcieport

I found similar issue at this forum: Google Coral M.2 at mini PCIe not detected · Issue #334 · google-coral/edgetpu · GitHub

Maybe our issue is related to BIOS also?

I have checked this, seems that pcie driver is not loaded:
khadas@Khadas:~$ ls /dev/apex_0
ls: cannot access ‘/dev/apex_0’: No such file or directory

Just FYI I have installed OS to Emmc but same issue.

@ms_de Did you use the least release firmware ?

http://dl.khadas.com/Firmware/VIM3/Ubuntu/SD_USB/VIM3_Ubuntu-gnome-focal_Linux-5.16-rc2_arm64_SD-USB_V1.0.9-211217.img.xz

yes exactly the same firmware

we use the M.2 slot for PCIE, maybe that is the issue? The USB version of Coral is working.

@ms_de I will check it later