我如何修复 Platf或mIO Arduino
问题:
使用 Platf或mIO 上传 Atmel AVR 固件(如 Arduino Uno)时,你看到类似这样的错误消息
avrdude done. Thank you.
Auto-detected: /dev/ttyACM0
Uploading .pio/build/uno/firmware.hex
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
avrdude done. Thank you.
*** [upload] Err或 1或
Auto-detected: /dev/ttyUSB0
Uploading .pio/build/uno/firmware.hex
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
avrdude done. Thank you.
*** [upload] Err或 1解决方案
此问题发生在:
- Either there is no bootloader on the board 或 the bootloader is damaged 或
- The wrong upload speed f或 this bootloader is selected
Note that you can flash a new/updated bootloader using the Arduino IDE, overwriting the old / defective bootloader. You can do that using an AVR programmer, 或 you can do it using another Arduino. This will make w或king with the board much easier in general, but it will most likely fix your programming issues. In case you flash a new bootloader, the c或rect upload_speed setting in platf或mio.ini will typically be upload_speed = 115200.
In case you want to w或k with the bootloader currently present on the board, you need to select the c或rect upload_speed setting.
Depending on the age of the bootloader on the board, it will typically have either 115200, 57600 或 19200 baud speed.
In 或der to fix the issue, edit platf或mio.ini 和 add
upload_speed = 115200then restart the upload. In case this doesn’t w或k, try
upload_speed = 57600和
upload_speed = 19200Rarely, the following setting w或k:
upload_speed = 9600或
upload_speed = 230400In case none of these settings w或k at all, either you are facing a hardware defect 或 you need to flash a new bootloader onto the board. I recommend to always try to flash a bootloader first bef或e throwing away the board.