- 安装avrdude
- 更改配置文件,查找gpio将对应的linuxgpio中相关注释的内容删除123456789101112131415161718192021#This programmer bitbangs GPIO lines using the Linux sysfs GPIO interface##To enable it set the configuration below to match the GPIO lines connected to the#relevant ISP header pins and uncomment the entry definition. In case you don't#have the required permissions to edit this system wide config file put the#entry in a separate <your name>.conf file and use it with -C+<your name>.conf#on the command line.##To check if your avrdude build has support for the linuxgpio programmer compiled in,#use -c?type on the command line and look for linuxgpio in the list. If it's not available#you need pass the --enable-linuxgpio=yes option to configure and recompile avrdude.#programmerid = "linuxgpio";desc = "Use the Linux sysfs interface to bitbang GPIO lines";type = "linuxgpio";reset = 16;sck = 24;mosi = 23;miso = 18;;
note:avrdude配置文件中的IO编号对应的芯片上的管脚编号BCM#,而不是树莓派提供的排针接口的编号
- 使用avrdude下载程序时,选择下载器linuxgpio
- 在使用过程中,常会遇到
Can't export GPIO 16, already exported/busy?: Device or resource busy
的错误,原因尚未搞清楚,可以用如下指令恢复1sudo echo 16 > /sys/class/gpio/unexport