Inference error and firmware update error for KL720

Running in our VM with Ubuntu 18.04.

I've updated firmware successfully before, but I met inference error for the demo cases after a few days.

=========================

#Command1 (without sudo)

 python3 KL720DemoGenericInferencePostYolo.py --port_id 7

#Result1

[Connect Device]

Error: connect device fail, port ID = '7', error msg: [Error raised in function: connect_devices. Error code: 28. Description: ApiReturnCode.KP_ERROR_CONNECT_FAILED_28]

Segmentation fault (core dumped)

==========================

#Command2 (with sudo)

sudo python3 KL720DemoGenericInferencePostYolo.py --port_id 7

#Result2

[Connect Device]

 - Success

[Set Device Timeout]

 - Success

[Upload Model]

Error: upload model failed, error = 'Error raised in function: load_model_from_file. Error code: 17. Description: ApiReturnCode.KP_ERROR_RECV_DATA_FAIL_17'

=============================


Moreover, I also fail to update firmware after rebooting.

The command is as below.

sudo ./KneronDFUT --kl720-update --port 7 --scpu ../../kneron_plus/res/firmware/KL720/fw_scpu.bin --ncpu ../../kneron_plus/res/firmware/KL720/fw_ncpu.bin

The ERROR code is as below.

==== Update Firmware to Device with Port Id: 7 Failed with Error Code: -1 ====


Does anyone meet the same issues?

Thanks!

Comments

  • Is your KL720 connecting to your PC with port 7?

    Or maybe you can try to execute without port parameter like " python3 KL720DemoGenericInferencePostYolo.py" instead of " python3 KL720DemoGenericInferencePostYolo.py --port_id 7".

    By the way, if you run the KL720 without administrator permission, it would fail because of lacking usb accessing permission. Please refer to the following steps to make sure the KL720 has enough authority to access usb.


  • Hi, thanks for the reply.

    My device is connecting with port 7. Below is the info when I execute "sudo ./KneronDFUT --list".

    ===========================================

    Index: 1

    Port Id: 7

    Kn Number: 0x3D061B4C

    Device Type: KL720

    FW Type: KDP2 Comp / F

    Usb Speed: Super-Speed

    Connectable: true

    ===========================================


    I try to execute "python3 KL720DemoGenericInferencePostYolo.py" , but it does not work.

    The error is as below.

    [Connect Device]

     - Success

    [Set Device Timeout]

     - Success

    [Upload Model]

    Error: upload model failed, error = 'Error raised in function: load_model_from_file. Error code: 17. Description: ApiReturnCode.KP_ERROR_RECV_DATA_FAIL_17'

    Not sure where does the problem come from.

    Thanks!

  • Error: upload model failed, error = 'Error raised in function: load_model_from_file. Error code: 17. Description: ApiReturnCode.KP_ERROR_RECV_DATA_FAIL_17'

    About this step, there are 2 part about it

    1. Load your NEF model to buffer, please check the model you using is valid the directory is correct.
    2. Send the data of model from PC to KL720. Please make sure the KL720 is well connect to PC with enough authority to access USB.

    To set the authority of usb for KL720, please refer to the following link to get the instruct.


  • Hi, I checked again for the above steps,

    1. Model path is correct, and I failed to load either by absolute path nor by relative path.
    2. Kneron AI device usb permission is also updated as the instruction.

    Is there any other solution?

    Thanks!

  • Because you are using on VM, please check whether the KL720 reconnect to PC after reset process. ( The OS will reset usb device with some commands in processing.)

    And did you still encounter firmware updating issue after adding permission setting?

    To clarify the firmware status, please help to print the following message out.

    print(kp.core.get_version())
    print(kp.core.get_system_info(device_group=device_group, usb_port_id=7))
    


  • Hi, thanks for the reply!

    Yes, I still encounter firmware updating issue after adding permission setting and the message I got is shown below.

    ###

    Downgrade firmware to earlier version is not acceptable after update.

    Do you want to proceed? (y/n) 

    y

    Start Update Firmware to Device with Port Id 7

    ==== Update Firmware to Device with Port Id: 7 Failed with Error Code: -1 ====

    ###


    I can not get the system info, either.

    The message show below.

    ###

    >>> device_group = kp.core.connect_devices(usb_port_ids=[7])

    >>> print(kp.core.get_version())

    1.3.0

    >>> print(kp.core.get_system_info(device_group=device_group, usb_port_id=7))

    Traceback (most recent call last):

     File "<stdin>", line 1, in <module>

     File "/home/linker/miniconda3/lib/python3.9/site-packages/kp/KPCore.py", line 466, in get_system_info

      _check_api_return_code(result=system_info,

     File "/home/linker/miniconda3/lib/python3.9/site-packages/kp/KPException.py", line 42, in _check_api_return_code

      raise ApiKPException(

    kp.KPException.ApiKPException: Error raised in function: get_system_info. Error code: 14. Description: ApiReturnCode.KP_ERROR_SEND_DATA_FAIL_14

    ###

  • Hello,

    Are you using DFUT tool built by Kneron? (Kneron_DFUT_ubuntu_1.3.0.zip) Or are you using the tool built by your self? (inside PLUS v1.3.0)

    Or maybe you can tried to update firmware(/kneron_plus_v1.3.0/res/firmware/KL720) in Windows with our win version tool. (Kneron_DFUT_windows_1.3.0.zip)

    https://www.kneron.com/tw/support/developers/

  • Hi, thanks for the reply.

    We used the DFUT tool from Kneron_DFUT_ubuntu_1.3.0.zip. GUI update and command update are not working.

  • Have you tried to update firmware on windows instead of ubuntu on VM. Or neither on ubuntu nor windows couldn't work well?

    During flash is programming, the system would reset KL720 and reconnect the usb between KL720 and PC. Sometime user encounters similar error because usb setting on VM is not match to the usage. That's why we recommend you to try to run on native Windows instead of VM.

  • Hi, thanks for the reply.

    We first tested the VM with windows system, but fail.

    Then, we ran with laptop with windows, and it seems to work now.

The discussion has been closed due to inactivity. To continue with the topic, please feel free to post a new discussion.