# Firmware Download failed Callback status 59399ERROR

**URL:** <https://forum.legato.io/t/firmware-download-failed-callback-status-59399error/3823>\
**Category:** Uncategorized\
**Created:** [October 30, 2018, 4:52pm UTC](https://forum.legato.io/t/firmware-download-failed-callback-status-59399error/3823 "2018-10-30T16:52:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lazzox](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lazzox](https://forum.legato.io/u/lazzox)\
**Post date:** [October 30, 2018, 4:52pm UTC](https://forum.legato.io/t/firmware-download-failed-callback-status-59399error/3823/1 "2018-10-30T16:52:47Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![lazzox](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lazzox](https://forum.legato.io/u/lazzox)\
**Post date:** [October 31, 2018, 7:04am UTC](https://forum.legato.io/t/firmware-download-failed-callback-status-59399error/3823/2 "2018-10-31T07:04:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lazzox](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lazzox](https://forum.legato.io/u/lazzox)\
**Post date:** [November 1, 2018, 4:11pm UTC](https://forum.legato.io/t/firmware-download-failed-callback-status-59399error/3823/3 "2018-11-01T16:11:26Z")

</div>

Is there a restriction in size of .SPK file?

---

<div class="post-metadata">

**Author:** ![bharath\_08](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bharath\_08](https://forum.legato.io/u/bharath_08)\
**Post date:** [November 2, 2018, 1:14pm UTC](https://forum.legato.io/t/firmware-download-failed-callback-status-59399error/3823/4 "2018-11-02T13:14:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lazzox](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lazzox](https://forum.legato.io/u/lazzox)\
**Post date:** [November 2, 2018, 2:22pm UTC](https://forum.legato.io/t/firmware-download-failed-callback-status-59399error/3823/5 "2018-11-02T14:22:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lazzox](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lazzox](https://forum.legato.io/u/lazzox)\
**Post date:** [November 2, 2018, 3:14pm UTC](https://forum.legato.io/t/firmware-download-failed-callback-status-59399error/3823/6 "2018-11-02T15:14:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![muralinagraj](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@muralinagraj](https://forum.legato.io/u/muralinagraj)\
**Post date:** [December 28, 2018, 1:06pm UTC](https://forum.legato.io/t/firmware-download-failed-callback-status-59399error/3823/7 "2018-12-28T13:06:18Z")

</div>

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.
