I was in the Arduino forum the other day, in the Portenta section and I read something rather odd about a bit of MBed software. It's called, as I understand it... Serial crash dump.
I have been experimenting with Arduino Portenta and an Adafruit E-Ink display which uses SPI. It wasn't working at all so I wondered if it was that the SPI bus was configured quite as I expected. So I swapped in some alternative pins and was greeted by an unresponsive board that was flashing its red LED. Which seemed quite strange as none of my code referenced the red LED. Must be some kind of dark magic.
Whilst looking around the forums I spotted another who was having the same issue and also got a flashing red light. I also found some code from Jeremy Ellis that promised to crash the Portenta. I wondered how such a simple example could cause a crash. There was one way to find out....
void setup() { } void loop() { analogWrite(A5,128); }
So I uploaded and my red led started flashing. After watching for a few seconds I twigged that it was morse code for SOS. I had already connected a USB to TTL adapter which was on COM4 so I swapped the Arduino Serial monitor to point at that and got the following.
So as the error message suggests the pin selected is not capable of PWM output, we'd need to use D0 to D6 for that.
Reference
Minimal example for SPI
https://github.com/arduino/ArduinoCore-mbed/issues/131
mySPI
https://github.com/arduino/ArduinoCore-mbed/issues/115
Crash example
Top Comments