update firmware via uart from android

Hi all,

I use nRF52832 connect a android device with uart, and I want to update firmware via uart.

I can update my nrf device success on pc for test with the help of your colleagues and this link.

But I have no idea how to do this on android device.

And if I don't want to use nrfutil do you guys have any other example for me to update the version?

Any help or suggestion is appreciated!

Best regards

Lurn

Parents Reply
  • Hi Vidar,

    First of all thanks for your reply.

    I used this cmd in the link you told me, and it does reduce the waiting time.

    nrfutil dfu usb-serial -pkg pkg.zip -p COM10 -b 115200 -t 5 -cd 0 -prn 0.

    The minimum timeout value I can set is 5, Although it can't be executed immediately but this time is perfectly acceptable for me.

    In this link: pc-nrfutil releases. I found three files  nrfutil-linux/nrfutil-mac/nrfutil.exe, I think these files should be packaged executable files and it can be run directly in a non-python environment.

    And I test the nrfutil.exe on my windows PC(delete the old nrfutil path), it can be run.

    So did you know how can I use the nrfutil-linux to update?

    if there is no other way, I have to try to implement my own DFU controller.

    By the way, Do you have any examples of implement the own DFU controller?

    Best regards,

    Lurn

Children
  • Hi Lurn,

    The pre-compiled executables are built to run on x86 on Linux. To get an executable compatible with Android and ARM(?) you will have to try make an executable yourself. But I am not sure if this is something that is possible, unfortunately. The readme explains how the executables can be created for PC/mac here: https://github.com/NordicSemiconductor/pc-nrfutil/tree/v6.0.0#running-and-installing-from-source.  

    Best regards,

    Vidar

  • Hi Vidar,

    Sorry for the late reply.

    I used the nrfutil-linux on my linux PC, I got something wrong and the logs is here

    ./nrfutil-linux dfu serial -pkg dfu_image_rx.zip -p /dev/ttyUSB0 -fc 0 -b 115200 -t 5 -cd 0 -prn 0
      [------------------------------------]    0%
      2023-04-06 11:03:58,728 No trigger interface found for device with serial number: A50285BI, Product ID: 0x6001 and Vendor ID: 0x403
    
    
    Traceback (most recent call last):
      File "nordicsemi/__main__.py", line 1555, in <module>
      File "click/core.py", line 1137, in __call__
      File "click/core.py", line 1062, in main
      File "click/core.py", line 1668, in invoke
      File "click/core.py", line 1668, in invoke
      File "click/core.py", line 1404, in invoke
      File "click/core.py", line 763, in invoke
      File "nordicsemi/__main__.py", line 1073, in serial
      File "nordicsemi/__main__.py", line 988, in do_serial
      File "nordicsemi/dfu/dfu.py", line 127, in dfu_send_images
      File "nordicsemi/dfu/dfu.py", line 88, in _dfu_send_image
      File "nordicsemi/dfu/dfu_transport_serial.py", line 214, in open
    pc_ble_driver_py.exceptions.NordicSemiException: No ping response after opening COM port
    [64515] Failed to execute script '__main__' due to unhandled exception!

    What is the problem with this error?

    And how can I get/set the application version?

    Is this code based on windows or linux or universal?

    If I need the source on linux, which branch should I choose?

    Best regards,

    Lurn

  • Hi Lum,

    The error indicates that there is a communication issue between the board and your PC. Are you sure /dev/ttyUSB0 is the correct port for your serial bridge? If not, can you try to disconnect the USB to see if the port is still listed?

    Thanks,

    Vidar

  • Hi Vidar,

    Yes, I'm sure that /dev/ttyUSB0 is the correct port. Because when I connect the USB the list only have one port. and I can use it to send data over uart.

    And how can I get/set the application version?

    Is this code based on windows or linux or universal?

    If I need the source on linux, which branch should I choose?

    Also, please help me with these problems.

    Best regads,

    Lurn

  • Hi Lurn, 

    Thanks for confirming. The other common reason for the error is when the target device is not in DFU mode. Do you have a way to confirm if the device is in DFU mode? 

    As for the version numbers, these are specified in the DFU package itself, see Generating DFU packages

    Best regards,

    Vidar

Related