Comments (13)
It looks like neither the auto tools nor Cmake deals with the default_spi
port.
It may be as simple as adding set(DEFAULT_SPI_PORT "/dev/spidev0.0")
here:
And DEFAULT_SPI_PORT="/dev/spidev0.0"
here:
from avrdude.
Try installing libgpiod-dev and the rebuild avrdue to use libgpiod instead
from avrdude.
Apparently new kernel versions base the GPIO numbers at 512, not 0. So, another workaround is to add 512 to the gpio numbers of your linuxgpio entry in ~/.avrduderc.
from avrdude.
@BastienCagna It's been some time. Has your question been answered? Can the issue be closed?
from avrdude.
Hey,
Thanks for your answers @stefanrueger !
Sorry I didn't work oon this project since my post. I guess I fixed the issue I was describing using libgpio. But now, it's looks like avrdude can not communicate with the MCU. Whe I execute the following command (which just worked few minutes ago on raspberry pi 3B), it says that the MCU is not responding :(
sudo /usr/local/bin/avrdude -p t2313 -c linuxgpio -P gpiochip0 -U flash:w:test.hex -v
avrdude: Version 7.3-20240428 (37ac6eba)
Copyright the AVRDUDE authors;
see https://github.com/avrdudes/avrdude/blob/main/AUTHORS
System wide configuration file is /usr/local/etc/avrdude.conf
User configuration file is /root/.avrduderc
User configuration file does not exist or is not a regular file, skipping
using libgpiod for linuxgpio
Using port : gpiochip0
Using programmer : linuxgpio
avrdude: input file test.hex auto detected as Intel Hex
AVR Part : ATtiny2313
Programming modes : ISP, HVPP, debugWIRE, SPM
Programmer Type : linuxgpio
Description : Use the Linux sysfs interface to bitbang GPIO lines
Pin assignment : libgpiod
RESET = 22
SCK = 11
SDO = 10
SDI = 9
avrdude bitbang_initialize() error: AVR device not responding
avrdude main() error: initialization failed, rc=-1
- double check the connections and try again
- use -B to set lower the bit clock frequency, e.g. -B 125kHz
- use -F to override this check
avrdude done. Thank you.
It tried to change baudrate (-B 100) but it also failed.
I also tried with gpiochip4 but same error.
Also, here is the state of pinctrl just after trying to flash:
$ pinctrl
0: ip pu | hi // ID_SDA/GPIO0 = input
1: ip pu | hi // ID_SCL/GPIO1 = input
2: no pu | -- // GPIO2 = none
3: no pu | -- // GPIO3 = none
4: no pu | -- // GPIO4 = none
5: no pu | -- // GPIO5 = none
6: no pu | -- // GPIO6 = none
7: no pu | -- // GPIO7 = none
8: no pu | -- // GPIO8 = none
9: ip pd | lo // GPIO9 = input
10: ip pd | lo // GPIO10 = input
11: ip pd | lo // GPIO11 = input
12: no pd | -- // GPIO12 = none
13: no pd | -- // GPIO13 = none
14: no pd | -- // GPIO14 = none
15: no pd | -- // GPIO15 = none
16: no pd | -- // GPIO16 = none
17: no pd | -- // GPIO17 = none
18: no pd | -- // GPIO18 = none
19: no pd | -- // GPIO19 = none
20: no pd | -- // GPIO20 = none
21: no pd | -- // GPIO21 = none
22: ip pd | lo // GPIO22 = input
23: no pd | -- // GPIO23 = none
24: no pd | -- // GPIO24 = none
25: no pd | -- // GPIO25 = none
26: op dh pd | hi // GPIO26 = output
27: no pd | -- // GPIO27 = none
...
I then tried to set mannualy the pin to their needed function (using a0 for GPIO9 10 & 11 et setting 22 to ouput and high logical state). avrdude looks to not change those state and not reset is seen on the MCU.
I have no ~/.avrduderc but I guess it is equivalent to the global configuration made in avrdude.conf. So your workaround is to specify SCK = 512 + 11 = 523 ? For me it failed (but as I said, the first problem looks already fixed now for me).
If it may help, Here is a sample of my avrdude.conf (by the way, the empty default spi suprised me):
#
# Overall avrdude defaults; suitable for ~/.config/avrdude/avrdude.rc
#
default_parallel = "/dev/parport0";
default_serial = "/dev/ttyS0";
default_spi = "";
# default_baudrate = 115200;
# default_bitclock = 2.5;
default_linuxgpio = "gpiochip4";
allow_subshells = no;
# This programmer bitbangs GPIO lines using the Linux libgpiod or 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.
#
#
# #------------------------------------------------------------
# # linuxgpio
# #------------------------------------------------------------
#
programmer
id = "linuxgpio";
desc = "Use the Linux sysfs interface to bitbang GPIO lines";
type = "linuxgpio";
prog_modes = PM_ISP;
connection_type = linuxgpio;
reset = 22;
sck = 11;
sdo = 10;
sdi = 9;
;
from avrdude.
@BastienCagna The short of it is that I don't have an answer. This requires more debugging. The posted run looks like libgpiod
is compiled in and working; you are using the latest git-main. You tried -P gpiochip0
and also -P gpiochip4
(which seems to be suggested by the build system judging from your system avrdude.conf). You say it works with an RPi 3b. Is the failing run on an RPi 5? Have you installed libgpiod-dev
and compiled avrdude on the RPi 5? @mcuee can you reproduce above? @BastienCagna Can you post a -vv
output and upload the output of a -vvvv
run?
the empty default spi suprised me
@BastienCagna If you know a method to set default_spi
from the build system please let us know. @mcuee? @MCUdude?
from avrdude.
@stefanrueger and @BastienCagna
I do not have Raspberry Pi 5, but libgpiod and git main work well for me on my Raspberry Pi 400. I have no idea why it does not work on Raspberry Pi 5.
I can only suggest @BastienCagna to check the connection. The other suggestion is to try linuxspi as well to see if that works or not. Or try another MCU to see if that makes a difference or not.
Reference: my test results posted for PR #1792.
from avrdude.
It may be as simple as adding ...
@MCUdude Great idea! Do you want to do a PR?
from avrdude.
Not so sure if this helps.
- openocd-org/openocd@ad87fbd
- https://github.com/openocd-org/openocd/blob/ad87fbd1cf28760795c4e18f3318a2d720e5a8a6/tcl/interface/raspberrypi-gpio-connector.cfg
from avrdude.
@BastienCagna
Any updates on this issue? Thanks.
from avrdude.
It may be as simple as adding ...
@MCUdude Great idea! Do you want to do a PR?
Adding enhancement
label to capture this one.
from avrdude.
Do we have an update on this? @BastienCagna Have you solved the problem and want to share the solution?
Other than that I suggest closing the issue in a week or so
from avrdude.
Any updates? If not we will close the issue.
from avrdude.
Related Issues (20)
- Parallel port silently not working HOT 9
- No way to set fuses for ATTiny 1626 / UPDI ? HOT 1
- Bootrow r/w does not work for `-c serialupdi` HOT 7
- Terminal erase command HOT 8
- JTAGICE3 EDBG communication mode relies on hardcoded USBVID HOT 7
- Unable to flash using Avrdude on a 14'' M1 Macbook Pro HOT 2
- JTAG2UPDI: avrdude error: cannot find programmer id jtag2updi HOT 3
- Auto-build avrdude.pdf from texinfo sources HOT 4
- Correct part is not necessarily listed first when establishing connection HOT 7
- avr_opcodes.c: conflicting types for โop16_is_mnemoโ due to enum/integer mismatch HOT 1
- avrdude documentation typo(s) attemps HOT 1
- Unable to write LOCK bit byte to JTAG3_TPI HOT 3
- Does avrdude *have to* run as root in Linux for `-c xplainedmini_updi` (jtag3)? HOT 3
- Unexpected auto-erase consequences HOT 7
- `-E reset` and `-E noreset` support for the USBasp programmer
- Writing BOOTROW for Curiosity Nano HOT 3
- No programmers available
- winbond 25q64fv HOT 2
- AVR32 support HOT 5
- [MacOS] Avrdude built using autotools doesn't work HOT 22
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avrdude.