summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG7
-rwxr-xr-xexample/ice4pi_prog21
2 files changed, 13 insertions, 15 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 6af173f..602c597 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,10 @@
+ice4pi (2.4.2) bookworm; urgency=medium
+
+ * Fixed bug introduced in previous version using GPIO23(PIN16) instead of GPIO24(PIN18)
+ * Replaced deprecated /sysfs gpio interface with gpiod gpioset and gpioget commands
+
+ -- Vladimir Vassilev <vladimir@lightside-instruments.com> Tue, 07 May 2024 15:43:40 +0200
+
ice4pi (2.4.1) bookworm; urgency=medium
* Since in Pi 5 the GPIO /sysfs numbers are different added check auto selection
diff --git a/example/ice4pi_prog b/example/ice4pi_prog
index 5e1f23c..9e90f7c 100755
--- a/example/ice4pi_prog
+++ b/example/ice4pi_prog
@@ -1,25 +1,16 @@
#!/bin/bash
-
-if [ $(grep -c "Raspberry Pi 5" /proc/device-tree/model) -eq 1 ]
-then
- echo "Programming from Raspberry Pi 5"
- sys_gpio_num=423
-else
- echo "Programming NOT from Raspberry Pi 5 (assuming 2-4 + zero)"
- sys_gpio_num=23
-fi
-
-echo ${sys_gpio_num} > /sys/class/gpio/export || true
-echo out > /sys/class/gpio/gpio${sys_gpio_num}/direction
-echo 1 >/sys/class/gpio/gpio${sys_gpio_num}/value
+gpioset `gpiofind GPIO24`=1
sleep 1
-echo 0 >/sys/class/gpio/gpio${sys_gpio_num}/value
+gpioset `gpiofind GPIO24`=0
tr '\0' '\377' < /dev/zero | dd bs=1M count=4 of=image iflag=fullblock
dd if=${1} conv=notrunc of=image
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=20000 -w image
#workaround first time fails after initial programming
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=20000 -w image
-echo 1 >/sys/class/gpio/gpio${sys_gpio_num}/value
+gpioset `gpiofind GPIO24`=1
+sleep 1
+gpioget `gpiofind GPIO24`
+gpioget `gpiofind GPIO25`