Setting up BSOM without connecting to Cellular

I am working on a prototype to be sent to New Zealand. I have created the sketch below which should not attempt to connect to the cellular network. I then use the “device restore” app to update the deviceOS to 4.0.2 and flash this firmware onto the device. This completes successfully but the device goes straight to flashing green and is not running my firmware.


#include "Particle.h"

SYSTEM_MODE(MANUAL);                        // This will enable user code to start executing automatically.
SYSTEM_THREAD(ENABLED);                             // Means my code will not be held up by Particle processes.

SerialLogHandler LogHandler(LOG_LEVEL_INFO);

const pin_t BLUE_LED = D7;
unsigned long lastBlink = 0;

void setup() {
  waitFor(Serial.isConnected, 10000);				// Wait for serial connection
  pinMode(BLUE_LED,OUTPUT);
}

void loop() {
  if (millis() - lastBlink > 1000) {
    lastBlink = millis();
    Log.info("Change LED state");
    digitalWrite(BLUE_LED, !digitalRead(BLUE_LED));
  }
}

Any suggestions?

Thanks,

Chip

The only thing I can suggest is to stuff a delay of some length in your code, below, so you might be able to see more of what is happening in setup() before it finishes executing.

  waitFor(Serial.isConnected, 10000);				// Wait for serial connection
  delay(2000);                             // new

I hope this helps.

https://community.particle.io/t/logging-in-setup-not-working/63079/2

Thanks @robc,

That is a great suggestion, I tried that and no luck.

I also put a digitalWrite in setup to turn on the LED which I could see even if the serial logging was not working. I don’t believe that my code and that is is trying to connect to cellular to complete the process initiated in device restore.

Perhaps I need to manually update the OS instead of using the device restore app.

Thanks again for the suggestion.

Chip

With the device in listening mode (blinking dark blue), what is the output from:

particle serial inspect

@rickkas7 ,

Thank you for taking a look:

Platform: 25 - B5 SoM
Modules
  Bootloader module #0 - version 1006, main location, 49152 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
  System module #1 - version 4006, main location, 671744 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: FAIL
      Bootloader module #0 - version 1101
      Radio stack module #0 - version 202
  User module #2 - version 6, main location, 262144 bytes max size
    UUID: 16BA56510D036DCAC01C7471DED628CE6C5AF1683B2C076444969E5DBB30FC07
    Integrity: PASS
    Address Range: PASS
    Platform: FAIL
    Dependencies: PASS
      System module #1 - version 4006
  Radio stack module #0 - version 202, main location, 192512 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
cmcclell-mac:~ chipmc$ 

Chip

It looks like the bootloader did not get updated when you flashed the device. The bootloader on the device is from 3.2.0, but Device OS is 4.0.2. This should have been upgraded by the Device Restore, it’s not clear why it didn’t. But that’s why the device is blinking green, it’s attempting to connect to cellular and cloud to get the bootloader update OTA.

1 Like

@rickkas7 ,

First, thanks for showing how to diagnose this issue. I can see why the device would be trying to get the missing components and not running my user code.

I have tried re-running the device restore again (this time selecting “Tinker”, 4.0.2 and “overwrite”) but no success. I also have a second device and had the same result there.

Is there another approach such as flashing the boot loader using the CLI?

Thanks,

Chip

After the parts are flashed in DFU mode and it exits DFU, does it go through a sequence of blinking white, then magenta, for several seconds, before going into blinking green? That’s where the bootloader should be upgraded.

You can flash the bootloader, but it must be done using particle flash --serial with the device in listening mode.

I didn’t have a B5SoM handy, but I was able to roll back to 3.2.0, and then another Device Restore DFU to 4.0.2 did update the bootloader on the B404.

@rickkas7 ,

After flashing the components it goes to white and then straight to flashing green - no magenta I can see.

Tried rolling back to 3.2.0 but still showing fails - this is what is shows after “Tinker”,3.2.0 and “overwrite”

Platform: 25 - B5 SoM
Modules
  Bootloader module #0 - version 1006, main location, 49152 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
  System module #1 - version 3201, main location, 671744 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: FAIL
      Bootloader module #0 - version 1100
      Radio stack module #0 - version 202
  User module #2 - version 6, main location, 262144 bytes max size
    UUID: D5A6C3FF6C32179FF7E577B7BE046C68EEDB5D4CAA962CDF3FD0942997432B55
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #1 - version 3201
  Radio stack module #0 - version 202, main location, 192512 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS

Try particle flash --serial?

Chip

Yes, flashing using --serial is probably the best plan right now. SWD would also work.

@rickkas7 ,

Thank you for your help on this. By downloading the binaries and flashing the deviceOS and the boot loader tor deviceOS@4.0.2 , I was able to validate that the system has all “PASS” on the particle serial inspect.

Platform: 25 - B5 SoM
Modules
  Bootloader module #0 - version 1101, main location, 49152 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
  System module #1 - version 4006, main location, 671744 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      Bootloader module #0 - version 1101
      Radio stack module #0 - version 202
  User module #2 - version 6, main location, 262144 bytes max size
    UUID: D5A6C3FF6C32179FF7E577B7BE046C68EEDB5D4CAA962CDF3FD0942997432B55
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #1 - version 3201
  Radio stack module #0 - version 202, main location, 192512 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS

I was then able to flash my firmware and it is running without connecting to cellular.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.