BLE .fota post-build failure

Hello,

While using peripheral server FOTA project, I have noticed the project fails on the post-build step where it is unable to build the .fota file even though the files needed are present.

Error message:
arm-none-eabi-objcopy -O binary “ble_peripheral_server_hrp_fota.elf” “ble_peripheral_server_hrp_fota.bin” && “…/ble_peripheral_server_hrp_fota/RTE/Device/RSL10/mkfotaimg.py” -o “ble_peripheral_server_hrp_fota.fota” “…/ble_peripheral_server_hrp_fota/RTE/Device/RSL10/fota.bin” “ble_peripheral_server_hrp_fota.bin”
usage: mkfotaimg.py [-h] [–version] [-d UUID] [-s KEY-PEM] [-i UUID]
[-n NAME] [-o OUT-IMG]
FOTA-IMG APP-IMG
mkfotaimg.py: error: the following arguments are required: FOTA-IMG, APP-IMG
makefile:69: recipe for target ‘post-build’ failed

The command generated on my system uses absolute rather than relative path names. I suspect that may be the issue here. What version SDK/IDE are you using? Can you change the path of the project to be an absolute path?

1 Like

Hello Jamie,

Thank you for the reply.
I am using ON Semiconductor IDE Version: 3.4.0.48. I think that is not the problem as I tried the fota example and even that seems to fail on post-build step.

@krishnaD

Are you getting the same " Error message " when you entered absolute path instead?

Can you copy / paste the message here ?

make --no-print-directory post-build
‘Invoking: Cross ARM GNU Create FOTA Image’
arm-none-eabi-objcopy -O binary “ble_peripheral_server_hrp_fota.elf” “ble_peripheral_server_hrp_fota.bin” && “D:/Software/ble_peripheral_server_hrp_fota/RTE/Device/RSL10/mkfotaimg.py” -o “ble_peripheral_server_hrp_fota.fota” “D:/Software/ble_peripheral_server_hrp_fota/RTE/Device/RSL10/fota.bin” “ble_peripheral_server_hrp_fota.bin”
usage: mkfotaimg.py [-h] [–version] [-d UUID] [-s KEY-PEM] [-i UUID]
[-n NAME] [-o OUT-IMG]
FOTA-IMG APP-IMG
mkfotaimg.py: error: the following arguments are required: FOTA-IMG, APP-IMG
’ ’

@krishnaD

Can you confirm that:

If you press both the reset and the user (DIO5) push buttons on the RSL10 EVB simultaneously, and then release the reset button first. Upon releasing both push buttons, the LED (DIO6) on the RSL10 EVB is set constant high, indicating that the bootloader updater is active, waiting for a firmware image over UART.

If you load the ble_peripheral_server_hrp_fota image using the bootloader with following command you should see:

The mkfotaimg.py tool is behaving as if there are no FOTA-IMG and APP-IMG arguments specified, though from the error message they are clearly there in the command line unless there’s a “return” that’s not visible.

I’d suggest trying to run from the command line. Assuming you built with the Debug configuration, make your working directory D:/Software/ble_peripheral_server_hrp_fota/debug then on one line try the command:

D:/Software/ble_peripheral_server_hrp_fota/RTE/Device/RSL10/mkfotaimg.py -o ble_peripheral_server_hrp_fota.fota D:/Software/ble_peripheral_server_hrp_fota/RTE/Device/RSL10/fota.bin ble_peripheral_server_hrp_fota.bin

Hello Jamie,

I tried on the command line but still the same issue. I see the files but it still cannot find it.

It’s not that the script cannot find the file provided as an argument. If that were the issue the error would look like this:

usage: mkfotaimg.py [-h] [–version] [-d UUID] [-s KEY-PEM] [-i UUID] [-n NAME] [-o OUT-IMG] FOTA-IMG APP-IMG
mkfotaimg.py: error: argument APP-IMG: can’t open ‘ble_peripheral_server_hrp_fota.big’: [Errno 2] No such file or directory: ‘ble_peripheral_server_hrp_fota.big’

The issue is that the script isn’t seeing the two arguments FOTA-IMG or APP-IMG

For instance, the command:

python “c:\Users\fg9whc\on-semiconductor-workspace\ble_peripheral_server_hrp_fota\RTE\Device\RSL10\mkfotaimg.py” -o ble_peripheral_server_hrp_fota.fota …\RTE\Device\RSL10\fota.bin ble_peripheral_server_hrp_fota.bin

Results in ble_peripheral_server_hrp_fota.fota being generated with no error.

workspace\ble_peripheral_server_hrp_fota\RTE\Device\RSL10\mkfotaimg.py" -o ble_peripheral_server_hrp_fota.fota …\RTE\Device\RSL10\fota.bin

(leaving out the APP-IMG argument) results in

usage: mkfotaimg.py [-h] [–version] [-d UUID] [-s KEY-PEM] [-i UUID] [-n NAME] [-o OUT-IMG] FOTA-IMG APP-IMG
mkfotaimg.py: error: the following arguments are required: APP-IMG

and

python “c:\Users\fg9whc\on-semiconductor-workspace\ble_peripheral_server_hrp_fota\RTE\Device\RSL10\mkfotaimg.py” -o ble_peripheral_server_hrp_fota.fota

results in

usage: mkfotaimg.py [-h] [–version] [-d UUID] [-s KEY-PEM] [-i UUID] [-n NAME] [-o OUT-IMG] FOTA-IMG APP-IMG
mkfotaimg.py: error: the following arguments are required: FOTA-IMG, APP-IMG

I suggest going as minimalistic as possible and copying all the files into the RTE\Device\RSL10 directory. Then please cut and paste both your command and the error message. Hopefully that will help sort out where the issue is.

Also, if you use the command line command “python”, what version is reported?

Thank you Jamie. Looks like having 2 IDEs open at the same time can cause this issue. Once I closed the other one, the error went away and I was able to generate the .fota image.

4 Likes

Thank you for sharing the issue and it’s resolution!

1 Like