dbboydRPR
Posts: 9
Joined: Mon Aug 13, 2018 3:32 pm

Interrupts on Pi-ZeroW

Wed Aug 22, 2018 11:03 am

Having looked around the internet quite a lot, I still can't get my head around how to specify an interrupt using device tree overlays.
In my case, I'm adding a MAX14830 board which uses SPI 0 to a Pi Zero W. The basic overlay works, as the driver gets loaded and the device nodes are created in /dev, but I think the interrupt is specified incorrectly as I can't send/receive any data.

snippet from dmesg
[ 16.140236] spi0.0: ttyMAX0 at I/O 0x0 (irq = 163, base_baud = 230400) is a MAX14830
[ 16.168423] spi0.0: ttyMAX1 at I/O 0x20 (irq = 163, base_baud = 230400) is a MAX14830
[ 16.171201] spi0.0: ttyMAX2 at I/O 0x40 (irq = 163, base_baud = 230400) is a MAX14830
[ 16.182962] spi0.0: ttyMAX3 at I/O 0x60 (irq = 163, base_baud = 230400) is a MAX14830

[email protected]:~/ows-gen-5 $ ls -l /dev/ttyM*
crw-rw---- 1 root dialout 204, 209 Aug 21 16:02 /dev/ttyMAX0
crw-rw---- 1 root dialout 204, 210 Aug 21 16:02 /dev/ttyMAX1
crw-rw---- 1 root dialout 204, 211 Aug 21 16:02 /dev/ttyMAX2
crw-rw---- 1 root dialout 204, 212 Aug 21 16:02 /dev/ttyMAX3

I think this proves that the driver is communicating with the MAX14830 over the SPI bus.
Hoowever, I still can't send/receive to the serial ports, whcih make me think that the interrupt definition in the device tree overlay is lacking something

Here is the overlay. This is modified from http://akheh.blogspot.com/2016/06/using ... -pi-3.html, so any errors are mine!

Code: Select all

/dts-v1/;
/plugin/;

/ {
        compatible = "brcm,bcm2835";

        [email protected] {
                target = <&spi0>;
                frag0: __overlay__ {
                        /* needed to avoid dtc warning */
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "okay";

                        max14830_1: [email protected] {
                                compatible = "maxim,max14830";
                                reg = <0>; /* CE0 */
                                clocks = <&klok>;
                                clock-names = "xtal";
                                spi-max-frequency = <12000000>; /* 1MHz */
                                status = "okay";
                                pinctrl-names = "default";
                                pinctrl-0 = <&max14830_pins>;
                                interrupt-parent = <&gpio>;
                                interrupts = <17 0x2>; /* level sensitive, active low */

                                klok: klok {
                                compatible = "fixed-clock";
                                #clock-cells = <0>;
                                clock-frequency = <3686400>;
                                clock-output-name = "klok";
                                };
                        };
                };
        };

        [email protected] {
                target = <&gpio>;
                __overlay__ {
                        max14830_pins: max_14830_pins {
                                brcm,pins = <4>;
                                brcm,function = <0>; /* in */
                                brcm,pull = <0>; /* none */
                        };
                };
        };

        __overrides__ {
                int_pin = <&max14830_1>, "interrupts:0",
                          <&max14830_pins>, "brcm,pins:0";
                speed   = <&max14830_1>, "spi-max-frequency:0";
        };
};

In my application, I'm intending to use PIN 7 of the 40 pin connector for the interrupt from the MAX14830. I think this is GPIO4 (BCM4???).

My suspicion is that this line may be incorrect, but that's only a hunch!

Code: Select all

interrupts = <17 0x2>; /* level sensitive, active low */
Any suggestions on how to proceed to get the interrupt working for this device?

Thanks in addvance.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2480
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Interrupts on Pi-ZeroW

Wed Aug 22, 2018 11:14 am

You are correct - that "interrupts" property also has to change to say "<4 0x2>" (or just "<4 2>") instead of "<17 0x2>". However, the author of the overlay has done all of the work for you by creating a parameter so you don't have to change a thing - just use:

Code: Select all

dtoverlay=max14830,int_pin=4

dbboydRPR
Posts: 9
Joined: Mon Aug 13, 2018 3:32 pm

Re: Interrupts on Pi-ZeroW

Wed Aug 22, 2018 1:04 pm

That was promising...but didn't completely solve the problem unfortunately.

Using a scope I can see that the max14830 is generating interrupts when it receives serial data - so it looks like the device itself is functional. I can also see that when I send data (using 'minicom -D /dev/ttyMAX0') that data is being sent and interrupts are being generated. Indeed, data that is transmitted by the Pi-ZeroW is being received on a PuTTy session on my laptop - progress!!!

However, although the transmit path is working, the receive path is still refusing to co-operate.

Again, when data is sent to the piZero I can see that an interrupt is present on the interface to the Pi, but no data appears in the minicom session.

Could this be to do with the group that the port is in?
crw-rw---- 1 root dialout 204, 209 Aug 21 16:02 /dev/ttyMAX0

Would I be better using some other terminal emulator?

Any other suggestions - so nearly there!

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2480
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Interrupts on Pi-ZeroW

Wed Aug 22, 2018 1:21 pm

File permissions would prevent the ability to open the serial port, not alter the runtime behaviour, so the problem lies somewhere else. There should be nothing special about minicom, but it's worth checking the flow control parameters it is using - "stty -F /dev/ttyMAX0 -a" may help.

1) When receiving data, do the interrupts get deasserted as you would expect?

2) "cat /proc/interrupts" will show a list of interrupt sources and how often they've been active. You should be able to spot the interrupt used by the max14830 - does the use count increase as characters are received?

dbboydRPR
Posts: 9
Joined: Mon Aug 13, 2018 3:32 pm

Re: Interrupts on Pi-ZeroW

Wed Aug 22, 2018 2:26 pm

PhilE

No sure what any of this means, but here is the stty output.

[email protected]:~ $ stty -F /dev/ttyMAX0 -a
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 5;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke -flusho -extproc

I've setup minicom so that hardware and software flow control is set to NO - good shout, as hardware flow control was initially set to YES

I can see the interrupts increasing as characters are sent to the PiZero in /proc/interrupts, and also when the PiZero transmits data from minicom. This is occuring on the interrupt number reported by dmesg - so that's looking ok

[email protected]:~ $ cat /proc/interrupts
CPU0
17: 289 ARMCTRL-level 1 Edge 2000b880.mailbox
18: 2 ARMCTRL-level 2 Edge VCHIQ doorbell
27: 14343 ARMCTRL-level 35 Edge timer
40: 0 ARMCTRL-level 48 Edge bcm2708_fb dma
42: 0 ARMCTRL-level 50 Edge DMA IRQ
44: 0 ARMCTRL-level 52 Edge DMA IRQ
45: 212 ARMCTRL-level 53 Edge DMA IRQ
48: 3074 ARMCTRL-level 56 Edge DMA IRQ
49: 0 ARMCTRL-level 57 Edge DMA IRQ
50: 0 ARMCTRL-level 58 Edge DMA IRQ
53: 0 ARMCTRL-level 61 Edge bcm2835-auxirq
56: 1 ARMCTRL-level 64 Edge dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1
78: 0 ARMCTRL-level 86 Edge 20204000.spi
80: 285 ARMCTRL-level 88 Edge mmc0
81: 4933 ARMCTRL-level 89 Edge uart-pl011
86: 13476 ARMCTRL-level 94 Edge mmc1
163: 158 pinctrl-bcm2835 4 Edge spi0.0

The interrupt is being cleared - it pulses low and then returns high after ~150us, for both transmission and reception.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2480
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Interrupts on Pi-ZeroW

Wed Aug 22, 2018 2:41 pm

That all looks reasonable to me. You could rule out minicom as being a problem by running "cat /dev/ttyMAX0" (or "sudo cat /dev/ttyMAX0") to display received characters.

dbboydRPR
Posts: 9
Joined: Mon Aug 13, 2018 3:32 pm

Re: Interrupts on Pi-ZeroW

Wed Aug 22, 2018 2:55 pm

PhilE
I ran cat /dev/ttyMAX0 - nothing at all. nada, zilch.

So, at a wild guess, minicom isn't displaying anything because the data isn't getting to the character file. Strange that it works in transmit though.

Its almost like the interrupt isn't causing the driver to extract the data from the max14830. I may need to add some debug to the driver to see what is (or isn't!) occuring.

You've been a great help, its halfway there!

Any thoughts?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2480
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Interrupts on Pi-ZeroW

Wed Aug 22, 2018 3:03 pm

You might be able to save some time using the built-in kernel tracing mechanism.

Copy this script to a file - call it "spitrace":

Code: Select all

#!/bin/sh

cd /sys/kernel/debug/tracing

if [ "$1" = "on" ]; then
	echo 1 > events/spi/enable
	echo 0 > events/spi/spi_master_idle/enable
	echo > trace
	echo 1 > tracing_on
	echo spitrace: on
else
	echo 0 > tracing_on
	echo 0 > events/spi/enable
	echo spitrace: off
	cat trace
fi
You can then use "sudo ./spitrace on" to enable tracing for SPI events, then "sudo ./spitrace" to disable again and display the results.

dbboydRPR
Posts: 9
Joined: Mon Aug 13, 2018 3:32 pm

Re: Interrupts on Pi-ZeroW

Wed Aug 22, 2018 3:22 pm

PhilE
Well, initially that was a bust, but by changing spi_master_idle to spi_contoller_idle, I did get some trace information (there was no spi_master_idle in the relevant directory)

./spitrace on

fired up minicom in another putty session
waited a few seconds
sent a single character to the board from the external device
wait a few seconds
./spitrace

This produced the following, which unfortunately doesn't mean much to me.

[email protected]:/home/pi/spitrace# ./spitrace
spitrace: off
# tracer: nop
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
minicom-626 [000] d... 1031.907638: spi_message_submit: spi0.0 d7e6bb14
minicom-626 [000] .... 1031.907659: spi_controller_busy: spi0
minicom-626 [000] .... 1031.907663: spi_message_start: spi0.0 d7e6bb14
minicom-626 [000] .... 1031.907684: spi_transfer_start: spi0.0 d7e6bb4c len=2
minicom-626 [000] .... 1031.907703: spi_transfer_stop: spi0.0 d7e6bb4c len=2
minicom-626 [000] .n.. 1031.907744: spi_message_done: spi0.0 d7e6bb14 len=2/2
minicom-626 [000] d... 1031.972779: spi_message_submit: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.972795: spi_controller_busy: spi0
minicom-626 [000] .... 1031.972799: spi_message_start: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.972817: spi_transfer_start: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .... 1031.972835: spi_transfer_stop: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .n.. 1031.972862: spi_message_done: spi0.0 d7e6bb7c len=2/2
minicom-626 [000] d... 1031.972917: spi_message_submit: spi0.0 d7e6bb34
minicom-626 [000] .... 1031.972924: spi_controller_busy: spi0
minicom-626 [000] .... 1031.972927: spi_message_start: spi0.0 d7e6bb34
minicom-626 [000] .... 1031.972936: spi_transfer_start: spi0.0 d7e6bb6c len=2
minicom-626 [000] .... 1031.972947: spi_transfer_stop: spi0.0 d7e6bb6c len=2
minicom-626 [000] .n.. 1031.972965: spi_message_done: spi0.0 d7e6bb34 len=2/2
minicom-626 [000] d... 1031.973005: spi_message_submit: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.973012: spi_controller_busy: spi0
minicom-626 [000] .... 1031.973014: spi_message_start: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.973023: spi_transfer_start: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .... 1031.973033: spi_transfer_stop: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .n.. 1031.973049: spi_message_done: spi0.0 d7e6bb7c len=2/2
minicom-626 [000] d... 1031.973090: spi_message_submit: spi0.0 d7e6bb30
minicom-626 [000] .... 1031.973097: spi_controller_busy: spi0
minicom-626 [000] .... 1031.973099: spi_message_start: spi0.0 d7e6bb30
minicom-626 [000] .... 1031.973107: spi_transfer_start: spi0.0 d7e6bb68 len=1
minicom-626 [000] .... 1031.973117: spi_transfer_stop: spi0.0 d7e6bb68 len=1
minicom-626 [000] .... 1031.973121: spi_transfer_start: spi0.0 d7e6bba4 len=1
minicom-626 [000] .... 1031.973127: spi_transfer_stop: spi0.0 d7e6bba4 len=1
minicom-626 [000] .n.. 1031.973141: spi_message_done: spi0.0 d7e6bb30 len=2/2
minicom-626 [000] d... 1031.973183: spi_message_submit: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.973190: spi_controller_busy: spi0
minicom-626 [000] .... 1031.973192: spi_message_start: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.973200: spi_transfer_start: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .... 1031.973211: spi_transfer_stop: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .n.. 1031.973226: spi_message_done: spi0.0 d7e6bb7c len=2/2
minicom-626 [000] d... 1031.973266: spi_message_submit: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973272: spi_controller_busy: spi0
minicom-626 [000] .... 1031.973274: spi_message_start: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973283: spi_transfer_start: spi0.0 d7e6bb8c len=2
minicom-626 [000] .... 1031.973294: spi_transfer_stop: spi0.0 d7e6bb8c len=2
minicom-626 [000] .n.. 1031.973309: spi_message_done: spi0.0 d7e6bb54 len=2/2
minicom-626 [000] d... 1031.973348: spi_message_submit: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973354: spi_controller_busy: spi0
minicom-626 [000] .... 1031.973357: spi_message_start: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973365: spi_transfer_start: spi0.0 d7e6bb8c len=2
minicom-626 [000] .... 1031.973375: spi_transfer_stop: spi0.0 d7e6bb8c len=2
minicom-626 [000] .n.. 1031.973391: spi_message_done: spi0.0 d7e6bb54 len=2/2
minicom-626 [000] d... 1031.973429: spi_message_submit: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973435: spi_controller_busy: spi0
minicom-626 [000] .... 1031.973437: spi_message_start: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973445: spi_transfer_start: spi0.0 d7e6bb8c len=2
minicom-626 [000] .... 1031.973456: spi_transfer_stop: spi0.0 d7e6bb8c len=2
minicom-626 [000] .n.. 1031.973471: spi_message_done: spi0.0 d7e6bb54 len=2/2
minicom-626 [000] d... 1031.973509: spi_message_submit: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973516: spi_controller_busy: spi0
minicom-626 [000] .... 1031.973519: spi_message_start: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973527: spi_transfer_start: spi0.0 d7e6bb8c len=2
minicom-626 [000] .... 1031.973538: spi_transfer_stop: spi0.0 d7e6bb8c len=2
minicom-626 [000] .n.. 1031.973552: spi_message_done: spi0.0 d7e6bb54 len=2/2
minicom-626 [000] d... 1031.973593: spi_message_submit: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973600: spi_controller_busy: spi0
minicom-626 [000] .... 1031.973603: spi_message_start: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973611: spi_transfer_start: spi0.0 d7e6bb8c len=2
minicom-626 [000] .... 1031.973621: spi_transfer_stop: spi0.0 d7e6bb8c len=2
minicom-626 [000] .n.. 1031.973636: spi_message_done: spi0.0 d7e6bb54 len=2/2
minicom-626 [000] d... 1031.973673: spi_message_submit: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973680: spi_controller_busy: spi0
minicom-626 [000] .... 1031.973683: spi_message_start: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973690: spi_transfer_start: spi0.0 d7e6bb8c len=2
minicom-626 [000] .... 1031.973701: spi_transfer_stop: spi0.0 d7e6bb8c len=2
minicom-626 [000] .n.. 1031.973716: spi_message_done: spi0.0 d7e6bb54 len=2/2
minicom-626 [000] d... 1031.973753: spi_message_submit: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973759: spi_controller_busy: spi0
minicom-626 [000] .... 1031.973762: spi_message_start: spi0.0 d7e6bb54
minicom-626 [000] .... 1031.973770: spi_transfer_start: spi0.0 d7e6bb8c len=2
minicom-626 [000] .... 1031.973781: spi_transfer_stop: spi0.0 d7e6bb8c len=2
minicom-626 [000] .n.. 1031.973796: spi_message_done: spi0.0 d7e6bb54 len=2/2
minicom-626 [000] d... 1031.974048: spi_message_submit: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974058: spi_controller_busy: spi0
minicom-626 [000] .... 1031.974061: spi_message_start: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974074: spi_transfer_start: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .... 1031.974087: spi_transfer_stop: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .n.. 1031.974110: spi_message_done: spi0.0 d7e6bb7c len=2/2
minicom-626 [000] d... 1031.974158: spi_message_submit: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974166: spi_controller_busy: spi0
minicom-626 [000] .... 1031.974169: spi_message_start: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974178: spi_transfer_start: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .... 1031.974189: spi_transfer_stop: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .n.. 1031.974207: spi_message_done: spi0.0 d7e6bb7c len=2/2
minicom-626 [000] d... 1031.974246: spi_message_submit: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974253: spi_controller_busy: spi0
minicom-626 [000] .... 1031.974255: spi_message_start: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974264: spi_transfer_start: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .... 1031.974274: spi_transfer_stop: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .n.. 1031.974291: spi_message_done: spi0.0 d7e6bb7c len=2/2
minicom-626 [000] d... 1031.974329: spi_message_submit: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974335: spi_controller_busy: spi0
minicom-626 [000] .... 1031.974338: spi_message_start: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974346: spi_transfer_start: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .... 1031.974356: spi_transfer_stop: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .n.. 1031.974373: spi_message_done: spi0.0 d7e6bb7c len=2/2
minicom-626 [000] d... 1031.974414: spi_message_submit: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974420: spi_controller_busy: spi0
minicom-626 [000] .... 1031.974423: spi_message_start: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974431: spi_transfer_start: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .... 1031.974441: spi_transfer_stop: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .n.. 1031.974457: spi_message_done: spi0.0 d7e6bb7c len=2/2
minicom-626 [000] d... 1031.974492: spi_message_submit: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974499: spi_controller_busy: spi0
minicom-626 [000] .... 1031.974502: spi_message_start: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974510: spi_transfer_start: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .... 1031.974520: spi_transfer_stop: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .n.. 1031.974536: spi_message_done: spi0.0 d7e6bb7c len=2/2
minicom-626 [000] d... 1031.974573: spi_message_submit: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974580: spi_controller_busy: spi0
minicom-626 [000] .... 1031.974582: spi_message_start: spi0.0 d7e6bb7c
minicom-626 [000] .... 1031.974590: spi_transfer_start: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .... 1031.974601: spi_transfer_stop: spi0.0 d7e6bbb4 len=2
minicom-626 [000] .n.. 1031.974617: spi_message_done: spi0.0 d7e6bb7c len=2/2
irq/163-spi0.0-299 [000] d... 1042.178948: spi_message_submit: spi0.0 d7c53d60
irq/163-spi0.0-299 [000] .... 1042.178969: spi_controller_busy: spi0
irq/163-spi0.0-299 [000] .... 1042.178973: spi_message_start: spi0.0 d7c53d60
irq/163-spi0.0-299 [000] .... 1042.178993: spi_transfer_start: spi0.0 d7c53d98 len=1
irq/163-spi0.0-299 [000] .... 1042.179011: spi_transfer_stop: spi0.0 d7c53d98 len=1
irq/163-spi0.0-299 [000] .... 1042.179015: spi_transfer_start: spi0.0 d7c53dd4 len=1
irq/163-spi0.0-299 [000] .... 1042.179021: spi_transfer_stop: spi0.0 d7c53dd4 len=1
irq/163-spi0.0-299 [000] .... 1042.179058: spi_message_done: spi0.0 d7c53d60 len=2/2
irq/163-spi0.0-299 [000] d... 1042.179078: spi_message_submit: spi0.0 d7c53d10
irq/163-spi0.0-299 [000] .... 1042.179083: spi_message_start: spi0.0 d7c53d10
irq/163-spi0.0-299 [000] .... 1042.179093: spi_transfer_start: spi0.0 d7c53d48 len=1
irq/163-spi0.0-299 [000] .... 1042.179102: spi_transfer_stop: spi0.0 d7c53d48 len=1
irq/163-spi0.0-299 [000] .... 1042.179104: spi_transfer_start: spi0.0 d7c53d84 len=1
irq/163-spi0.0-299 [000] .... 1042.179111: spi_transfer_stop: spi0.0 d7c53d84 len=1
irq/163-spi0.0-299 [000] .... 1042.179116: spi_message_done: spi0.0 d7c53d10 len=2/2
irq/163-spi0.0-299 [000] d... 1042.179127: spi_message_submit: spi0.0 d7c53d10
irq/163-spi0.0-299 [000] .... 1042.179132: spi_message_start: spi0.0 d7c53d10
irq/163-spi0.0-299 [000] .... 1042.179137: spi_transfer_start: spi0.0 d7c53d48 len=1
irq/163-spi0.0-299 [000] .... 1042.179145: spi_transfer_stop: spi0.0 d7c53d48 len=1
irq/163-spi0.0-299 [000] .... 1042.179147: spi_transfer_start: spi0.0 d7c53d84 len=1
irq/163-spi0.0-299 [000] .... 1042.179153: spi_transfer_stop: spi0.0 d7c53d84 len=1
irq/163-spi0.0-299 [000] .... 1042.179159: spi_message_done: spi0.0 d7c53d10 len=2/2
irq/163-spi0.0-299 [000] d... 1042.179169: spi_message_submit: spi0.0 d7c53d10
irq/163-spi0.0-299 [000] .... 1042.179173: spi_message_start: spi0.0 d7c53d10
irq/163-spi0.0-299 [000] .... 1042.179179: spi_transfer_start: spi0.0 d7c53d48 len=1
irq/163-spi0.0-299 [000] .... 1042.179186: spi_transfer_stop: spi0.0 d7c53d48 len=1
irq/163-spi0.0-299 [000] .... 1042.179189: spi_transfer_start: spi0.0 d7c53d84 len=1
irq/163-spi0.0-299 [000] .... 1042.179194: spi_transfer_stop: spi0.0 d7c53d84 len=1
irq/163-spi0.0-299 [000] .... 1042.179198: spi_message_done: spi0.0 d7c53d10 len=2/2
irq/163-spi0.0-299 [000] d... 1042.179209: spi_message_submit: spi0.0 d7c53d10
irq/163-spi0.0-299 [000] .... 1042.179213: spi_message_start: spi0.0 d7c53d10
irq/163-spi0.0-299 [000] .... 1042.179220: spi_transfer_start: spi0.0 d7c53d48 len=1
irq/163-spi0.0-299 [000] .... 1042.179227: spi_transfer_stop: spi0.0 d7c53d48 len=1
irq/163-spi0.0-299 [000] .... 1042.179230: spi_transfer_start: spi0.0 d7c53d84 len=1
irq/163-spi0.0-299 [000] .... 1042.179235: spi_transfer_stop: spi0.0 d7c53d84 len=1
irq/163-spi0.0-299 [000] .... 1042.179246: spi_message_done: spi0.0 d7c53d10 len=2/2
irq/163-spi0.0-299 [000] d... 1042.179256: spi_message_submit: spi0.0 d7c53d10
irq/163-spi0.0-299 [000] .... 1042.179260: spi_message_start: spi0.0 d7c53d10
irq/163-spi0.0-299 [000] .... 1042.179265: spi_transfer_start: spi0.0 d7c53d48 len=1
irq/163-spi0.0-299 [000] .... 1042.179273: spi_transfer_stop: spi0.0 d7c53d48 len=1
irq/163-spi0.0-299 [000] .... 1042.179275: spi_transfer_start: spi0.0 d7c53d84 len=1
irq/163-spi0.0-299 [000] .... 1042.179282: spi_transfer_stop: spi0.0 d7c53d84 len=1
irq/163-spi0.0-299 [000] .... 1042.179286: spi_message_done: spi0.0 d7c53d10 len=2/2
irq/163-spi0.0-299 [000] d... 1042.179296: spi_message_submit: spi0.0 d7c53d60
irq/163-spi0.0-299 [000] .... 1042.179300: spi_message_start: spi0.0 d7c53d60
irq/163-spi0.0-299 [000] .... 1042.179305: spi_transfer_start: spi0.0 d7c53d98 len=1
irq/163-spi0.0-299 [000] .... 1042.179313: spi_transfer_stop: spi0.0 d7c53d98 len=1
irq/163-spi0.0-299 [000] .... 1042.179315: spi_transfer_start: spi0.0 d7c53dd4 len=1
irq/163-spi0.0-299 [000] .... 1042.179321: spi_transfer_stop: spi0.0 d7c53dd4 len=1
irq/163-spi0.0-299 [000] .... 1042.179325: spi_message_done: spi0.0 d7c53d60 len=2/2
irq/163-spi0.0-299 [000] d... 1042.179338: spi_message_submit: spi0.0 d7c53d60
irq/163-spi0.0-299 [000] .... 1042.179344: spi_message_start: spi0.0 d7c53d60
irq/163-spi0.0-299 [000] .... 1042.179351: spi_transfer_start: spi0.0 d7c53d98 len=1
irq/163-spi0.0-299 [000] .... 1042.179358: spi_transfer_stop: spi0.0 d7c53d98 len=1
irq/163-spi0.0-299 [000] .... 1042.179360: spi_transfer_start: spi0.0 d7c53dd4 len=1
irq/163-spi0.0-299 [000] .... 1042.179366: spi_transfer_stop: spi0.0 d7c53dd4 len=1
irq/163-spi0.0-299 [000] .... 1042.179371: spi_message_done: spi0.0 d7c53d60 len=2/2
[email protected]:/home/pi/spitrace#

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2480
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Interrupts on Pi-ZeroW

Wed Aug 22, 2018 3:29 pm

It's clearly been long enough since I used that script for a) the tracing node name to change, and b) me to forget that it didn't actually show the SPI bytes being transferred. I study problems like this using a logic analyser, but unless you have one at your disposal (ideally one that understands the SPI protocol) I think you're going to have to add that tracing yourself - sorry for the unnecessary detour.

dbboydRPR
Posts: 9
Joined: Mon Aug 13, 2018 3:32 pm

Re: Interrupts on Pi-ZeroW

Wed Aug 22, 2018 3:31 pm

Ok - problem solved, I now have data in BOTH directions.

The MAX14830EVKIT provides 4 ports, with each port labelled as T1, T2, R2, R1.

I had assumed that T1 and R1 would be the RS232 TX and RX signals. Unfortunately, R2 is actually the RX signal.

Now I just need to check all the ports!

Phil - thank you again.

Return to “Device Tree”