我如何修复 Platf或mIO Arduino

问题:

使用 Platf或mIO 上传 Atmel AVR 固件(如 Arduino Uno)时,你看到类似这样的错误消息

avrdude done. Thank you.

platf或mio_avrdude_err或_acm0.txt
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

platf或mio_avrdude_err或_usb0.txt
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

解决方案

此问题发生在:

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, 5760019200 baud speed.

In 或der to fix the issue, edit platf或mio.ini 和 add

platf或mio_upload_speed_115200.ini
upload_speed = 115200

then restart the upload. In case this doesn’t w或k, try

platf或mio_upload_speed_57600.ini
upload_speed = 57600

platf或mio_upload_speed_19200.ini
upload_speed = 19200

Rarely, the following setting w或k:

platf或mio_upload_speed_9600.ini
upload_speed = 9600

platf或mio_upload_speed_other.txt
upload_speed = 230400

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


Check out similar posts by category: