# Particle Boron New Haven OLED Display Issue

**URL:** <https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318>\
**Category:** Firmware\
**Created:** [March 9, 2019, 2:59am UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318 "2019-03-09T02:59:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![shonky2](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shonky2](https://community.particle.io/u/shonky2)\
**Post date:** [March 9, 2019, 2:59am UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/1 "2019-03-09T02:59:13Z")

</div>

Hello All,

I’ve been having some issues with getting a display to work with a Particle Boron. I started with some more advanced code, but after having issues I decided to go back to the basics to see if there is just something that is being missed.

This is the code that I have been flashing:

```cpp
#include <Arduino.h>
#include <U8g2lib.h>
#include <SPI.h>
#include <U8g2.h>

U8G2_SSD1322_NHD_256X64_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ D13, /* data=*/ D12, /* cs=*/ D14, /* dc=*/ D15); // Enable U8G2_16BIT in u8g2.h
//U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI u8g2(U8G2_R0, / cs=/ 10, / dc=/ 9, / reset=*/ 8); // Enable U8G2_16BIT in u8g2.h

#define DISP_CS D14
#define SPI_DATA_CMD D15
#define SPI_SCK D13
#define SPI_MOSI D12

void setup(void) {

pinMode (DISP_CS , OUTPUT);

pinMode (SPI_DATA_CMD , OUTPUT);

digitalWrite(SPI_DATA_CMD , LOW);

u8g2.begin();
}

void loop(void) {
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
u8g2.drawStr(0,10,"Hello World!"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(1000);
}

```

It is able to flash successfully but on start up on the Boron goes into a hard fault with single red led error.

I really appreciate any help or thoughts as to what might be going on. Thank you!

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [March 9, 2019, 6:37am UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/2 "2019-03-09T06:37:13Z")

</div>

You should probably use HW\_SPI and go with the pins marked SCK & MO instead of SW\_SPI.

---

<div class="post-metadata">

**Author:** ![armor](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/armor/32/18398_2.png) [@armor](https://community.particle.io/u/armor)\
**Post date:** [March 9, 2019, 11:34am UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/3 "2019-03-09T11:34:09Z")

</div>

@shonky2 I have had issues with SPI when porting libraries. If you are able, I would find the SPI\_write() and SPI\_read() functions and replace with a straightforward `SPI.beginTransaction();` with settings required `SPI.transfer();` and ended by `SPI.endTransaction();`  
I would also add you need to run this on 0.9.0 as there were issues with SPI before that Device OS.

---

<div class="post-metadata">

**Author:** ![shonky2](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shonky2](https://community.particle.io/u/shonky2)\
**Post date:** [March 9, 2019, 4:36pm UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/4 "2019-03-09T16:36:09Z")

</div>

Ok, I have changed to the HW SPI and I’m still running into the same issues.

@armor It looks like when this library was ported the SPI\_write and SPI\_read have already been replace with what you recommended.

I appreciate any more ideas! Thank you!

---

<div class="post-metadata">

**Author:** ![armor](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/armor/32/18398_2.png) [@armor](https://community.particle.io/u/armor)\
**Post date:** [March 9, 2019, 6:51pm UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/5 "2019-03-09T18:51:22Z")

</div>

I suggest you post all your code. It depends what the SPIRead and SPIWrite were actually replaced with. Also, can you confirm you are on 0.9.0?

---

<div class="post-metadata">

**Author:** ![shonky2](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shonky2](https://community.particle.io/u/shonky2)\
**Post date:** [March 9, 2019, 10:36pm UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/6 "2019-03-09T22:36:47Z")

</div>

Hello All,

I’ve made some progress today. No more red light so it seems as thought the firmware is running. I’ve been running the following code and it is printing the serial lines up until 113 then stops. Also tried drawLine and that does the same thing. Never makes it to print line 117.

```auto
#include <Arduino.h>
#include <SPI.h>
#include <U8g2lib.h>

#define clrBuf u8g2.clearBuffer()
#define sndBuf u8g2.sendBuffer()

#define setBottom u8g2.setFontPosBottom()
#define wrStr(x, y, b) u8g2.drawStr(x, y, b)
#define wrLine(x, y, x1, y1) u8g2.drawLine(x, y, x1, y1)

#define font14B u8g2.setFont(u8g2_font_helvB14_tr)

#define DISP_CS D15
#define SPI_DATA_CMD D16

U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI u8g2(U8G2_R0, DISP_CS, SPI_DATA_CMD); // Enable U8G2_16BIT in u8g2.h

void setup(){

Serial.begin(9600);

delay(1000);

pinMode(DISP_CS, OUTPUT);
pinMode(SPI_DATA_CMD, OUTPUT);

digitalWrite(SPI_DATA_CMD, LOW);

delay(2000);

Serial.println("starting u8g2");

u8g2.begin();

Serial.println("Line 90");

}

void loop(void){

Serial.println("Line 103");

clrBuf;

Serial.println("Line 109");

font14B;

Serial.println("Line 113");

wrStr(10,20,"This is a test");

Serial.println("Line 117");

sndBuf;

Serial.println("Line 121");

}

```

Any additional thoughts? Thank you for your help!

---

<div class="post-metadata">

**Author:** ![armor](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/armor/32/18398_2.png) [@armor](https://community.particle.io/u/armor)\
**Post date:** [March 10, 2019, 9:07am UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/7 "2019-03-10T09:07:35Z")

</div>

> #define DISP\_CS D15  
> #define SPI\_DATA\_CMD D16

Can you confirm your physical wiring - the hardware default for CS is A2. Try using DISP\_CS A2 instead.  
I would also confirm SPI\_DATA\_CMD - DC/RS on the board - try moving this to D5 say. Have you looked at the Boron datasheet - I don't have one myself, not sure what pin D15 and D16 are possibly A4 and A3.

Not clear why you are using macros for the u8g2 methods. Try substituting u8g2.drawStr(10,20,"Hello"); in place of wrStr() etc.

You do not #include \<SPI.h\> and could try without \<Arduino.h\>

---

<div class="post-metadata">

**Author:** ![shonky2](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shonky2](https://community.particle.io/u/shonky2)\
**Post date:** [March 11, 2019, 2:06pm UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/8 "2019-03-11T14:06:11Z")

</div>

Hi,

I appreciate your help. I’ve gone through a multitude of different configurations including the ones that you suggested. I think that there is some issue in the library that was ported that I just haven’t been able to track down. I’m seeing that it takes about 12 seconds for the Boron to start up from power on which would leave the display blank for that long with no feedback to the user. I think what I’ll end up doing is paring an small Arduino with the display because I know that the original library works on Arduino and then I will have the boron send the display buffer information to the Arduino. This will also give the ability for the display to show a message during a system update cycle as well.

I appreciate the brainstorming. Thank you!

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [March 11, 2019, 2:20pm UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/9 "2019-03-11T14:20:42Z")

</div>

> [@shonky2](#):
>
> I’m seeing that it takes about 12 seconds for the Boron to start up from power on which would leave the display blank for that long with no feedback to the user.

This is (most likely) because you have not specified `SYSTEM_THREAD(ENABLE)` so user code will not run until a cloud connection is established. As for the library, can you provide a link to the exact display you are using?

---

<div class="post-metadata">

**Author:** ![shonky2](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shonky2](https://community.particle.io/u/shonky2)\
**Post date:** [March 11, 2019, 3:05pm UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/10 "2019-03-11T15:05:41Z")

</div>

Hi,

Thank you for pointing out SYSTEM\_THREAD. I’ll check that out.

[https://www.newhavendisplay.com/nhd31225664ucy2-p-3537.html](https://www.newhavendisplay.com/nhd31225664ucy2-p-3537.html) this is the display that is being used.

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [March 11, 2019, 4:30pm UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/11 "2019-03-11T16:30:45Z")

</div>

@shonky2, looking at your code, I am perplexed as to why the D15 and D16 pins are considered valid. As @armor already pointed out, the valid pins are D0-D8 and A0-A5. The “default” hardware SPI pins are shows on the actual board (MIso, MOsi, SCK) and you can chose the CS and DATA\_CMD pins within the valid range of pins such a `CS = A5` and `DATA_CMD = D5` for example.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [March 11, 2019, 4:34pm UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/12 "2019-03-11T16:34:33Z")

</div>

> [@armor](#):
>
> I don’t have one myself, not sure what pin D15 and D16 are possibly A4 and A3.

This is what @armor already pointed out.  
I'd also suggest you stick with the pin labels printed on the silk screen on the device.

---

<div class="post-metadata">

**Author:** ![shonky2](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shonky2](https://community.particle.io/u/shonky2)\
**Post date:** [March 11, 2019, 5:05pm UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/13 "2019-03-11T17:05:22Z")

</div>

@peekay123 @ScruffR Thank you all for re-stating. I apologize @armor that I dismissed it earlier. I kept referring back to the datasheet and was looking at the pin number and in my mind was connecting that to the Dpin because I had seen other code where the variables were getting defined and Dpin now realizing the difference I feel like an absolute goof. I really appreciate all of you helping. I will test later on and let you know the results.

Thank you!

---

<div class="post-metadata">

**Author:** ![shonky2](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shonky2](https://community.particle.io/u/shonky2)\
**Post date:** [March 11, 2019, 10:21pm UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/14 "2019-03-11T22:21:09Z")

</div>

Hi All,

So I tried this and now I’m running back into the issue of the Red led single flash SOS.

Not sure what would be next.

---

<div class="post-metadata">

**Author:** ![picsil](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/picsil/32/21737_2.png) [@picsil](https://community.particle.io/u/picsil)\
**Post date:** [May 15, 2019, 10:31pm UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/15 "2019-05-15T22:31:28Z")

</div>

@shonky2 have you had any more success with this library? I’m running into the exact problem you are on the boron (single flash SOS) using an SH1106 display.

---

<div class="post-metadata">

**Author:** ![shonky2](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shonky2](https://community.particle.io/u/shonky2)\
**Post date:** [May 16, 2019, 1:18am UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/16 "2019-05-16T01:18:47Z")

</div>

hi @picsil unfortunately we were never able to resolve the issue. I had even asked the library creator for any direction, but no luck there since they didn’t have the hardware to test on. What we ended up doing was using the I2C bus on the Boron to communicate to a Adafruit ItsyBitsy M0 and are using SPI on the ItsyBitsy board to drive the screen. It has been working great for our application and allows us to still display some messages when the boron is updating and allows us to display a splash screen before the Boron is up. From my experience Boron takes about 6 secs to fire up and display a screen message. Going this route we were able to get the splash screen up in 1 sec. Please let me know if you do ever resolve as I would still be curious as to the fix, but for us integrating the 2nd board added some functionality that turned out to be useful for interacting with a display. Link to other board used: [https://www.adafruit.com/product/3727](https://www.adafruit.com/product/3727) Looks like currently out of stock at Adafruit, but there are other distributors that have them in stock. Please let me know if you have any other questions.

-Matt

---

<div class="post-metadata">

**Author:** ![picsil](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/picsil/32/21737_2.png) [@picsil](https://community.particle.io/u/picsil)\
**Post date:** [May 16, 2019, 2:16am UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/17 "2019-05-16T02:16:15Z")

</div>

Thanks Matt. I’m attempting to get the debugger working so I can step through the code. Not having much luck so far with the debugger in Workbench, but that’s another issue. If I find a solution I’ll post it to the community.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [May 16, 2019, 7:49am UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/18 "2019-05-16T07:49:05Z")

</div>

> [@picsil](#):
>
> Not having much luck so far with the debugger in Workbench, but that’s another issue.

Could it be that you are running into this issue?

> [@\[ISSUE\] Failed to launch OpenOCD GDB Server: Timeout](https://community.particle.io/t/issue-failed-to-launch-openocd-gdb-server-timeout/49725):
>
> hey all wave it seems the extension we depend on to drive debugging - cortex-debug - released an update this morning that broke our integration ([details here](https://github.com/Marus/cortex-debug/issues/166)). if you are using v0.2.4 of the Cortext Debug (one of Particle Workbench’s extension dependencies), debugging will not work. [38%20AM] we’ll be working to get a fix out ASAP but in the meantime, the work-around is to use VSCode’s “Install Another Version” option to revert the “Cortex Debug” extension back to v0.2.3: From VSCode’s m…

---

<div class="post-metadata">

**Author:** ![picsil](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/picsil/32/21737_2.png) [@picsil](https://community.particle.io/u/picsil)\
**Post date:** [May 16, 2019, 3:15pm UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/19 "2019-05-16T15:15:22Z")

</div>

Thank you @ScruffR, that was exactly the problem. Not sure why I didn’t find that post in my search, but thanks. Now that the debugger is working, I’m looking into the u8g2 crash.

---

<div class="post-metadata">

**Author:** ![shonky2](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shonky2](https://community.particle.io/u/shonky2)\
**Post date:** [May 16, 2019, 3:30pm UTC](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318/20 "2019-05-16T15:30:08Z")

</div>

@picsil I’m looking forward to what you uncover.

[Next page](https://community.particle.io/t/particle-boron-new-haven-oled-display-issue/48318.md?page=2)
