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
  • Hi

    Can I use the nrfutil-linux in this link nrfutil releases on my andriod device.

    If I can use it how do i use it?

    And when I update on PC, use this cmd to update, it will stay here for almost 30 seconds before upgrading. Is this normal?

    nrfutil dfu serial -pkg XXX.zip -p COM3 -fc 0 -b 115200

    Best regards

    Lurn

  • Hi Lurn,

    I am not sure if it is possible to run Python scripts on Android? If it is, then you could try run the script directly as explained here: https://github.com/NordicSemiconductor/pc-nrfutil/tree/v6.0.0#running-from-source. Another alternative is to implement your own DFU controller following the protocol specification from the SDK documentation here: DFU protocol

    Lurn_Z said:
    nrfutil dfu serial -pkg XXX.zip -p COM3 -fc 0 -b 115200

    Maybe you are seeing the issue discussed here:  nrfutil takes 34 seconds before starting dfu  ?

    Best regards,

    Vidar

  • 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

  • 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

Reply Children
Related