# Particle cli: Error writing firmware: could not parse firmware.bin: Attempt to access memory outside buffer bounds

**URL:** <https://community.particle.io/t/particle-cli-error-writing-firmware-could-not-parse-firmware-bin-attempt-to-access-memory-outside-buffer-bounds/55416>\
**Category:** CLI\
**Tags:** boron\
**Created:** [March 30, 2020, 9:16pm UTC](https://community.particle.io/t/particle-cli-error-writing-firmware-could-not-parse-firmware-bin-attempt-to-access-memory-outside-buffer-bounds/55416 "2020-03-30T21:16:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SockThief](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@SockThief](https://community.particle.io/u/SockThief)\
**Post date:** [March 30, 2020, 9:16pm UTC](https://community.particle.io/t/particle-cli-error-writing-firmware-could-not-parse-firmware-bin-attempt-to-access-memory-outside-buffer-bounds/55416/1 "2020-03-30T21:16:35Z")

</div>

Hi I have a Boron LTE, and since i am outside the US, i am switching it from the default MFF2 sim to the SIM slot. I’ve copied the standard CPP provided in the docs, compiled it and trying to flash it via the CLI.

It worked perfectly fine the first few times but now all of a sudden it is throwing this error

Error writing firmware: could not parse firmware.bin: Attempt to access memory outside buffer bounds

i can flash Tinker without an issue, so not sure why this firmware is failing (where it has previously worked). The firmware.bin is created, so compiling works ok just flashing fails.

The error itself reminds me of a node.js error, but i may be mistaken here.

(for what its worth the sim i have has a number of available APNs, hence I am changing the firmware a few times)

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [March 30, 2020, 11:52pm UTC](https://community.particle.io/t/particle-cli-error-writing-firmware-could-not-parse-firmware-bin-attempt-to-access-memory-outside-buffer-bounds/55416/2 "2020-03-30T23:52:12Z")

</div>

Could you try checking the binary with the following?:

```auto
particle binary inspect firmware.bin

```

[https://docs.particle.io/reference/developer-tools/cli/#particle-binary-inspect-file-bin](https://docs.particle.io/reference/developer-tools/cli/#particle-binary-inspect-file-bin)

---

<div class="post-metadata">

**Author:** ![SockThief](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@SockThief](https://community.particle.io/u/SockThief)\
**Post date:** [March 31, 2020, 7:07am UTC](https://community.particle.io/t/particle-cli-error-writing-firmware-could-not-parse-firmware-bin-attempt-to-access-memory-outside-buffer-bounds/55416/3 "2020-03-31T07:07:22Z")

</div>

thanks @nrobinson2000 - see below

```auto
$ particle binary inspect firmware.bin 
particle-cli v2.2.0

! A newer version (2.3.0) of particle-cli is available.
! Upgrade now by running: particle update-cli

Could not parse firmware.bin: Attempt to access memory outside buffer bounds

```

```auto
$ particle update-cli
Updating CLI... done. Updated 1 package.

```

```auto
$ particle binary inspect firmware.bin 
Could not parse firmware.bin: Attempt to access memory outside buffer bounds

```

```auto
$ particle compile boron 3rdPartySIM.cpp --saveTo firmware.bin

Compiling code for boron

Including:
    3rdPartySIM.cpp
attempting to compile firmware 
downloading binary from: /v1/binaries/5e82ecbc5d1b080001b683ec
saving to: firmware.bin
Memory use: 
   text data bss dec hex	filename
   5900 108 1116 7124 1bd4	/workspace/target/workspace.elf

Compile succeeded.
Saved firmware to: firmware.bin

```

```auto
$ particle binary inspect firmware.bin 
firmware.bin
 CRC is ok (80c1a4b7)
 Compiled for boron
 This is an application module number 1 at version 6
 It depends on a system module number 1 at version 1502

```

```auto
$ particle flash --usb firmware.bin 

Flash success!

```

so, working ok now - i guess the particle cli update was required. Which is interesting, as I checked my notes and I had updated CLI .

cheers!

---

<div class="post-metadata">

**Author:** ![SockThief](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@SockThief](https://community.particle.io/u/SockThief)\
**Post date:** [March 31, 2020, 8:53pm UTC](https://community.particle.io/t/particle-cli-error-writing-firmware-could-not-parse-firmware-bin-attempt-to-access-memory-outside-buffer-bounds/55416/4 "2020-03-31T20:53:28Z")

</div>

does anyone know if this was an issue with a version of the CLI and what caused it?
