I am using a Nano 33 BLE. It was connected to a ST7796s TFT, which I got working with assistance from @david_prentice - thank you David. However, Part of the code just refused to work, and then the SD card failed to read, and then it refused to upload a new sketch.
So I took the Nano out and inserted it into another breadboard with a set of LEDs connected to pins D2-D12 and used the following sketch, intending to find out if I'd shorted a pin:
void setup()
{
Serial.begin(9600);
Serial1.begin(115200);
Serial1.println("started");
pinMode(D12, OUTPUT);
pinMode(D11, OUTPUT);
pinMode(D10, OUTPUT);
pinMode(D9, OUTPUT);
pinMode(D8, OUTPUT);
pinMode(D7, OUTPUT);
pinMode(D6, OUTPUT);
pinMode(D5, OUTPUT);
pinMode(D4, OUTPUT);
pinMode(D3, OUTPUT);
pinMode(D2, OUTPUT);
Serial1.println("end of setup()");
}
void setLEDs(int fadeValue)
{
Serial1.println(fadeValue);
analogWrite(D12, fadeValue);
Serial1.println("D12");
analogWrite(D11, fadeValue);
Serial1.println("D11");
analogWrite(D10, fadeValue);
Serial1.println("D10");
analogWrite(D9, fadeValue);
Serial1.println("D9");
analogWrite(D8, fadeValue);
Serial1.println("D8");
analogWrite(D6, fadeValue);
Serial1.println("D7");
analogWrite(D6, fadeValue);
Serial1.println("D6");
analogWrite(D5, fadeValue);
Serial1.println("D5");
analogWrite(D4, fadeValue);
Serial1.println("D4");
analogWrite(D3, fadeValue);
Serial1.println("D3");
analogWrite(D2, fadeValue);
Serial1.println("D2");
}
void loop()
{
int startIndex = 1;
for (int fadeValue = startIndex ; fadeValue <= 255; fadeValue += 5)
{
setLEDs(fadeValue);
delay(30);
}
// fade out from max to min in increments of 5 points:
for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5)
{
setLEDs(fadeValue);
delay(30);
}
}
Double-clicking the reset pin enabled me to upload this sketch, but the LEDs didn't light up. I checked the wiring, that was fine. The programmable LED on the Nano itself was sat pulsing, four slow, four fast.... repeat. I edited the code so that only the LED on pin D2 faded in/out. Doing the reset double-click enabled that to upload and it worked. I uncommented the code for the other LEDs connected to the D pins, did the double-click reset and ... nothing.
I googled and found: Arduino Nano 33 BLE damaged? - Nano 33 BLE - Arduino Forum
*Lesson 1: Google works and the chances of my problem being unique are small. *
I hooked up my Mega2560 as suggested in the post and edited my sketch to the version shown above - simply rerouting all the Serial.println calls to Serial1.println. After double-click resetting and uploading, then pointing the serial monitor to the output from the Mega2560, I got the following output:
started
end of setup()
1
D12
D11
D10
D9
++ MbedOS Error Info ++
Error Status: 0x80FF0144 Code: 324 Module: 255
Error Message: Assertion failed: result == NRFX_SUCCESS
Locati1 aTGRw1au:xt 0M20 v:srtN-o
The output is as expected right until the MbedOS error. Does that mean pin D8 is broken? Well, no. If I comment out the analogWrite call for pin D12, the output shows D8, and the LEDs connected to pins D8-D11 fade in and out. The diagnostic works fine, unless I call analogWrite on more than 4 pins.
Each attempt shows different values on the final line of the MbedOS error info, but the rest is the same. Going back to Google shows that the error code maps to the lower part of the error status - and decimal 324 is hex 0144. This turns out to be "Assertion failed", backing up the error message on the second line. I've not been able to find out what module has an ID 255, or what NRFX_SUCCESS represents.
So:
- Does anyone know what 255 refers to in the module code? Basically, just how badly have I broken this thing?
- Is there any chance this is recoverable? It seems a shame to bin what's at least a partly-working board, but it's not like they're expensive and I need to consider how much effort is worthwhile.
Thanks for reading this.
Ian.
1. Connect the USB cable of the programmer to your computer.