I’ve discovered a bug that seems to crash the Generic F103C (and I suspect the Maple mini as well, but I’ve not tested it yet)
If you upload an run this, using the bootloader, then upload again, the board will hang just after it gets the reset sequence via Serial USB
[code#include <SPI.h>
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
[/code]
Basically including SPI seems to cause it to crash, yet if you have a full sketch like the ILI9341 graphics test it doesn’t crash when you upload a new version.
BTW. This is a stripped down example, I initially had this
#include <SPI.h>
void setup()
{
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV2); // 8 MHz (full! speed!)
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE0);
unsigned char c;
while (1)
{
Serial.println(SPI.transfer(c++));
delay(100);
}
SPI.end();
}
void loop() {
// put your main code here, to run repeatedly:
}
Serial.begin(9600);
delay(100);#include <SPI.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
delay(100);
}
void loop() {
// put your main code here, to run repeatedly:
}
so a
SPIClass SPI_1(1);This problem may have been in the code for some time. I tested a real sketch and its OK, its just this minimal sketch that fails
However I don’t have time to debug it at the moment. I may have time tomorrow.
But I dont think its an urgent problem as it only occurs when its not a full sketch
[RogerClark – Wed Sep 09, 2015 11:09 am] –
#include <SPI.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
delay(100);
}void loop() {
// put your main code here, to run repeatedly:}
[stevestrong – Tue Jun 20, 2017 7:15 pm] –[RogerClark – Wed Sep 09, 2015 11:09 am] –
#include <SPI.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
delay(100);
}void loop() {
// put your main code here, to run repeatedly:}
This sounds similar


