-
-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checksum verification fails when uploading to XIAO board #1560
Comments
Hi . Thanks for your interest in this open source project. This issue tracker is only to be used to report bugs or feature requests specific to the project. This topic is more appropriate for the Arduino Forum. I'm sure we will be able to help you out over there: |
Hi
I already posted my problem there and they think it must be a bug in IDE and sent me here because for them replacing int with float is completely normal and allowed... it shouldn't prevent the upload
Regards
|
Thanks. I found it and will proceed with the investigation over there: https://forum.arduino.cc/t/stockage-non-volatil/1038996 If we find it is caused by a defect in the Arduino IDE codebase I will be happy to reopen this. |
I tried the same sketch with arduino 1.8.19 and i don't have the problem |
Unfortunately we did not make any progress in identifying the cause on the forum. I compared the upload command shown in the output from each IDE version used by @bozzerjoseph and they are identical: Arduino IDE 1.8.19:
Arduino IDE 2.x
I tried uploading the same problem sketch with the same #include <FlashStorage.h>
FlashStorage(my_flash_store, int);
int Bchoisi=4;
float tensionEYE3 = 0; // tension mesurée en volt
float tensionEYE3max = 3.3; // excursion maximale de la tension d'entrée
float tensionEYE3atraiter = 0; // tension EYE3 mesurée
float tensionVoulueEnSortie = 0; // Tension souhaitée en sortie du XIA0, exprimée en volts (entre 0 et 5V)
float valeurAenvoyer = 0; // valeur numerique envoyée au DAC
float A = 0;
const int buzzer =1 ; // pine de commande du buzzer
//Choix des pines d'entrée
const int bouton1 = 7; // the number of the RF output 1 = pine 7
const int bouton2 = 8; // the number of the RF output 2 = pîne 8
const int bouton3 = 9; // the number of the RF output 3 = pine 9
const int bouton4 = 10; // the number of the RF output 4 = pine 10
//variables niveau de tension entrés
int etatbouton1 = 0;
int etatbouton2 = 0;
int etatbouton3 = 0;
int etatbouton4 = 0;
// ========================
// Initialisation programme
// ========================
void setup() {
// Initialise la liaison série (arduino nano -> PC)
Serial.begin(9600);
// initialise les pines boutton en mode entrée
pinMode(bouton1, INPUT_PULLUP);
pinMode(bouton2, INPUT_PULLUP);
pinMode(bouton3, INPUT_PULLUP);
pinMode(bouton4, INPUT_PULLUP);
analogReadResolution(12);
analogWriteResolution(10);
pinMode (buzzer,OUTPUT);
}
// =================
// Boucle principale
// =================
void loop() {
// -----------------relecture de Bchoisi dans la flash
Bchoisi= my_flash_store.read();
// ======= CHOIX DE LA COURBE ===============
// --------------- Pour choisir courbe1 ,presser le bouton1
etatbouton1 = digitalRead(7);
if (etatbouton1 == LOW)
{
Bchoisi = 1;
Serial.print(F("Bchoisi par bouton = "));
Serial.print(Bchoisi);
Serial.println("");
// clignotement 1x buzzer
for (int i = 1; i <= 1; i++) {
delay(500);
digitalWrite(buzzer,HIGH);
delay (500);
digitalWrite(buzzer,LOW);
delay (500);
}
}
// --------------- Pour choisir courbe2 ,presser le bouton2
etatbouton2 = digitalRead(8);
if (etatbouton2 == LOW)
{
Bchoisi = 2;
Serial.print(F("Bchoisi par bouton = "));
Serial.print(Bchoisi);
Serial.println("");
// clignotement 2x buzzer
for (int i = 1; i <= 2; i++) {
delay(500);
digitalWrite(buzzer,HIGH);
delay (500);
digitalWrite(buzzer,LOW);
delay (500);
}
}
// --------------- Pour choisir courbe3 ,presser le bouton3
etatbouton3 = digitalRead(9);
if (etatbouton3 == LOW)
{
Bchoisi = 3;
Serial.print(F("Bchoisi par bouton = "));
Serial.print(Bchoisi);
Serial.println("");
// clignotement 3x buzzer
for (int i = 1; i <= 3; i++) {
delay(500);
digitalWrite(buzzer,HIGH);
delay (500);
digitalWrite(buzzer,LOW);
delay (500);
}
}
// ---------------- Pour choisir courbe4 ,presser le bouton4
etatbouton4 = digitalRead(10);
if (etatbouton4 == LOW)
{
Bchoisi = 4;
Serial.print(F("Bchoisi par bouton = "));
Serial.print(Bchoisi);
Serial.println("");
// clignotement 4x buzzer
for (int i = 1; i <= 4; i++) {
delay(500);
digitalWrite(buzzer,HIGH);
delay (500);
digitalWrite(buzzer,LOW);
delay (500);
}
}
// ---------------- memorisation de Bchoisi dans la flash
my_flash_store.write(Bchoisi);
// ======= MESURE SIGNAL,TRAITEMENT ET ENVOI VERS DAC ===============
// ---------------- lecture signal sur la pine A0 en Volt
tensionEYE3 = analogRead(A3);
// conversion en valeur numerique
tensionEYE3atraiter = (tensionEYE3 * 3.3/4096);
// calcul coeficient A
A = tensionEYE3max / pow(tensionEYE3max, Bchoisi);
// calcul de la courbe à sortir
tensionVoulueEnSortie = A * (pow(tensionEYE3atraiter, Bchoisi));
// calcul de la valeur correspondante à la tension voulue en sortie du DAC et son envoi
valeurAenvoyer = tensionVoulueEnSortie * 1024/3.3;
// envoi sur sortie DAC
analogWrite(A0, valeurAenvoyer);
// Nota : la tension souhaitée ici est exprimée en volts (entre 0 et 5V), mais la valeur à transmettre
// pour ce faire doit être comprise entre 0 et 1023. D'où la nécessité de faire une conversion avant tout
} As the problem does not occur when @bozzerjoseph uses Arduino IDE 1.8.19 and does occur when using 2.x, it seems that the IDE is somehow a factor in this checksum failure. Unfortunately I don't have any idea of what that would be and investigating it will be difficult since I can't reproduce the problem. I suspected that the Serial Monitor might somehow be interfering with communications during the upload or verification (along the lines of #375). However, @bozzerjoseph says that the Serial Monitor is not open when the problem occurs. |
Closing as caused by damaged hardware per the discovery on the forum: https://forum.arduino.cc/t/stockage-non-volatil/1038996/141 It may be that a specific area of the flash memory was damaged and a difference in the binary produced by Arduino IDE 2.x happened to occupy that area. Another possibility is that by chance the intermittent fault happened to not occur during the uploads done using Arduino IDE 1.x. |
Describe the problem
If in this line of writing in the dac I write
int
in front ofvaleuraenvoyer
.. the sketch is compiled and uploaded into my arduino XIAO without problemOn the other hand if I write "Float" in front "Valeuraenvoyer" .. The sketch is compiled but impossible to upload it
I have this error without any explanation:
To reproduce
If I place
int
i can upload into my arduino..... Immediately I replace it withfloat
and I have a mistake! ... Imediatement I put backint
and everything is fine ... I put it back and I have mistakes againExpected behavior
I expect to upload my sketch
Arduino IDE version
IDE 2.0.0 date 2022-09-14
Operating system
macOS
Operating system version
Mojave
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: