I'm migrating my software from C2 to C4 (Ubuntu 18.04/Kernel 3.16 to Ubuntu 20.04/Kernel 4.9).
One of the modules read the GPIO using wiringPi to get the state of the buttons and also the push encoder.
I can read the buttons, ie (simplied code):
Code: Select all
#define ENC_SW 6 //Pin 22 on C2
#define SW1 0 //Pin 11 on C2
#define SW2 1 //Pin 12 on C2
#define SW3 2 //Pin 13 on C2
#define SW4 3 //Pin 15 on C2
#define SW5 4 //Pin 16 on C2
#define SW6 5 //Pin 18 on C2
...
auxButton[0] = digitalRead(ENC_SW);
auxButton[1] = digitalRead(SW1);
auxButton[2] = digitalRead(SW2);
auxButton[3] = digitalRead(SW3);
auxButton[4] = digitalRead(SW4);
auxButton[5] = digitalRead(SW5);
auxButton[6] = digitalRead(SW6);
Code: Select all
if (wiringPiISR(13, INT_EDGE_BOTH, &enc_Generic_Interrupt) < 0)
{
printf( "Unable to setup ISR: %s\n", strerror(errno));
}
Code: Select all
wiringPiISR: unable to open /sys/class/gpio/gpio485/direction: No such file or directory
lsmod
Code: Select all
Module Size Used by
fuse 110592 2
squashfs 49152 0
cpufreq_ondemand 20480 0
cpufreq_powersave 16384 0
cpufreq_userspace 16384 0
cpufreq_conservative 16384 0
rtl8xxxu 114688 0
i2c_meson_master 20480 0
amvdec_ports 196608 0
sch_fq_codel 20480 6
amvdec_vp9 122880 0
amvdec_vc1 65536 0
amvdec_real 45056 0
amvdec_mmpeg4 40960 0
amvdec_mpeg4 65536 0
amvdec_mpeg12 106496 0
amvdec_mmjpeg 28672 0
amvdec_mjpeg 40960 0
amvdec_h265 147456 0
amvdec_h264mvc 57344 0
amvdec_mh264 159744 0
amvdec_h264 147456 0
amvdec_avs 69632 0
stream_input 180224 9 amvdec_h265,amvdec_mh264,amvdec_h264mvc,amvdec_ports,amvdec_real,amvdec_vp9,amvdec_h264,amvdec_mpeg12,amvdec_avs
decoder_common 188416 15 amvdec_h265,amvdec_mjpeg,amvdec_mh264,amvdec_mmpeg4,amvdec_h264mvc,amvdec_mmjpeg,amvdec_ports,amvdec_real,stream_input,amvdec_vp9,amvdec_h264,amvdec_mpeg12,amvdec_avs,amvdec_vc1,amvdec_mpeg4
firmware 28672 15 amvdec_h265,amvdec_mjpeg,amvdec_mh264,amvdec_mmpeg4,amvdec_h264mvc,amvdec_mmjpeg,decoder_common,amvdec_real,stream_input,amvdec_vp9,amvdec_h264,amvdec_mpeg12,amvdec_avs,amvdec_vc1,amvdec_mpeg4
media_clock 45056 10 amvdec_h265,amvdec_mh264,decoder_common,amvdec_ports,firmware,stream_input,amvdec_vp9,amvdec_h264,amvdec_mpeg12,amvdec_avs
ip_tables 28672 0
x_tables 49152 1 ip_tables
ipv6 466944 44
spidev 20480 2
spi_meson_spicc 20480 0
Code: Select all
+-----+-----+---------+------+---+--- C4 ---+---+------+---------+-----+-----+
| I/O | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | I/O |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| | | 3.3V | | | 1 || 2 | | | 5V | | |
| 493 | 8 | SDA.2 | ALT1 | 1 | 3 || 4 | | | 5V | | |
| 494 | 9 | SCL.2 | ALT1 | 1 | 5 || 6 | | | 0V | | |
| 481 | 7 | IO.481 | IN | 1 | 7 || 8 | 1 | ALT1 | TxD1 | 15 | 488 |
| | | 0V | | | 9 || 10 | 1 | ALT1 | RxD1 | 16 | 489 |
| 479 | 0 | IO.479 | IN | 0 | 11 || 12 | 0 | IN | IO.492 | 1 | 492 |
| 480 | 2 | IO.480 | IN | 0 | 13 || 14 | | | 0V | | |
| 483 | 3 | IO.483 | IN | 0 | 15 || 16 | 0 | IN | IO.476 | 4 | 476 |
| | | 3.3V | | | 17 || 18 | 0 | IN | IO.477 | 5 | 477 |
| 484 | 12 | MOSI | ALT4 | 0 | 19 || 20 | | | 0V | | |
| 485 | 13 | MISO | ALT4 | 1 | 21 || 22 | 1 | IN | IO.478 | 6 | 478 |
| 487 | 14 | SLCK | ALT4 | 0 | 23 || 24 | 1 | OUT | SS | 10 | 486 |
| | | 0V | | | 25 || 26 | 0 | IN | IO. 23 | 11 | 433 |
| 474 | 30 | SDA.3 | ALT2 | 1 | 27 || 28 | 1 | ALT2 | SCL.3 | 31 | 475 |
| 490 | 21 | IO.490 | OUT | 0 | 29 || 30 | | | 0V | | |
| 491 | 22 | IO.491 | OUT | 0 | 31 || 32 | 0 | OUT | IO. 24 | 26 | 434 |
| 482 | 23 | IO.482 | IN | 0 | 33 || 34 | | | 0V | | |
| 495 | 24 | IO.495 | OUT | 0 | 35 || 36 | 0 | OUT | IO. 22 | 27 | 432 |
| | 25 | AIN.2 | | | 37 || 38 | | | 1V8 | 28 | |
| | | 0V | | | 39 || 40 | | | AIN.0 | 29 | |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| I/O | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | I/O |
+-----+-----+---------+------+---+--- C4 ---+---+------+---------+-----+-----+
Additional info:
This problem it's pretty similar/the same that the reported in
viewtopic.php?t=31904
If I call
Code: Select all
wiringPiISR(7, INT_EDGE_BOTH, &enc_Generic_Interrupt) ;
Code: Select all
if (wiringPiISR(13, INT_EDGE_BOTH, &enc_Generic_Interrupt) < 0) ...
Code: Select all
if (wiringPiISR(14, INT_EDGE_BOTH, &enc_Generic_Interrupt) < 0)...
I've tried by adding:
Code: Select all
blacklist w1_gpio
blacklist wire
but it didnt solve it.
Thanks in advance,
Sebas