[CORE] Error writing firmware...Incorrect platform id

Hi,

after “loosing” my Photon, I’ve reactived my Core. But I can’t flash via USB/DFU:

$ particle compile core . --saveTo core_firmware.bin 

Compiling code for core

Including:
    /Users/marcus/Development/Particle/Blink/blink.ino
attempting to compile firmware 
pushing file: /Users/marcus/Development/Particle/Blink/blink.ino
downloading binary from: /v1/binaries/56ed213c5a99a0f93b8ff68d
saving to: core_firmware.bin
Memory use: 
   text	   data	    bss	    dec	    hex	filename
  78824	   1048	   8828	  88700	  15a7c	/spark/compile_service/shared/workspace/0_core__24_1/firmware/main/b96f71af108e1d384140ec4875e9f065261bd47add1f790a0a91740496a2/b96f71af108e1d384140ec4875e9f065261bd47add1f790a0a91740496a2.elf

Compile succeeded.
Saved firmware to: /Users/marcus/Development/Particle/Blink/core_firmware.bin
iMac27Marcus:Blink marcus$ particle compile core . --saveTo core_firmware.bin 

Compiling code for core

Including:
    /Users/marcus/Development/Particle/Blink/blink.ino
attempting to compile firmware 
pushing file: /Users/marcus/Development/Particle/Blink/blink.ino
downloading binary from: /v1/binaries/56ed218d477963a40b0fa181
saving to: core_firmware.bin
Memory use: 
   text	   data	    bss	    dec	    hex	filename
  78824	   1048	   8828	  88700	  15a7c	/spark/compile_service/shared/workspace/0_core__24_2/firmware/main/c45f49e48ffcfe142a1b42a13b21d11ad10706624df566784ee226a2114a/c45f49e48ffcfe142a1b42a13b21d11ad10706624df566784ee226a2114a.elf

Compile succeeded.
Saved firmware to: /Users/marcus/Development/Particle/Blink/core_firmware.bin

$ particle flash --usb core_firmware.bin
running dfu-util -l
Found DFU device 1d50:607f

Error writing firmware...Incorrect platform id (expected 0, parsed 60769), use --force to override

There seems to be nothing special to my code:

// ------------
// Blink an LED
// ------------

#if (PLATFORM_ID == 0)  // Core + ShieldShield V2.0
int led1 = D0;
int led2 = D7;
#elif (PLATFORM_ID == 6)  // Photon + ShieldShield V3.0
int led1 = A0;
int led2 = D7;
#elif (PLATFORM_ID == 8) // P1 Sparkfun
int led1 = A0;
int led2 = D7;
#endif

void setup() {
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);

}

void loop() {
  digitalWrite(led1, HIGH);
  digitalWrite(led2, HIGH);

  delay(1000);

  digitalWrite(led1, LOW);
  digitalWrite(led2, LOW);

  delay(1000);
}

If I try: $ particle flash --usb core_firmware.bin –force everything works fine?!

Regards,
Marcus

The following works fine:

$ npm update -g particle-cli
$ npm update -g particle-cli
$ particle update    
! There are currently no system firmware updates available for this device.

$ particle flash --usb tinker
running dfu-util -l
Found DFU device 1d50:607f
checking file /usr/local/lib/node_modules/particle-cli/binaries/core_tinker.bin
spawning dfu-util -d 1d50:607f -a 0 -i 0 -s 0x08005000:leave -D /usr/local/lib/node_modules/particle-cli/binaries/core_tinker.bin
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Deducing device DFU version from functional descriptor length
Opening DFU capable USB device...
ID 1d50:607f
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 1024
DfuSe interface name: "Internal Flash  "
Downloading to address = 0x08005000, size = 79996
Download	[=========================] 100%        79996 bytes
Download done.
File downloaded successfully
Transitioning to dfuMANIFEST state

Flash success!

And Tinker can be used with my iPhone.

Regards,
Marcus

Have you ever updated the bootloader on that Core?
Do you still get the same error after you used --force once?

I’ve done some firmware updates but no special boot loader updates.
And yes, I have to use “force” everytime I try to flash.

I’ve tried to flash via the Web-IDE but now it’s blinking green and I’m not be able to get it running again. :frowning:

With the Core you can always try a factory reset.

All these standard process didn’t worked, but the following has done the job:

$particle flash --usb cc3000 in DFU mode
$next particle flash --usb tinker
$particle serial wifi

Uhh, and I was able to flash my blink programm successfully. But still have to use “force”.

To find out which version is installed I added:

Particle.publish(“Blink/Version”, String(System.versionNumber()));

and the Dashboard shows:

Blink/Version 264448

Strange number …

Ahh, it seems to be HEX. Changed code to:

Particle.publish(“Blink/Version”, String(System.versionNumber(), HEX));

shows “40900”. I guess that means firmware version 00.04.09. But which number has the next version? V00.04.0A? :blush:

Is there any chance to get rid of that message finally?

Could you please create an issue on GitHub at https://github.com/spark/firmware/issues/new

I’ll follow up to figure out why the wrong platform message shows up.

Thanks for creating an issue. We’ll follow up on GitHub.

Any update on this issue?

My Mac is giving my the same message when I flash over USB.

particle flash --usb core_firmware*
running dfu-util -l
Found DFU device 1d50:607f

Error writing firmware…Incorrect platform id (expected 0, parsed 15201), use --force to override

I have update the particle cli and did a factory reset. Still same message over USB. OTA flash still works.

Chipmonk

You can help us figure out what’s going on by participating in the conversation on GitHub:

This was a bug in the command line interface. The fix will be included in the next release. Thanks all for helping figuring this out!