Skip to content
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

Closed
3 tasks done
bozzerjoseph opened this issue Oct 14, 2022 · 6 comments
Closed
3 tasks done

Checksum verification fails when uploading to XIAO board #1560

bozzerjoseph opened this issue Oct 14, 2022 · 6 comments
Assignees
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@bozzerjoseph
Copy link

bozzerjoseph commented Oct 14, 2022

Describe the problem

If in this line of writing in the dac I write int in front of valeuraenvoyer .. the sketch is compiled and uploaded into my arduino XIAO without problem

// Calculation of the value corresponding to the desired voltage at the output of the DAC and its shipment
  int Valeuraenvoyer = tensionvoulueensortie * 1024/3.3;

On 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:

Write 44392 bytes to flash (694 pages)

[==] 9% (64/694 pages)
[=====] 18% (128/694 pages)
[======= "27% (192/694 pages)
[==========/36% (256/694 pages)
[============== "(320/694 pages)
[================= "(384/694 pages)
[===================== "(448/694 pages)
[=======================/73% (512/694 pages)
[=========================/82% (576/694 pages)
[============================= "(640/694 pages)
[=============================/100% (694/694 pages)
Done in 0.256 seconds

VERIFY 44392 bytes of flash with checksum.
VERIFY FAILED
Failed Uploading: Uploading Error: Exit Status 2

To reproduce

If I place int i can upload into my arduino..... Immediately I replace it with float and I have a mistake! ... Imediatement I put back int and everything is fine ... I put it back and I have mistakes again

Expected 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

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@bozzerjoseph bozzerjoseph added the type: imperfection Perceived defect in any part of project label Oct 14, 2022
@per1234
Copy link
Contributor

per1234 commented Oct 14, 2022

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:

https://forum.arduino.cc/

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2022
@per1234 per1234 self-assigned this Oct 14, 2022
@per1234 per1234 added the conclusion: off topic Off topic for this repository label Oct 14, 2022
@per1234 per1234 changed the title Strange problem Checksum verification fails when uploading to XIAO board Oct 14, 2022
@bozzerjoseph
Copy link
Author

bozzerjoseph commented Oct 14, 2022 via email

@per1234
Copy link
Contributor

per1234 commented Oct 14, 2022

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.

@bozzerjoseph
Copy link
Author

I tried the same sketch with arduino 1.8.19 and i don't have the problem

@arduino arduino locked as off-topic and limited conversation to collaborators Oct 14, 2022
@per1234 per1234 added topic: code Related to content of the project itself and removed conclusion: off topic Off topic for this repository labels Oct 15, 2022
@per1234
Copy link
Contributor

per1234 commented Oct 15, 2022

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:

Le croquis utilise 43724 octets (16%) de l'espace de stockage de programmes. Le maximum est de 262144 octets.
Redémarrage forcé en cours en 1200bps ouvert/fermé sur le port /dev/cu.usbmodem14344201
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
PORTS {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } / {/dev/cu.APPLE-WirelessiAP, /dev/cu.Bluetooth-Incoming-Port, /dev/cu.usbmodem14344201, /dev/tty.APPLE-WirelessiAP, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.usbmodem14344201, } => {}
Uploading using selected port: /dev/cu.usbmodem14344201
/Users/joseph/Library/Arduino15/packages/Seeeduino/tools/bossac/1.7.0-arduino3/bossac -i -d --port=cu.usbmodem14344201 -U true -i -e -w -v /var/folders/fp/jfzrnvjx6dj86vy0zj9v44xh0000gn/T/arduino_build_669343/MAPPER-XIA0-vers11-14-octobre.ino.bin -R 
Set binary mode
readWord(addr=0)=0x20002dd8
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v1.1 [Arduino:XYZ] Nov 27 2019 16:35:59
chipId=0x10010005
Connected at 921600 baud
readWord(addr=0)=0x20002dd8
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Atmel SMART device 0x10010005 found
write(addr=0x20004000,size=0x34)
writeWord(addr=0x20004030,value=0x10)
writeWord(addr=0x20004020,value=0x20008000)
Device       : ATSAMD21G18A
readWord(addr=0)=0x20002dd8
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Chip ID      : 10010005
version()=v1.1 [Arduino:XYZ] Nov 27 2019 16:35:59
Version      : v1.1 [Arduino:XYZ] Nov 27 2019 16:35:59
Address      : 8192
Pages        : 3968
Page Size    : 64 bytes
Total Size   : 248KB
Planes       : 1
Lock Regions : 16
Locked       : readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
none
readWord(addr=0x41004018)=0
Security     : false
Boot Flash   : true
readWord(addr=0x40000834)=0x7000a
BOD          : true
readWord(addr=0x40000834)=0x7000a
BOR          : true
Arduino      : FAST_CHIP_ERASE
Arduino      : FAST_MULTI_PAGE_WRITE
Arduino      : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
chipErase(addr=0x2000)
done in 0.869 seconds

Write 44392 bytes to flash (694 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x2000, size=0x1000)
[==                            ] 9% (64/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0x1000)
[=====                         ] 18% (128/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0x1000)
[========                      ] 27% (192/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x5000, size=0x1000)
[===========                   ] 36% (256/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x6000, size=0x1000)
[=============                 ] 46% (320/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x7000, size=0x1000)
[================              ] 55% (384/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x8000, size=0x1000)
[===================           ] 64% (448/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x9000, size=0x1000)
[======================        ] 73% (512/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0xa000, size=0x1000)
[========================      ] 82% (576/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0xb000, size=0x1000)
[===========================   ] 92% (640/694 pages)write(addr=0x20005000,size=0xd80)
writeBuffer(scr_addr=0x20005000, dst_addr=0xc000, size=0xd80)
[==============================] 100% (694/694 pages)
done in 0.261 seconds

Verify 44392 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = e455
checksumBuffer(start_addr=0x3000, size=0x1000) = c8a0
checksumBuffer(start_addr=0x4000, size=0x1000) = b5ff
checksumBuffer(start_addr=0x5000, size=0x1000) = 8811
checksumBuffer(start_addr=0x6000, size=0x1000) = 431c
checksumBuffer(start_addr=0x7000, size=0x1000) = 1588
checksumBuffer(start_addr=0x8000, size=0x1000) = c6cc
checksumBuffer(start_addr=0x9000, size=0x1000) = 3776
checksumBuffer(start_addr=0xa000, size=0x1000) = bef0
checksumBuffer(start_addr=0xb000, size=0x1000) = 73b0
checksumBuffer(start_addr=0xc000, size=0xd68) = 37b
Verify successful
done in 0.056 seconds
CPU reset.
readWord(addr=0)=0x20002dd8
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
writeWord(addr=0xe000ed0c,value=0x5fa0004)

Arduino IDE 2.x

Le croquis utilise 43724 octets (16%) de l'espace de stockage de programmes. Le maximum est de 262144 octets.
Performing 1200-bps touch reset on serial port /dev/cu.usbmodem14344201
Waiting for upload port...
Upload port found on /dev/cu.usbmodem14344201
"/Users/joseph/Library/Arduino15/packages/Seeeduino/tools/bossac/1.7.0-arduino3/bossac" -i -d --port=cu.usbmodem14344201 -U true -i -e -w -v "/private/var/folders/fp/jfzrnvjx6dj86vy0zj9v44xh0000gn/T/arduino-sketch-4D87AD5561460E1EBBD867038AD312E6/MAPPER-XIA0-vers11-14-octobre.ino.bin" -R
Set binary mode
readWord(addr=0)=0x20002dd8
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
version()=v1.1 [Arduino:XYZ] Nov 27 2019 16:35:59
chipId=0x10010005
Connected at 921600 baud
readWord(addr=0)=0x20002dd8
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Atmel SMART device 0x10010005 found
write(addr=0x20004000,size=0x34)
writeWord(addr=0x20004030,value=0x10)
writeWord(addr=0x20004020,value=0x20008000)
Device       : ATSAMD21G18A
readWord(addr=0)=0x20002dd8
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
Chip ID      : 10010005
version()=v1.1 [Arduino:XYZ] Nov 27 2019 16:35:59
Version      : v1.1 [Arduino:XYZ] Nov 27 2019 16:35:59
Address      : 8192
Pages        : 3968
Page Size    : 64 bytes
Total Size   : 248KB
Planes       : 1
Lock Regions : 16
Locked       : readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
readWord(addr=0x41004020)=0xffff
none
readWord(addr=0x41004018)=0
Security     : false
Boot Flash   : true
readWord(addr=0x40000834)=0x7000a
BOD          : true
readWord(addr=0x40000834)=0x7000a
BOR          : true
Arduino      : FAST_CHIP_ERASE
Arduino      : FAST_MULTI_PAGE_WRITE
Arduino      : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
chipErase(addr=0x2000)
done in 0.867 seconds

Write 44392 bytes to flash (694 pages)
write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x2000, size=0x1000)

[==                            ] 9% (64/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0x1000)

[=====                         ] 18% (128/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0x1000)

[========                      ] 27% (192/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x5000, size=0x1000)

[===========                   ] 36% (256/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x6000, size=0x1000)

[=============                 ] 46% (320/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x7000, size=0x1000)

[================              ] 55% (384/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x8000, size=0x1000)

[===================           ] 64% (448/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0x9000, size=0x1000)

[======================        ] 73% (512/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0xa000, size=0x1000)

[========================      ] 82% (576/694 pages)write(addr=0x20005000,size=0x1000)
writeBuffer(scr_addr=0x20005000, dst_addr=0xb000, size=0x1000)

[===========================   ] 92% (640/694 pages)write(addr=0x20005000,size=0xd80)
writeBuffer(scr_addr=0x20005000, dst_addr=0xc000, size=0xd80)

[==============================] 100% (694/694 pages)
done in 0.259 seconds

Verify 44392 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = 9ef8
checksumBuffer(start_addr=0x3000, size=0x1000) = 289e
checksumBuffer(start_addr=0x4000, size=0x1000) = d2af
checksumBuffer(start_addr=0x5000, size=0x1000) = 238e
checksumBuffer(start_addr=0x6000, size=0x1000) = bb84
checksumBuffer(start_addr=0x7000, size=0x1000) = 1f77
checksumBuffer(start_addr=0x8000, size=0x1000) = 803d
checksumBuffer(start_addr=0x9000, size=0x1000) = 900c
checksumBuffer(start_addr=0xa000, size=0x1000) = 38c5
checksumBuffer(start_addr=0xb000, size=0x1000) = f298
Verify failed
Failed uploading: uploading error: exit status 2

I tried uploading the same problem sketch with the same Seeeduino:samd:seeed_XIAO_m0 board definition with the same Seeeduino:samd@1.8.3 platform version to my ATSAMD21G18 board. The upload is successful.

#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.

@per1234 per1234 reopened this Oct 15, 2022
@per1234 per1234 removed their assignment Oct 15, 2022
@per1234
Copy link
Contributor

per1234 commented Oct 17, 2022

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.

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2022
@per1234 per1234 added the conclusion: invalid Issue/PR not valid label Oct 17, 2022
@per1234 per1234 self-assigned this Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants