Using an OLED display with SPI interface and AdaFruit SSD1306 library, the the device freezes once display.begin() is called:
indicator hard white
no debug output
cannot program OTA without entering safe mode
when running DeviceOS 1.5.0-rc.1 on a p1 and compiling for target 1.5.0-rc.1 (noting that there is no issue when targetting DeviceOS 1.4.4 on a device loaded with 1.5.0-rc.1).
This ticket is just for reference - will test against DeviceOS 1.5.0-rc.2 once it is released and report back.
compilation under DeviceOS 1.4.4 - (device loaded with DeviceOS 1.5.0-rc.1) - worked fine
compilation under DeviceOS 1.5.0-rc.1 - (device loaded with DeviceOS 1.5.0-rc.1) - display issue as documented in this ticket - breathing white
FYI compiled to text size 107,836 bytes
compilation under DeviceOS 1.5.0-rc.2 - (assumed device auto updated to DeviceOS 1.5.0-rc.2) - display issue as documented in this ticket - breathing white
FYI compiled to text size 108,044 bytes
Given the woes above, also manually updated Device OS using particle flash --usb and then (attempted) updated the bootloader using particle flash --serial (noting that it immediately went into SOS panic #1) after this.
Here is serial inspect output (performed from Safe Mode) for the record:
Platform: 8 - P1
Modules
Bootloader module #0 - version 501, main location, 16384 bytes max size
Integrity: PASS
Address Range: PASS
Platform: PASS
Dependencies: PASS
System module #1 - version 1501, main location, 262144 bytes max size
Integrity: PASS
Address Range: PASS
Platform: PASS
Dependencies: PASS
System module #2 - version 207
System module #2 - version 1501, main location, 262144 bytes max size
Integrity: PASS
Address Range: PASS
Platform: PASS
Dependencies: PASS
System module #1 - version 1501
Bootloader module #0 - version 400
User module #1 - version 6, main location, 131072 bytes max size
UUID: D3FECAC99EA6FEDCD0408A26E376A946AA9D5C102B75087F5A0B306A4D62B566
Integrity: PASS
Address Range: PASS
Platform: PASS
Dependencies: PASS
System module #2 - version 1501
Conclusion
@avtolstoy, it seems that there is still an issue with rc.2 in my use case.
@avtolstoy, have some good feedback for you now after adding debug to the AdaFruit SSD1306 lib.
The freeze is happening straight after the first call to SPI.transfer().
Here is the call tree:
display.begin()
>> set up pins
>> set up SPI eg SPI.setBitOrder(MSBFIRST);
>> SPI.begin(SPI_MODE_MASTER, cs);
>> reset the display controller IC
>> SPI.beginTransaction(__SPISettings(...));
>> ssd1306_command(SSD1306_DISPLAYOFF);
>>>> set pins for chip sel and command
>>>> SPI.transfer(data); <=========== FREEZES HERE
>> ssd1306_command() .... lots more commands
>> SPI.endTransaction()
Can you suggest a code fix for this issue or is it only fixable at the DeviceOS level?
Just a note - posting to the forum is not considered a "ticket". You need to mail ----- to create a ticket in the system.
You can also head to https://support.particle.io/ to file a ticket.
Got it, just setting expectations
I have this listed and will check from my side tomorrow. Iāll run it through the debugger and engineering about it.
I have a possibly related issue with getting Adafruit_HX8357 to build with 1.5.0-rc.2 using the workbench. The details are on this topic thread. TFT Display with Custom Fonts
Thanks
@armor, re TFT Display with Custom Fonts, you said that you are having problems building. This will not be related to this post which is about an SPI issue with
DeviceOS 1.5.0-rc.1 and rc.2.
My guess is that if you do get it to successfully compile under DeviceOS 1.5.0-rc.1 and rc.2, you will then get SPI runtime issues noted in this and other posts.
Rick, accepting the runtime issue with SPI and 1.5.0-rc.1 and 2, why am I seeing issues with building an application that builds and works OK with 1.4.4 but does not build with 1.5.0-rc.2? The build issues appear to be SPI related?
I canāt tell why you are having the build issue in the other post.
There is the known problem below, which used to compile but now causes an error. I believe this will be fixed as well. (It can be fixed with a cast, in the interim. This is I2C not SPI, but several libraries like the SSD1306 libraries support both.)