Hello,
I have create a partition for using QSPI as USB Mass Storage.
I can read file, I can list directory and I can also write a file in the setup() method:
mbed::BlockDevice *raw_qspi = mbed::BlockDevice::get_default_instance();
mbed::FATFileSystem ota("ota");
mbed::MBRBlockDevice ota_data(raw_qspi, 2);
ota.mount(&ota_data);
FILE *f = fopen("/ota/settings.txt", "w");
fprintf(f, "%d\n", 0);
fprintf(f, "%d\n", 0);
fprintf(f, "%d\n", 1500);
fprintf(f, "%d\n", 0);
fprintf(f, "%d\n", 1);
fprintf(f, "%d\n", 0);
fprintf(f, "%s\n", machineId);
fflush(f);
fclose(f);
writeLcd("ACME");
What happen is that when someone push a button I want to write again all the data above, but as soon as I run the same code above the Arduino GIGA crashes (blink red led).
Of course this happen inside the loop function.
This is driving me crazy, any advice is much appreciated!
thank you