This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[DFU] Opening file failed : Application file not found. On NRF connect smartphone, ZIP file is not found while it is present.

Hello,

A few weeks ago I created a bootloader project from the Nordic documentation:
devzone.nordicsemi.com/.../getting-started-with-nordics-secure-dfu-bootloader

I installed the NRF connect app on smartphone (android 7.0) and it worked fine.
Using the NRF util tool, I generated a ZIP file from an application (hex).

By clicking on the "DFU" icon, I could update the application via the smartphone (it run a graph with file transfer).

I had succeeded in implementing the DFU, the application and the zip package.



Now, I am retesting all the functionalities with a new application I made. So I regenerated a new ZIP file with exactly the same procedure (same key, same PC, same tools, same paths, same smartphone ...). For test, I just program softdevice (v2.0.1 --> S130) and DFU hex with nrf connect (project with SDK 12.3.0, then the last of NRF51). So, DFU is waiting for a valid application. I connect to card with smartphone. Connexion is OK.

After that, I have an error on the smartphone when I try to open the ZIP file, it tells me that the file is not found.
When I go to the smartphone folder, the ZIP file is there and with the right content.



On the card side, it is an NRF51822 (the same like previous working few weeks ago, it hasn't changed). I currently have a Jlink connected and the log indicates that the software is started. Besides, I can connect with NRF connect.

I tried with another smartphone in version 9.0, I have the exact same problem.
While looking on the forum, I saw that there was possibly that it could be the native file manager, I installed 3 different utilities without success (file manger, total commander). Problem is the same. I have the same error.

Please see attached log of smartphone and screenshot of file/folder.

I extract zip fil to verify integrity, it's OK, .bin is correct.

I don't understand what the problem is. Have you an idea ?

Regards,

Cedric M

nRF Connect, 2020-09-14
DFU RTS HA1 (F1:A2:A0:C9:8D:D2)
V	11:08:49.164	Connecting to F1:A2:A0:C9:8D:D2...
D	11:08:49.165	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE)
D	11:08:49.575	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
D	11:08:49.601	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I	11:08:49.601	Connected to F1:A2:A0:C9:8D:D2
V	11:08:49.648	Discovering services...
D	11:08:49.648	gatt.discoverServices()
D	11:08:50.378	[Callback] Services discovered with status: 0
I	11:08:50.378	Services discovered
V	11:08:50.413	Generic Access (0x1800)
- Device Name [R W] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
Generic Attribute (0x1801)
Secure DFU Service (0xFE59)
- Unknown Characteristic [WNR] (fa5e0002-97c2-4a92-abb4-c7dcffff320d)
- Unknown Characteristic [N W] (fa5e0001-97c2-4a92-abb4-c7dcffff320d)
   Client Characteristic Configuration (0x2902)
D	11:08:50.414	gatt.setCharacteristicNotification(fa5e0001-97c2-4a92-abb4-c7dcffff320d, true)
V	11:09:04.640	[DFU] DFU service started
V	11:09:04.641	[DFU] Opening file...
E	11:09:04.677	[DFU] Opening file failed: Application file Periphs_nrf51822_xxaa.bin  not found.

Parents
  • Hello,

    - First, I start nrf connect (on android) and power on the board with SD and DFU

    - in scanner tab, my board appear and I connect to them

    - the DFU button appear

    - I push button and a menu appear to "select file type", I choose "Distribution packet (zip)"

    - I select the zip file and click "open"

    - I have the log file that tell : "[DFU] Opening file failed........."

    See attached zip file.

    Regards,

    Cedric

    app_dfu_package_Periphs.zip

  • If you open the manifest.zip file inside, you can see that the file names contain a space at the end.  Check if your script does not contain any spaces there, you may also try to removing the spaces manually and replace the manifest.json file with the modified one.

    {
        "manifest": {
            "application": {
                "bin_file": "Periphs_nrf51822_xxaa.bin ",
                "dat_file": "Periphs_nrf51822_xxaa.dat "
            }
        }
    }
    

  • Hello,

    Yes indeed there is a space after .bin and .dat in .json file (I had indeed not seen it), but the files do not have spaces, it is very surprising.
    I manually deleted the spaces and re-zip.


    It doesn't work any better, but the file opening error is gone.
    I therefore have 2 questions:
    - where does this space come from because the script only has the .hex and the .zip as input (and there is no space), the .bin and .dat are not managed by me (but directly by nrf_util)?
    - even if I remove the space, the download does not start, what can happen? In the log, the message is "[DFU] wait(600)"

    Regards,

  • Hello

    For the "space" caracter added to file name, I think I find the reason.

    I run batch script on windows. I write batch with parameters like path of hex file (because I have several hex to manage). In my batch, I verify each command by an echo, and all is right.

    Then, these parameter have a native "invisible" space on variable (find in forum cmd / batch), but when use by windows, the "space" is automatically removed, then I not see it (ex with echo).

    However, if the variable is passed to nrf_util, the space is conserved because it is a python script and not a windows management. I supposed the file extension (hex) is replaced (into python script) by BIN and DAT extension and the extra space is keeped.

    So,

    - in .json file, there is space because it is generated by python script

    - in windows file system, the space is automatically removed ! (I test it by adding manually space, it is not possible, windows remove it immediately).

    Regards

    Cedric

Reply
  • Hello

    For the "space" caracter added to file name, I think I find the reason.

    I run batch script on windows. I write batch with parameters like path of hex file (because I have several hex to manage). In my batch, I verify each command by an echo, and all is right.

    Then, these parameter have a native "invisible" space on variable (find in forum cmd / batch), but when use by windows, the "space" is automatically removed, then I not see it (ex with echo).

    However, if the variable is passed to nrf_util, the space is conserved because it is a python script and not a windows management. I supposed the file extension (hex) is replaced (into python script) by BIN and DAT extension and the extra space is keeped.

    So,

    - in .json file, there is space because it is generated by python script

    - in windows file system, the space is automatically removed ! (I test it by adding manually space, it is not possible, windows remove it immediately).

    Regards

    Cedric

Children
Related