Firmware Download failed Callback status 59399ERROR

I have my own system.sdef and I build and update for wp76xx:

mksys -t wp76xx “system.sdef”

As an output I get system.wp76xx.update file, this update works but I need this to be a .cwe to bundle it with other stuff into .spk.

Then I do this:

systocwe “wp76xx” “system.wp76xx.update” output/

In the output folder I see this:

drwxrwxr-x  4 akak akak     4096 окт 30 17:33 .
drwxrwxr-x 13 akak akak     4096 окт 30 17:33 ..
lrwxrwxrwx  1 akak akak       23 окт 30 17:33 legato.cwe -> legato-squashfs.ubi.cwe
lrwxrwxrwx  1 akak akak       19 окт 30 17:33 legato.default -> legato.squashfs.ubi
drwxrwxr-x  5 akak akak     4096 окт 30 17:33 legatoimg
-rw-r--r--  1 akak akak 11988992 окт 30 17:33 legato.squashfs
-rw-rw-r--  1 akak akak 13107200 окт 30 17:33 legato.squashfs.ubi
-rw-rw-r--  1 akak akak 13108000 окт 30 17:33 legato-squashfs.ubi.cwe
drwxrwxr-x  4 akak akak     4096 окт 30 17:33 _staging_system.wp76xx.update

Then I flash the .cwe file:

swiflash -i legato.cwe -m “wp76xx”

or

swiflash -i legato-squashfs.ubi.cwe -m “wp76xx”

And I get this as an output:

Detecting USB of the target
DONE
Communicating with the target
DONE
Switching to firmware download mode
............DONE
Downloading the firmware
.....ERROR: Firmware Download failed. Callback status 59399ERROR: Firmware Download Failed
DONE

I have also tried using systoimg, and I get the same output.
My sys update bundles my app and my app bundles whole POCO library, so in the end the .cwe file is around 13 mb.
Could size be the problem?

What I missed to say is that my .sdef file contains my application and legato services I need, without other services like wifi, airvantage, gnss and etc.

When I convert system.wp76xx.update to cwe without having my application in .sdef, the .cwe file works.
When I also put my app then it doesn’t work.

Is there a restriction in size of .SPK file?

Hi @lazzox,

May I know, in which legato version you are generating the .cwe file.

You have mentioned .cwe file is 13mb, that is the size of legato.cwe file ?

Normally the legato.cwe file size will be around 4mb, In your case can you please share the size of the .cwe file before adding the application.

And also kindly can you please share the .sdef file and application you using in your side.

Best Regards,
Bharath Kumar V

Thank you for your reply.

I actually found out that my system overlay update when converted to image (.cwe file) was too big because of duplicated files (in my application which was bundled with legato services in the .sdef file).
When I removed those files, size of my system overlay was about 3mb and size of the complete SPK was around 60mb (where previously it was more than 100mb) then everything worked like a charm.

I gues THERE IS a limit on the size of the system overlay image and I learned this the hard way.

I have another question on this topic:

I made my own legato system, where I included only legato services and tools I needed and my custom application.

I noticed that before when I built my app separately from system I was able to edit some files located here:
/legato/systems/current/appsWriteable/myApp/usr/cfg

I was able to edit them by using VI editor.
Now I am getting message:

Read-only file system

I am unsure why is this? When I converted my system update to .cwe I DID NOT use the --read-only option.

Hi @lazzox,

When you install the base legato system file(.cwe) which has your custom application, It will get installed in the MTD3/USER0 partition. As MTD3/USER0 partition is read only and I think that is the reason you are not able to edit the files.

When you install the overlay legato system or application (.update), It will get installed in the MTD4/USER1 partition. MTD4/USER1 partition is both read write and I think that is the reason you were able to edit the files when you built your App separately.

Verified on my side, i see the same behavior and it is expected.

Regards,
Muralidhara N.

1 Like