[Issue] Flashed Successful but not really

I've been desperately trying to get my Xeon to run BLE and continue to bump into issues.

I'm using the latest version of Visual Studio Code on Mac OSX. My device has 1.5.2.

The code I am trying to flash is from the UART example with the addition of me trying to control the LED
Every time I flash the code, it says successful. But changing the UUID or adding the LED control does not take effect for some reason, which leads me to believe it's still running the old code?

Executing task: make -f '/Users/.../.particle/toolchains/buildscripts/1.9.2/Makefile' flash-user -s <

:::: PUTTING DEVICE INTO DFU MODE

Done.

:::: FLASHING APPLICATION

Creating /Users/.../.../Developer/Particle/BLEGPS/BLEGPS/target/1.5.2/xenon/platform_user_ram.ld ...
Creating /Users/.../.../Developer/Particle/BLEGPS/BLEGPS/target/1.5.2/xenon/platform_user_ram.ld ...
   text    data     bss     dec     hex filename
   8348     108    1108    9564    255c /Users/.../.../Developer/Particle/BLEGPS/BLEGPS/target/1.5.2/xenon/BLEGPS.elf
dfu-suffix (dfu-util) 0.9

Copyright 2011-2012 Stefan Schmidt, 2013-2014 Tormod Volden
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Suffix successfully added to file
Serial device PARTICLE_SERIAL_DEV : not available
Flashing using dfu:
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
ID 2b04:d00e
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x000d4000, size = 8456
Download        [=========================] 100%         8456 bytes
Download done.
File downloaded successfully
Transitioning to dfuMANIFEST state

*** FLASHED SUCCESSFULLY ***


Press any key to close the terminal.
// This example does not require the cloud so you can run it in manual mode or
// normal cloud-connected mode
SYSTEM_MODE(MANUAL);

const size_t UART_TX_BUF_SIZE = 20;

void onDataReceived(const uint8_t* data, size_t len, const BlePeerDevice& peer, void* context);

// These UUIDs were defined by Nordic Semiconductor and are now the defacto standard for
// UART-like services over BLE. Many apps support the UUIDs now, like the Adafruit Bluefruit app.
const BleUuid serviceUuid("6E400001-B5A3-F393-E0A9-E50E24DCCA9F");
const BleUuid rxUuid("6E400002-B5A3-F393-E0A9-E50E24DCCA9F");
const BleUuid txUuid("6E400003-B5A3-F393-E0A9-E50E24DCCA9F");

BleCharacteristic txCharacteristic("tx", BleCharacteristicProperty::NOTIFY, txUuid, serviceUuid);
BleCharacteristic rxCharacteristic("rx", BleCharacteristicProperty::WRITE_WO_RSP, rxUuid, serviceUuid, onDataReceived, NULL);

void onDataReceived(const uint8_t* data, size_t len, const BlePeerDevice& peer, void* context) {
    // Log.trace("Received data from: %02X:%02X:%02X:%02X:%02X:%02X:", peer.address()[0], peer.address()[1], peer.address()[2], peer.address()[3], peer.address()[4], peer.address()[5]);

    for (size_t ii = 0; ii < len; ii++) {
        Serial.write(data[ii]);
    }
}

void setup() {
    RGB.control(true);
    RGB.color(255, 0, 0); 
    Serial.begin();

    BLE.on();

    BLE.addCharacteristic(txCharacteristic);
    BLE.addCharacteristic(rxCharacteristic);

    BleAdvertisingData data;
    data.appendServiceUUID(serviceUuid);
    BLE.advertise(&data);

    RGB.color(0, 255, 0); 
}

void loop() {
    if (BLE.connected()) {
        RGB.color(0, 255, 255); 
        uint8_t txBuf[UART_TX_BUF_SIZE];
        size_t txLen = 0;

        while(Serial.available() && txLen < UART_TX_BUF_SIZE) {
            txBuf[txLen++] = Serial.read();
            Serial.write(txBuf[txLen - 1]);
        }

        if (txLen > 0) {
            txCharacteristic.setValue(txBuf, txLen);
        }
    }
}

Just a stupid question, but it has happened before :wink:
Are you sure you had saved the edits before buidling?

Also are you actually building the project you think you are? Not the file you edit is built but the project (which may actually use a different file as its “main” source).

Try a bigger change that will definety result in different build stats or just a syntax error and see whether you get a different outcome.

Just closed everything, reopened and uncommented a bunch of code to be sure and yeah.
Still not responding as I would expect. I do feel like I am missing something very simple

I was attempting to use the debugger earlier, could something from there cause this issue?

DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x000d4000, size = 11224
Download        [=========================] 100%        11224 bytes
Download done.
File downloaded successfully
Transitioning to dfuMANIFEST state

*** FLASHED SUCCESSFULLY ***

This in deed could be.

You may want to run Particle: Clean and then build and flash application and device OS.

1 Like

Gave that a try too. My code for controlling the LED looks like it should change the color from white right?

I will be unpacking another Xeon I have stuffed away somewhere to see if it is the device or IDE.

Opened another Xeon I have and unable to get anything working.

I might be missing something. Just to confirm, I just had to pair the Xeon with the iOS app and not attach it to a Mesh?

With the new device I tried flashing a simple app that did below. But nothing is working. The device just has the main LED flashing Blue, D7 is a light blue and the CHR is flashing.

SYSTEM_MODE(MANUAL);


void setup() {
    RGB.control(true);
    RGB.color(255, 255, 255); 
}

bool isOn = false;

void loop() {
   
   if (isOn)
   {
       RGB.color(0,0,0);
       isOn = false;

   }else{
       RGB.color(255,255,255);
       isOn = true;
   }

   delay(2000);

}

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