Solid magenta after a few minutes of flashing magenta?

Im having this issue at the moment, it starts flashing normally then i get solid magenta for about 25 seconds, then flashing cyan and then the core restarts.

it only happens when i try and flash a particular firmware, ie one firmware updates no issue everytime, the other fails at the same point everytime.

Ive had it before with a different app i was writing… i changed the code and it started working again… i didnt take much notice at the time. it doesnt come up with any compile errors or anything, but never finishes flashing.

It’s usually when you run some code with a tight loop which does not allow OTA to be triggered successfully.

Try reviewing your code for the time being.

Will note it down since a couple of users had the same issue too.

Thanks! :slight_smile:

just adding one line of Serial.println(“something”); makes the difference… delete it and its fine add it in and hangs every time. Ive checked the useage and both ram and flash sitting at 75%ish.

if i leave the print line in and remove the if statement after it flashes ok too… its really strange

You can consider posting your code on Gist and we can do a review :smile:

1 Like

Well that was a mission to work out Github

Hmmm…i did a compile on Spark-CLI, and the core ran fine.

It might be due to me not having a microSD card attached and my shield is at home so i can’t proceed further.

It’s doing OTA as i type this and not seeing any issue so far…

Yep it’s a strange one… still hangs for me as is about half way through. I can add more lines and it works or take lines away and it works…

Finally got to it today…

Seems like Serial hanged halfway?

Hmm…i’m getting the same “solid magenta” problem…

I couldn’t get it to flash with that code it would compile no probs but it would flash magenta for about 30 sec then solid magenta… I’ll try again tomorrow morning and see if I still get the same. The code has evolved a bit since then anyway and seems to flash ok again now

I’m a bit bummed I just got an email saying the rfid reader I wanted is out of stock… oh well ill just have to wait to try the code properly

I’m really curious why this code made it behave this way!

Gonna hunt it down

@peekay123,

i need your help on this one. I found a way to trigger the “solid magenta after few minutes” in the code.

Time is not my friend and would need your help to see exactly what is the real problem!

@kennethlimcp, my daytime is shot for today but I can try and look at this tonight. :smile:

1 Like

@peekay123,

i can’t resist not catching myself so i should have had it nailed!

@Hootie81, i think there is some issue with EDB somehow.

All i did was to comment the stuff using EDB and i managed to flash well.

Hope this helps! :smiley:

I’m going to climb up of the rabbit hole and have a drink :wink:

I am not sure what you mean by this. Which lines exactly did you uncomment cause I can't seem to find any in the files posted on github! :blush:

Line 101 and 116

https://github.com/Hootie81/Spark_Database_SDcard/blob/master/Spark-ReadWrite.ino#L101

@kennethlimcp, maybe it’s me but those lines are not commented out in the github post! You did say UNcomment right?

Oh yes :smile:

I’m compiling via cloud using Spark-CLI so i could comment them :smiley:

OPPS. dang. i sorry i meant COMMENT :smiley:

@kennethlimcp, I’m sorry buddy but I still have no idea what your talking about but I just compiled the code with CLI and I will be trying to flash it over in a few minutes. :smile:

UPDATE: I flashed the code and it stops exactly as @kennethlimcp shows. Debugging time :stuck_out_tongue:

I just realized that the code is running as desgined. It opens/creates a DB then creates 10 records and stops. This is exactly what I see on the serial monitor. I don’t get anything but breathing cyan.

I then changed RECORDS_TO_CREATE to 100 and TABLE_SIZE to 1024. Besides a pause while creating the records, everything worked fine with the last ID = 99 and Temp = 396. Things went way faster when I ran the code a second time since the DB already existed. All with the breathing cyan.

I compiled the code with Spark CLI and loaded the code via USB

One note however. In the .ino file in setup() there is this code:

  Serial.begin(115200);
  while (!Serial.available());

If you wait to long to connect to the serial port, the firmware background task will “starve” possibly causing the red led condition. The code should be:

  Serial.begin(115200);
  while (!Serial.available())
      SPARK_WLAN_Loop();

:smile:

1 Like

I added that as well. The code works fine but you can’t do a proper OTA!