nRF Command Line Tools: nrfdfu.dll 32bit version problem when updating nRF9160 firmware

Dear support team,

we use the Nordic nrfdfu.dll (64bit) in our Win11 C#/.Net application for modem update which works fine.
When we switch our application to 32bit process and change to the Nordic nrfdfu.dll (32bit) the modem update functionality no longer works. The communication start between PC application and nRF9160 modem seems to fail and the application hangs until we stop it after some minutes.


Via DllImport we use the following methods of the nrfdfu.dll: 

        [DllImport(nrfDfuDllName, EntryPoint = "NRFDFU_connect_to_mcuboot_target", CallingConvention = CallingConvention.Cdecl)]
        [DllImport(nrfDfuDllName, EntryPoint = "NRFDFU_connect_to_modemdfu_target", CallingConvention = CallingConvention.Cdecl)]
        [DllImport(nrfDfuDllName, EntryPoint = "NRFDFU_program_package", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
        [DllImport(nrfDfuDllName, EntryPoint = "NRFDFU_close_connection", CallingConvention = CallingConvention.Cdecl)]
        [DllImport(nrfDfuDllName, EntryPoint = "NRFDFU_verify_package", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]

Do you have any idea what the reason could be?

Best regards,

Peter   

Parents
  • Hello Peter,

    Sorry for the delay occurring here.
    When running the 32-bit version of the application, can you confirm which SEGGER J-Link DLL is loaded? A 32-bit process must load JLinkARM.dll (32-bit), while a 64-bit process uses JLink_x64.dll

    The DFU API launches a worker executable (jlinkarm_nrf_worker_*.exe) to handle the J-Link communication. When the application runs as a 32-bit process, the 32-bit version of this worker executable would typically need to be available, possibly either in the same directory as the application or somewhere in the system PATH. If only the 64-bit worker executable is present, it might be possible that the API attempts to launch that instead, which could potentially lead to the communication failing or the process hanging. Could you check whether a 32-bit jlinkarm_nrf_worker_*.exe is present and being used when running the application in 32-bit mode?

    Kind Regards,

    Abhijith

Reply
  • Hello Peter,

    Sorry for the delay occurring here.
    When running the 32-bit version of the application, can you confirm which SEGGER J-Link DLL is loaded? A 32-bit process must load JLinkARM.dll (32-bit), while a 64-bit process uses JLink_x64.dll

    The DFU API launches a worker executable (jlinkarm_nrf_worker_*.exe) to handle the J-Link communication. When the application runs as a 32-bit process, the 32-bit version of this worker executable would typically need to be available, possibly either in the same directory as the application or somewhere in the system PATH. If only the 64-bit worker executable is present, it might be possible that the API attempts to launch that instead, which could potentially lead to the communication failing or the process hanging. Could you check whether a 32-bit jlinkarm_nrf_worker_*.exe is present and being used when running the application in 32-bit mode?

    Kind Regards,

    Abhijith

Children
  • Hallo Abhijith,

    I am NOT using Jlink in SW update, I am just connected via USB-C cable. We have created a wrapper that calls methods from your nrfdfu.dll. I case of 32 bit DLL usage I get the error below in line 286 (error code = -220 from method "NRFDFU_program_package". When operating in 64 bit mode line 282 is executed and work OK.

    // Start programming
    int returnCode = -1;
    if ( NordicNrfDfuWrapper.IsRunningInA64BitProcess () )
    {
        returnCode = NRFDFU_program_package_x64 ( this.connectionHandle, filePath );
    }
    else
    {
        returnCode = NRFDFU_program_package ( this.connectionHandle, filePath );
    }

    Best regards

    Johannes

Related