0.4.3 Building locally for P1 issues [SOLVED]

So after a day of tinkering, I have some findings about building locally for the P1. Another nut for the firmware folks to crack :stuck_out_tongue_winking_eye:

When building locally, the compiler spits out a binary just fine. I’m able to flash the P1, but after it is loaded the P1 becomes unresponsive. No LED on these boards, so not much debugging info I can provide, but I can still get it into listening mode if I hold down the mode pin.

Here is what does not work :

  • with the example app below in user/applications/myapp/ build via make PLATFORM=P1 APP=myapp all
  • flash (the locally compiled binary) via dfu using program-dfu or using dfu-util and flashing the .bin to 0x80A0000 address space
  • flash (OTA using the locally compiled binary) via cli using particle flash myP1 myapp.bin

However, here is what does work (all using the example app below):

  • using the web IDE, and doing an OTA flash to the P1
  • using the web IDE, downloading the binary and flashing via DFU to the P1
  • building locally and flashing to a Photon via make PLATFORM=photon APP=myapp all program-dfu

Environment:

  • P1 with base firmware updated to 0.4.3

  • source pulled from release/0.4.3 branch on spark/firmware github repo

  • arm-none-eabi-gcc 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 224288]

  • 14.04.1-Ubuntu

    /* example application */

    void setup() {
    Serial.begin(9600) ;
    }

    void loop() {
    static char i = ‘A’ ;
    Serial.print(i++);
    if( i == ‘[’ ){
    i = ‘a’;
    }
    else if( i == ‘{’ ){
    i = ‘A’ ;
    }
    delay(500);
    }

Anyone else having this issue with P1s? Seems like stuff I compile locally for P1 is just not coming out right. Does the web IDE target the P1 when you compile, or does it use the target agnostic compile option ?

Thanks in advance to the awesome people here, and HALP!

1 Like

… also, unrelated but the P1s don’t show up as online when I use particle list or in the web IDE but I can flash them OTA

1 Like

I’m investigating this now. Do you have access to a JTAG programmer? If so, could you try programming the binary to 0x80A0000 using JTAG?

Same behaviour using JTAG

I was able to flash the binary taken from the web IDE just fine. The locally compiled binary makes the core unresponsive as soon as it jumps into user code.

Thanks for confirming. I’ve tried the app and the sequence of commands, and I’m seeing running firmware, so I’m guessing the issue is something in your setup perhaps?

I’d like to send you the binary that I compiled so you can try flashing that. If that works, then we know the problem is isolated to locally compiling the application. Please PM me how you’d like me to get the binary to you. Thanks :smile:

We got this resolved via PM - the P1 unit was that @jakeypoo had a pre-release P1 with an old bootloader that wasn’t clearing the write protect bits, and so couldn’t successfully DFU firmware.

2 Likes