Forum >FireBeetle system panic when trying to set pinMode()
ArduinoGeneral

FireBeetle system panic when trying to set pinMode()

userHead foodini 2021-08-31 21:30:27 365 Views1 Replies
I've been having far too many inexplicable problems with the FireBeetle and decided to reduce everything down to as simple a situation as I could. I wanted to turn every IO pin on and off about once per second, so I could just see if they even work. Long story short - they don't.

If I run the following, I get a panic when I try to set the pinMode on different pins. If I change the order of calls, the pins cthat cause the panics change. The pins that are commented out are pins that have caused panics in the past, but if I put those same pins at the beginning of the list, they pass and others fail.

What the hell is wrong with this hardware? I get the same behavior from 4 different dev boards.
Code: Select all
#define NUM_PINS 24
int pins[NUM_PINS] = {35, 1, 25, 26, 27, 9, 10, 13, 5, 2, 6, /*7,*/ 8, /*11, 36, */
/*39, 34,*/ 3, 15, 18, 23, 19, 21, 22, 14, 12, 4, 16, 17};
void setup() {
delay(1000);
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(34, OUTPUT);
for(int i=0; i<NUM_PINS; i++) {
Serial.print(i);
Serial.print(" ");
Serial.println(pins[i]);
Serial.flush();
pinMode(pins[i], OUTPUT);
Serial.println("done");
Serial.flush();
delay(250);
}
pinMode(LED_BUILTIN, OUTPUT);
}
bool state = false;
void loop() {
// put your main code here, to run repeatedly:
state = !state;
for(int i=0; i<NUM_PINS; i++) {
//digitalWrite(pins[i], state?HIGH:LOW);
}
digitalWrite(LED_BUILTIN, state?HIGH:LOW);
Serial.println(state);
delay(1000);
}
2021-08-31 21:39:10 What got this started is that a number of pins (9, 36, 39, to name a few) don't work as GPIO pins - at all. None of the four boards I have will blink an LED with:
Code: Select all
void setup() {
pinMode(36, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
}
bool state = false;
void loop() {
state = !state;
digitalWrite(36, state?HIGH:LOW);
digitalWrite(LED_BUILTIN, state?HIGH:LOW);
Serial.println(state);
delay(1000);
}
If there's an explanation that gives me a workaround, I'll be happy to hear it, but it's going to be way outside the bounds of what's normal for Arduino. I think I'd rather just send everything back to Mouser than work with hardware I can't trust.
userHeadPic foodini