This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-J722S: mcspi slave mode hang?

Part Number: PROCESSOR-SDK-J722S


Tool/software:

hi!

I'm testing MCSPI slave mode of J722S in loopback (main_spi2:master <> main_spi0:slave, or mcu_spi0:master <> main_spi0:slave) configuration with jumper wires on the 40pin user expansion header on the evaluation board.

I seem to see slave side have tendency to get hang while (seemingly) waiting inside kernel when transfer test is done using the "spidev_test" program.

command reads typically like the below. with the loop count like 500, the test does succeeds sometimes but fails with slave side stuck somewhere in the middle of the loop.

changing the spi clock speed, "delay" parameter, removing the "-v" option doesn't appear to help much.

  master:
        (main_spi2)
        ./spidev_test -D /dev/spidev3.0  -s 500000 -S 32 -I 500 -v

        -OR-

        (mcu_spi0)
        ./spidev_test -D /dev/spidev1.0  -s 500000 -S 32 -I 500 -v

  slave:
        (main_spi0)
        ./spidev_test -D /dev/spidev2.0  -s 500000 -S 32  -I 500 -v


are there any behavior like this seen? Any diagnostics hints are very welcome.

Thanks in advance!


jumper wire look:


dtso file

// SPDX-License-Identifier: GPL-2.0
/*
 * see https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j722s/10_01_00_04/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/SPI.html
 */

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include "k3-pinctrl.h"

//  mcu_spi0 = "/bus@f0000/bus@4000000/spi@4b00000";
//  mcu_spi1 = "/bus@f0000/bus@4000000/spi@4b10000";
//  main_spi0 = "/bus@f0000/spi@20100000";
//  main_spi1 = "/bus@f0000/spi@20110000";
//  main_spi2 = "/bus@f0000/spi@20120000";

/*
 * Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
 */
&{/chosen} {
        overlays {
                 k3-j722s-evm-spidev.kernel = __TIMESTAMP__;
        };
};

&main_pmx0 {
	// This was auto-generated by TI PinMux on 6/4/2025 at 4:06:00 PM.
	main_gpio0_pins_default: main_gpio0-default-pins {
		pinctrl-single,pins = <
			J722S_IOPAD(0x0088, PIN_INPUT, 7) /* (N22) GPMC0_OEn_REn.GPIO0_33 */
			J722S_IOPAD(0x0094, PIN_INPUT, 7) /* (P26) GPMC0_BE1n.GPIO0_36 */
			J722S_IOPAD(0x009c, PIN_INPUT, 7) /* (W26) GPMC0_WAIT1.GPIO0_38 */
			J722S_IOPAD(0x00a8, PIN_INPUT, 7) /* (R27) GPMC0_CSn0.GPIO0_41 */
			J722S_IOPAD(0x00ac, PIN_INPUT, 7) /* (P21) GPMC0_CSn1.GPIO0_42 */
		>;
	};
	main_gpio1_pins_default: main_gpio1-default-pins {
		pinctrl-single,pins = <
			J722S_IOPAD(0x019c, PIN_INPUT, 7) /* (B25) MCASP0_AXR1.GPIO1_9 */
			J722S_IOPAD(0x01a0, PIN_INPUT, 7) /* (F23) MCASP0_AXR0.GPIO1_10 */
			J722S_IOPAD(0x01a8, PIN_INPUT, 7) /* (C26) MCASP0_AFSX.GPIO1_12 */
			J722S_IOPAD(0x01b8, PIN_INPUT, 7) /* (C20) SPI0_CS1.GPIO1_16 */
		>;
	};
	main_spi2_pins_default: main_spi2-default-pins {
		pinctrl-single,pins = <
			J722S_IOPAD(0x01b0, PIN_INPUT, 1) /* (F24) MCASP0_ACLKR.SPI2_CLK */
			J722S_IOPAD(0x01ac, PIN_INPUT, 1) /* (C27) MCASP0_AFSR.SPI2_CS0 */
			J722S_IOPAD(0x0194, PIN_INPUT, 1) /* (A25) MCASP0_AXR3.SPI2_D0 */
			J722S_IOPAD(0x0198, PIN_INPUT, 1) /* (A26) MCASP0_AXR2.SPI2_D1 */
		>;
	};
	main_spi0_pins_default: main_spi0-default-pins {
		pinctrl-single,pins = <
			J722S_IOPAD(0x01bc, PIN_INPUT, 0) /* (D20) SPI0_CLK */
			J722S_IOPAD(0x01b4, PIN_INPUT, 0) /* (B20) SPI0_CS0 */
			J722S_IOPAD(0x01c0, PIN_INPUT, 0) /* (E19) SPI0_D0 */
			J722S_IOPAD(0x01c4, PIN_INPUT, 0) /* (E20) SPI0_D1 */
		>;
	};
};

// enable only spi2 and spi0. spi1 is not well arranged on TI evaluation board.

#if 0 // put to slave
&main_spi2 {
        status = "okay";
        pinctrl-0 = <&main_spi2_pins_default>;
        pinctrl-names = "default";
	dmas = <&main_pktdma 0xc308 0>, <&main_pktdma 0x4308 0>;
	dma-names = "tx0", "rx0";
        spi-slave;
        slave {
                 spi-max-frequency = <24000000>;
                 compatible = "rohm,dh2228fv";
        };
};
#else // master
&main_spi2 {
        status = "okay";
        #address-cells = <1>;
        #size-cells = <0>;
        pinctrl-0 = <&main_spi2_pins_default>;
        pinctrl-names = "default";
	dmas = <&main_pktdma 0xc308 0>, <&main_pktdma 0x4308 0>;
	dma-names = "tx0", "rx0";
        spidev@0 {
                 spi-max-frequency = <24000000>;
                 reg = <0>;
                 compatible = "rohm,dh2228fv";
        };
};
#endif

&main_spi0 {
        status = "okay";
        pinctrl-0 = <&main_spi0_pins_default>;
        pinctrl-names = "default";
	dmas = <&main_pktdma 0xc300 0>, <&main_pktdma 0x4300 0>;
	dma-names = "tx0", "rx0";
        spi-slave;
        slave {
                 spi-max-frequency = <24000000>;
                 compatible = "rohm,dh2228fv";
        };
};

&mcu_pmx0 {
	// This was auto-generated by TI PinMux on 6/4/2025 at 4:06:00 PM.
	mcu_gpio0_pins_default: mcu_gpio0-default-pins {
		pinctrl-single,pins = <
			J722S_MCU_IOPAD(0x001c, PIN_INPUT, 7) /* (B5) MCU_UART0_CTSn.MCU_GPIO0_7 */
			J722S_MCU_IOPAD(0x0020, PIN_INPUT, 7) /* (C5) MCU_UART0_RTSn.MCU_GPIO0_8 */
			J722S_MCU_IOPAD(0x0044, PIN_INPUT, 7) /* (B13) MCU_I2C0_SCL.MCU_GPIO0_17 */
			J722S_MCU_IOPAD(0x0048, PIN_INPUT, 7) /* (E11) MCU_I2C0_SDA.MCU_GPIO0_18 */
			J722S_MCU_IOPAD(0x004c, PIN_INPUT, 7) /* (B9) WKUP_I2C0_SCL.MCU_GPIO0_19 */
			J722S_MCU_IOPAD(0x0050, PIN_INPUT, 7) /* (D11) WKUP_I2C0_SDA.MCU_GPIO0_20 */
		>;
	};
	mcu_spi0_pins_default: mcu_spi0-default-pins {
		pinctrl-single,pins = <
			J722S_MCU_IOPAD(0x0008, PIN_INPUT, 0) /* (A9) MCU_SPI0_CLK */
			J722S_MCU_IOPAD(0x0000, PIN_INPUT, 0) /* (C12) MCU_SPI0_CS0 */
			J722S_MCU_IOPAD(0x000c, PIN_INPUT, 0) /* (B12) MCU_SPI0_D0 */
			J722S_MCU_IOPAD(0x0010, PIN_INPUT, 0) /* (C11) MCU_SPI0_D1 */
		>;
	};
};

&mcu_spi0 {
        status = "okay";
        #address-cells = <1>;
        #size-cells = <0>;
        pinctrl-0 = <&mcu_spi0_pins_default>;
        pinctrl-names = "default";
        ti,pindir-d0-out-d1-in;
//	dmas = <&main_pktdma 0xc300 0>, <&main_pktdma 0x4300 0>;
//	dma-names = "tx0", "rx0";
        spidev@0 {
                 spi-max-frequency = <24000000>;
                 reg = <0>;
                 compatible = "rohm,dh2228fv";
        };
};



TI SDK revisions

ti-processor-sdk-linux-edgeai-j722s-evm-10_01_00_04

ti-processor-sdk-linux-edgeai-j722s-evm-11_00_00_08

  • Hi Kenji,

    Good to work with you again.

    Quick glance through the dtso, it looks fine so far. I haven't looked deeply into the pinmuxing, but other properties look good.

    Two questions:

    1. Could you give a closer up picture of the jumper wire connections? Would like to check if there is any discrepancy with the pinmuxing
    2. I see there are two versions of edgeai SDK. Is there a preference for which version to use if I were to test on my board?

    Regards.

    Takuma

  • hi Takuma, ...or Takuma san if Japanese speaking :)

    re: wire arrangement

    here's the hand written 40 pin header I've referred to on multiple occasions & boards when inserting the cables instead.

    if I was doing wrong it's more likely in this drawing I had been consulting than in the actual jumper pin placement on the board.

    the wire picture in the original message is when mcu_spi0 was used to talk to main_spi0, the second wire picture in the below is when main_spi2 was used to talk to main_spi0.

    both cases mcu_spi0<>main_spi0 and main_spi2<>main_spi0 behaves and fails in similar manner in that first one or two hundred iteration tend to work fine until at some point slave side gets stuck along the way. "hundreds" sometimes becomes "tens" depending on test parameters, seemingly, delay maybe(?)

    jumper wires had been sometimes placed on "the other end" of 20 cm flat ribbon cable to be attached to the user expansion header, seen in the picture below.





    I've tested mostly with 10_01_00_04; lightly testing with 11_00_00_08 initially gave me some impression that's more resilient but not that much different after all.

  • (optional), the below is some local modification to the original tools/spi/spidev_test.c to see if adding delay in master side between each transaction prevents the hang (the `-P` option in the diff). this didn't help after all - FYI

    $ diff spidev_test.c.orig spidev_test.c
    24a25
    > #include <assert.h>
    44a46,47
    > static uint8_t word_delay;
    > static uint16_t pause_us;
    128a132
    > 		.word_delay_usecs = word_delay,
    175c179
    < 	printf("Usage: %s [-2348CDFHILMNORSZbdilopsv]\n", prog);
    ---
    > 	printf("Usage: %s [-2348CDFHILMNORSZbdwPilopsv]\n", prog);
    179a184,185
    > 	         "  -w --word_delay     word_delay (usec)\n"
    > 	         "  -P --pause          pause (usec)\n"
    215a222,223
    > 			{ "word_delay",    1, 0, 'w' },
    > 			{ "pause",         1, 0, 'P' },
    240c248
    < 		c = getopt_long(argc, argv, "D:s:d:b:i:o:lHOLC3ZFMNR248p:vS:I:",
    ---
    > 		c = getopt_long(argc, argv, "D:s:d:w:P:b:i:o:lHOLC3ZFMNR248p:vS:I:",
    255a264,269
    > 		case 'w':
    > 			word_delay = atoi(optarg);
    > 			break;
    > 		case 'P':
    > 			pause_us = atoi(optarg);
    > 			break;
    403c417
    < static void transfer_buf(int fd, int len)
    ---
    > static void transfer_buf(int fd, int len, uint8_t *tx_buf, uint8_t *rx_buf)
    409,413c423,431
    < 	tx = malloc(len);
    < 	if (!tx)
    < 		pabort("can't allocate tx buffer");
    < 	for (i = 0; i < len; i++)
    < 		tx[i] = random();
    ---
    > 	if (tx_buf)
    > 		tx = tx_buf;
    > 	else {
    > 		tx = malloc(len);
    > 		if (!tx)
    > 			pabort("can't allocate tx buffer");
    > 		for (i = 0; i < len; i++)
    > 			tx[i] = random();
    > 	}
    415,417c433,439
    < 	rx = malloc(len);
    < 	if (!rx)
    < 		pabort("can't allocate rx buffer");
    ---
    > 	if (rx_buf)
    > 		rx = rx_buf;
    > 	else {
    > 		rx = malloc(len);
    > 		if (!rx)
    > 			pabort("can't allocate rx buffer");
    > 	}
    418a441,448
    > 	if (tx_buf) {
    > 		char mp[5];
    > 		if (len >= sizeof mp - 1) {
    > 			snprintf(mp, sizeof mp, "%04d", iterations % 1000);
    > 			memcpy(tx_buf + len - 4, mp, sizeof mp - 1);
    > 		}
    > 	}
    > 	
    433,434c463,466
    < 	free(rx);
    < 	free(tx);
    ---
    > 	if (!rx_buf)
    > 		free(rx);
    > 	if (!tx_buf)
    > 		free(tx);
    497a530,532
    > 	printf("delay: %u usecs\n", delay);
    > 	printf("word_delay: %u usecs\n", word_delay);
    > 	printf("pause: %u usecs\n", pause_us);
    505c540,542
    < 
    ---
    > 		uint8_t *tx_buf = 0;
    > 		uint8_t *rx_buf = 0;
    > 		
    507a545,557
    > 		if (iterations) {
    > 			int i;
    > 			
    > 			rx_buf = malloc(transfer_size);
    > 			assert(rx_buf);
    > 			tx_buf = malloc(transfer_size);
    > 			assert(tx_buf);
    > 
    > 			for (i = 0; i < transfer_size; i++) {
    > 				tx_buf[i] = '0' + (i % 10);
    > 			}
    > 		}
    > 		
    511c561
    < 			transfer_buf(fd, transfer_size);
    ---
    > 			transfer_buf(fd, transfer_size, tx_buf, rx_buf);
    517a568,570
    > 
    > 			if (pause_us)
    > 				usleep(pause_us);
    520a574,578
    > 
    > 		if (tx_buf)
    > 			free(tx_buf);
    > 		if (rx_buf)
    > 			free(rx_buf);
    $ 
    // SPDX-License-Identifier: GPL-2.0-only
    /*
     * SPI testing utility (using spidev driver)
     *
     * Copyright (c) 2007  MontaVista Software, Inc.
     * Copyright (c) 2007  Anton Vorontsov <avorontsov@ru.mvista.com>
     *
     * Cross-compile with cross-gcc -I/path/to/cross-kernel/include
     */
    
    #include <stdint.h>
    #include <unistd.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <errno.h>
    #include <getopt.h>
    #include <fcntl.h>
    #include <time.h>
    #include <sys/ioctl.h>
    #include <linux/ioctl.h>
    #include <sys/stat.h>
    #include <linux/types.h>
    #include <linux/spi/spidev.h>
    #include <assert.h>
    
    #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
    
    static void pabort(const char *s)
    {
    	if (errno != 0)
    		perror(s);
    	else
    		printf("%s\n", s);
    
    	abort();
    }
    
    static const char *device = "/dev/spidev1.1";
    static uint32_t mode;
    static uint8_t bits = 8;
    static char *input_file;
    static char *output_file;
    static uint32_t speed = 500000;
    static uint16_t delay;
    static uint8_t word_delay;
    static uint16_t pause_us;
    static int verbose;
    static int transfer_size;
    static int iterations;
    static int interval = 5; /* interval in seconds for showing transfer rate */
    
    static uint8_t default_tx[] = {
    	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    	0x40, 0x00, 0x00, 0x00, 0x00, 0x95,
    	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    	0xF0, 0x0D,
    };
    
    static uint8_t default_rx[ARRAY_SIZE(default_tx)] = {0, };
    static char *input_tx;
    
    static void hex_dump(const void *src, size_t length, size_t line_size,
    		     char *prefix)
    {
    	int i = 0;
    	const unsigned char *address = src;
    	const unsigned char *line = address;
    	unsigned char c;
    
    	printf("%s | ", prefix);
    	while (length-- > 0) {
    		printf("%02X ", *address++);
    		if (!(++i % line_size) || (length == 0 && i % line_size)) {
    			if (length == 0) {
    				while (i++ % line_size)
    					printf("__ ");
    			}
    			printf(" |");
    			while (line < address) {
    				c = *line++;
    				printf("%c", (c < 32 || c > 126) ? '.' : c);
    			}
    			printf("|\n");
    			if (length > 0)
    				printf("%s | ", prefix);
    		}
    	}
    }
    
    /*
     *  Unescape - process hexadecimal escape character
     *      converts shell input "\x23" -> 0x23
     */
    static int unescape(char *_dst, char *_src, size_t len)
    {
    	int ret = 0;
    	int match;
    	char *src = _src;
    	char *dst = _dst;
    	unsigned int ch;
    
    	while (*src) {
    		if (*src == '\\' && *(src+1) == 'x') {
    			match = sscanf(src + 2, "%2x", &ch);
    			if (!match)
    				pabort("malformed input string");
    
    			src += 4;
    			*dst++ = (unsigned char)ch;
    		} else {
    			*dst++ = *src++;
    		}
    		ret++;
    	}
    	return ret;
    }
    
    static void transfer(int fd, uint8_t const *tx, uint8_t const *rx, size_t len)
    {
    	int ret;
    	int out_fd;
    	struct spi_ioc_transfer tr = {
    		.tx_buf = (unsigned long)tx,
    		.rx_buf = (unsigned long)rx,
    		.len = len,
    		.delay_usecs = delay,
    		.speed_hz = speed,
    		.bits_per_word = bits,
    		.word_delay_usecs = word_delay,
    	};
    
    	if (mode & SPI_TX_OCTAL)
    		tr.tx_nbits = 8;
    	else if (mode & SPI_TX_QUAD)
    		tr.tx_nbits = 4;
    	else if (mode & SPI_TX_DUAL)
    		tr.tx_nbits = 2;
    	if (mode & SPI_RX_OCTAL)
    		tr.rx_nbits = 8;
    	else if (mode & SPI_RX_QUAD)
    		tr.rx_nbits = 4;
    	else if (mode & SPI_RX_DUAL)
    		tr.rx_nbits = 2;
    	if (!(mode & SPI_LOOP)) {
    		if (mode & (SPI_TX_OCTAL | SPI_TX_QUAD | SPI_TX_DUAL))
    			tr.rx_buf = 0;
    		else if (mode & (SPI_RX_OCTAL | SPI_RX_QUAD | SPI_RX_DUAL))
    			tr.tx_buf = 0;
    	}
    
    	ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
    	if (ret < 1)
    		pabort("can't send spi message");
    
    	if (verbose)
    		hex_dump(tx, len, 32, "TX");
    
    	if (output_file) {
    		out_fd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
    		if (out_fd < 0)
    			pabort("could not open output file");
    
    		ret = write(out_fd, rx, len);
    		if (ret != len)
    			pabort("not all bytes written to output file");
    
    		close(out_fd);
    	}
    
    	if (verbose)
    		hex_dump(rx, len, 32, "RX");
    }
    
    static void print_usage(const char *prog)
    {
    	printf("Usage: %s [-2348CDFHILMNORSZbdwPilopsv]\n", prog);
    	puts("general device settings:\n"
    		 "  -D --device         device to use (default /dev/spidev1.1)\n"
    		 "  -s --speed          max speed (Hz)\n"
    		 "  -d --delay          delay (usec)\n"
    	         "  -w --word_delay     word_delay (usec)\n"
    	         "  -P --pause          pause (usec)\n"
    		 "  -l --loop           loopback\n"
    		 "spi mode:\n"
    		 "  -H --cpha           clock phase\n"
    		 "  -O --cpol           clock polarity\n"
    		 "  -F --rx-cpha-flip   flip CPHA on Rx only xfer\n"
    		 "number of wires for transmission:\n"
    		 "  -2 --dual           dual transfer\n"
    		 "  -4 --quad           quad transfer\n"
    		 "  -8 --octal          octal transfer\n"
    		 "  -3 --3wire          SI/SO signals shared\n"
    		 "  -Z --3wire-hiz      high impedance turnaround\n"
    		 "data:\n"
    		 "  -i --input          input data from a file (e.g. \"test.bin\")\n"
    		 "  -o --output         output data to a file (e.g. \"results.bin\")\n"
    		 "  -p                  Send data (e.g. \"1234\\xde\\xad\")\n"
    		 "  -S --size           transfer size\n"
    		 "  -I --iter           iterations\n"
    		 "additional parameters:\n"
    		 "  -b --bpw            bits per word\n"
    		 "  -L --lsb            least significant bit first\n"
    		 "  -C --cs-high        chip select active high\n"
    		 "  -N --no-cs          no chip select\n"
    		 "  -R --ready          slave pulls low to pause\n"
    		 "  -M --mosi-idle-low  leave mosi line low when idle\n"
    		 "misc:\n"
    		 "  -v --verbose        Verbose (show tx buffer)\n");
    	exit(1);
    }
    
    static void parse_opts(int argc, char *argv[])
    {
    	while (1) {
    		static const struct option lopts[] = {
    			{ "device",        1, 0, 'D' },
    			{ "speed",         1, 0, 's' },
    			{ "delay",         1, 0, 'd' },
    			{ "word_delay",    1, 0, 'w' },
    			{ "pause",         1, 0, 'P' },
    			{ "loop",          0, 0, 'l' },
    			{ "cpha",          0, 0, 'H' },
    			{ "cpol",          0, 0, 'O' },
    			{ "rx-cpha-flip",  0, 0, 'F' },
    			{ "dual",          0, 0, '2' },
    			{ "quad",          0, 0, '4' },
    			{ "octal",         0, 0, '8' },
    			{ "3wire",         0, 0, '3' },
    			{ "3wire-hiz",     0, 0, 'Z' },
    			{ "input",         1, 0, 'i' },
    			{ "output",        1, 0, 'o' },
    			{ "size",          1, 0, 'S' },
    			{ "iter",          1, 0, 'I' },
    			{ "bpw",           1, 0, 'b' },
    			{ "lsb",           0, 0, 'L' },
    			{ "cs-high",       0, 0, 'C' },
    			{ "no-cs",         0, 0, 'N' },
    			{ "ready",         0, 0, 'R' },
    			{ "mosi-idle-low", 0, 0, 'M' },
    			{ "verbose",       0, 0, 'v' },
    			{ NULL, 0, 0, 0 },
    		};
    		int c;
    
    		c = getopt_long(argc, argv, "D:s:d:w:P:b:i:o:lHOLC3ZFMNR248p:vS:I:",
    				lopts, NULL);
    
    		if (c == -1)
    			break;
    
    		switch (c) {
    		case 'D':
    			device = optarg;
    			break;
    		case 's':
    			speed = atoi(optarg);
    			break;
    		case 'd':
    			delay = atoi(optarg);
    			break;
    		case 'w':
    			word_delay = atoi(optarg);
    			break;
    		case 'P':
    			pause_us = atoi(optarg);
    			break;
    		case 'b':
    			bits = atoi(optarg);
    			break;
    		case 'i':
    			input_file = optarg;
    			break;
    		case 'o':
    			output_file = optarg;
    			break;
    		case 'l':
    			mode |= SPI_LOOP;
    			break;
    		case 'H':
    			mode |= SPI_CPHA;
    			break;
    		case 'O':
    			mode |= SPI_CPOL;
    			break;
    		case 'L':
    			mode |= SPI_LSB_FIRST;
    			break;
    		case 'C':
    			mode |= SPI_CS_HIGH;
    			break;
    		case '3':
    			mode |= SPI_3WIRE;
    			break;
    		case 'Z':
    			mode |= SPI_3WIRE_HIZ;
    			break;
    		case 'F':
    			mode |= SPI_RX_CPHA_FLIP;
    			break;
    		case 'M':
    			mode |= SPI_MOSI_IDLE_LOW;
    			break;
    		case 'N':
    			mode |= SPI_NO_CS;
    			break;
    		case 'v':
    			verbose = 1;
    			break;
    		case 'R':
    			mode |= SPI_READY;
    			break;
    		case 'p':
    			input_tx = optarg;
    			break;
    		case '2':
    			mode |= SPI_TX_DUAL;
    			break;
    		case '4':
    			mode |= SPI_TX_QUAD;
    			break;
    		case '8':
    			mode |= SPI_TX_OCTAL;
    			break;
    		case 'S':
    			transfer_size = atoi(optarg);
    			break;
    		case 'I':
    			iterations = atoi(optarg);
    			break;
    		default:
    			print_usage(argv[0]);
    		}
    	}
    	if (mode & SPI_LOOP) {
    		if (mode & SPI_TX_DUAL)
    			mode |= SPI_RX_DUAL;
    		if (mode & SPI_TX_QUAD)
    			mode |= SPI_RX_QUAD;
    		if (mode & SPI_TX_OCTAL)
    			mode |= SPI_RX_OCTAL;
    	}
    }
    
    static void transfer_escaped_string(int fd, char *str)
    {
    	size_t size = strlen(str);
    	uint8_t *tx;
    	uint8_t *rx;
    
    	tx = malloc(size);
    	if (!tx)
    		pabort("can't allocate tx buffer");
    
    	rx = malloc(size);
    	if (!rx)
    		pabort("can't allocate rx buffer");
    
    	size = unescape((char *)tx, str, size);
    	transfer(fd, tx, rx, size);
    	free(rx);
    	free(tx);
    }
    
    static void transfer_file(int fd, char *filename)
    {
    	ssize_t bytes;
    	struct stat sb;
    	int tx_fd;
    	uint8_t *tx;
    	uint8_t *rx;
    
    	if (stat(filename, &sb) == -1)
    		pabort("can't stat input file");
    
    	tx_fd = open(filename, O_RDONLY);
    	if (tx_fd < 0)
    		pabort("can't open input file");
    
    	tx = malloc(sb.st_size);
    	if (!tx)
    		pabort("can't allocate tx buffer");
    
    	rx = malloc(sb.st_size);
    	if (!rx)
    		pabort("can't allocate rx buffer");
    
    	bytes = read(tx_fd, tx, sb.st_size);
    	if (bytes != sb.st_size)
    		pabort("failed to read input file");
    
    	transfer(fd, tx, rx, sb.st_size);
    	free(rx);
    	free(tx);
    	close(tx_fd);
    }
    
    static uint64_t _read_count;
    static uint64_t _write_count;
    
    static void show_transfer_rate(void)
    {
    	static uint64_t prev_read_count, prev_write_count;
    	double rx_rate, tx_rate;
    
    	rx_rate = ((_read_count - prev_read_count) * 8) / (interval*1000.0);
    	tx_rate = ((_write_count - prev_write_count) * 8) / (interval*1000.0);
    
    	printf("rate: tx %.1fkbps, rx %.1fkbps\n", rx_rate, tx_rate);
    
    	prev_read_count = _read_count;
    	prev_write_count = _write_count;
    }
    
    static void transfer_buf(int fd, int len, uint8_t *tx_buf, uint8_t *rx_buf)
    {
    	uint8_t *tx;
    	uint8_t *rx;
    	int i;
    
    	if (tx_buf)
    		tx = tx_buf;
    	else {
    		tx = malloc(len);
    		if (!tx)
    			pabort("can't allocate tx buffer");
    		for (i = 0; i < len; i++)
    			tx[i] = random();
    	}
    
    	if (rx_buf)
    		rx = rx_buf;
    	else {
    		rx = malloc(len);
    		if (!rx)
    			pabort("can't allocate rx buffer");
    	}
    
    	if (tx_buf) {
    		char mp[5];
    		if (len >= sizeof mp - 1) {
    			snprintf(mp, sizeof mp, "%04d", iterations % 1000);
    			memcpy(tx_buf + len - 4, mp, sizeof mp - 1);
    		}
    	}
    	
    	transfer(fd, tx, rx, len);
    
    	_write_count += len;
    	_read_count += len;
    
    	if (mode & SPI_LOOP) {
    		if (memcmp(tx, rx, len)) {
    			fprintf(stderr, "transfer error !\n");
    			hex_dump(tx, len, 32, "TX");
    			hex_dump(rx, len, 32, "RX");
    			exit(1);
    		}
    	}
    
    	if (!rx_buf)
    		free(rx);
    	if (!tx_buf)
    		free(tx);
    }
    
    int main(int argc, char *argv[])
    {
    	int ret = 0;
    	int fd;
    	uint32_t request;
    
    	parse_opts(argc, argv);
    
    	if (input_tx && input_file)
    		pabort("only one of -p and --input may be selected");
    
    	fd = open(device, O_RDWR);
    	if (fd < 0)
    		pabort("can't open device");
    
    	/*
    	 * spi mode
    	 */
    	/* WR is make a request to assign 'mode' */
    	request = mode;
    	ret = ioctl(fd, SPI_IOC_WR_MODE32, &mode);
    	if (ret == -1)
    		pabort("can't set spi mode");
    
    	/* RD is read what mode the device actually is in */
    	ret = ioctl(fd, SPI_IOC_RD_MODE32, &mode);
    	if (ret == -1)
    		pabort("can't get spi mode");
    	/* Drivers can reject some mode bits without returning an error.
    	 * Read the current value to identify what mode it is in, and if it
    	 * differs from the requested mode, warn the user.
    	 */
    	if (request != mode)
    		printf("WARNING device does not support requested mode 0x%x\n",
    			request);
    
    	/*
    	 * bits per word
    	 */
    	ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits);
    	if (ret == -1)
    		pabort("can't set bits per word");
    
    	ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits);
    	if (ret == -1)
    		pabort("can't get bits per word");
    
    	/*
    	 * max speed hz
    	 */
    	ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed);
    	if (ret == -1)
    		pabort("can't set max speed hz");
    
    	ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed);
    	if (ret == -1)
    		pabort("can't get max speed hz");
    
    	printf("spi mode: 0x%x\n", mode);
    	printf("bits per word: %u\n", bits);
    	printf("max speed: %u Hz (%u kHz)\n", speed, speed/1000);
    	printf("delay: %u usecs\n", delay);
    	printf("word_delay: %u usecs\n", word_delay);
    	printf("pause: %u usecs\n", pause_us);
    
    	if (input_tx)
    		transfer_escaped_string(fd, input_tx);
    	else if (input_file)
    		transfer_file(fd, input_file);
    	else if (transfer_size) {
    		struct timespec last_stat;
    		uint8_t *tx_buf = 0;
    		uint8_t *rx_buf = 0;
    		
    		clock_gettime(CLOCK_MONOTONIC, &last_stat);
    
    		if (iterations) {
    			int i;
    			
    			rx_buf = malloc(transfer_size);
    			assert(rx_buf);
    			tx_buf = malloc(transfer_size);
    			assert(tx_buf);
    
    			for (i = 0; i < transfer_size; i++) {
    				tx_buf[i] = '0' + (i % 10);
    			}
    		}
    		
    		while (iterations-- > 0) {
    			struct timespec current;
    
    			transfer_buf(fd, transfer_size, tx_buf, rx_buf);
    
    			clock_gettime(CLOCK_MONOTONIC, &current);
    			if (current.tv_sec - last_stat.tv_sec > interval) {
    				show_transfer_rate();
    				last_stat = current;
    			}
    
    			if (pause_us)
    				usleep(pause_us);
    		}
    		printf("total: tx %.1fKB, rx %.1fKB\n",
    		       _write_count/1024.0, _read_count/1024.0);
    
    		if (tx_buf)
    			free(tx_buf);
    		if (rx_buf)
    			free(rx_buf);
    	} else
    		transfer(fd, default_tx, default_rx, sizeof(default_tx));
    
    	close(fd);
    
    	return ret;
    }
    
     

  • some of my test result look like this -- in a loop of 50 count, slave side (*shell2* emacs buffer in the picture) gets stuck at iteration 25. - frame corruption like missed bytes are not seen. (buffer *shell* is the master which run to completion).

  • Hi Kenji-san,

    Understood, I will try out on my end to see if I can replicate the test setup. Personally, I have not seen a case where the McSPI sometimes succeeds and sometimes fail - it is usually all success or all fail - so this is a bit new behavior.

     Otherwise, I was reviewing the hardware connection, but I see there is only 1 data lines connected out of the two SPI data lines. Is this intentional?

    Regards,

    Takuma

  • Thank you Takuma

    I agree. The observed failure being occasional makes me think that the issue maybe of more software (timing?) nature than hardware (board setup) issue.

    Only one data line use is granted — the J722S EVM board by default routes only one data line of main_spi0 to the 40 pin user expansion header unless the corresponding register need to be stuffed or removed. For my current application use case, I didn’t need slave-to-master traffic so the EVM board has been left unmodified. (corresponding spidev_test master side just prints 0xff as expected for this)

  • re: “slave-to-master data not needed”

     

    reading again that may have been a bit confusing wording :)

    . I want main_spi2(master) to main_spi0(slave) data -> jumper installed 

    . I do not need main_spi0(slave) to main_spi2(master) data -> jumper not present 

    … is what I wanted to say

  • Hi Kenji-san,

    I am currently facing some issues with the spi2 slave-side. Getting a segmentation fault like below:

    root@j722s-evm:~# ./spidev_test -D /dev/spidev3.0  -s 500000 -S 32 -I 5 -v
    spi mode: 0x0
    bits per word: 8
    max speed: 500000 Hz (500 kHz)
    [  211.835719] spidev spi3.0: RXS timed out
    TX | 67 C6 69 73 51 FF 4A EC 29 CD BA AB F2 FB E3 46 7C C2 54 F8 1B E8 E7 8D 76 5A 2E 63 33 9F C9 9A  |g.isQ.J.)......F|.T.....vZ.c3...|
    RX | 05 EF F7 00 E9 A1 3A E5 CA 0B CB D0 48 47 64 BD 1F 23 1E A8 1C 7B 64 C5 14 73 5A C5 5E 4B 79 63  |......:.....HGd..#...{d..sZ.^Kyc|
    [  212.843693] spidev spi3.0: RXS timed out
    TX | 66 32 0D B7 31 58 A3 5A 25 5D 05 17 58 E9 5E D4 AB B2 CD C6 9B B4 54 11 0E 82 74 41 21 3D DC 87  |f2..1X.Z%]..X.^.......T...tA!=..|
    RX | 05 EF F7 00 E9 A1 3A E5 CA 0B CB D0 48 47 64 BD 1F 23 1E A8 1C 7B 64 C5 14 73 5A C5 5E 4B 79 63  |......:.....HGd..#...{d..sZ.^Kyc|
    [  213.851667] spidev spi3.0: RXS timed out
    TX | 70 E9 3E A1 41 E1 FC 67 3E 01 7E 97 EA DC 6B 96 8F 38 5C 2A EC B0 3B FB 32 AF 3C 54 EC 18 DB 5C  |p.>.A..g>.~...k..8\*..;.2.<T...\|
    RX | 05 EF F7 00 E9 A1 3A E5 CA 0B CB D0 48 47 64 BD 1F 23 1E A8 1C 7B 64 C5 14 73 5A C5 5E 4B 79 63  |......:.....HGd..#...{d..sZ.^Kyc|
    [  214.859640] spidev spi3.0: RXS timed out
    TX | 02 1A FE 43 FB FA AA 3A FB 29 D1 E6 05 3C 7C 94 75 D8 BE 61 89 F9 5C BB A8 99 0F 95 B1 EB F1 B3  |...C...:.)...<|.u..a..\.........|
    RX | 05 EF F7 00 E9 A1 3A E5 CA 0B CB D0 48 47 64 BD 1F 23 1E A8 1C 7B 64 C5 14 73 5A C5 5E 4B 79 63  |......:.....HGd..#...{d..sZ.^Kyc|
    [  215.867615] spidev spi3.0: RXS timed out
    TX | 05 EF F7 00 E9 A1 3A E5 CA 0B CB D0 48 47 64 BD 1F 23 1E A8[  215.871787] Unable to handle kernel paging request at virtual address fffffffffffffff8
     1C 7B 64 C5 14 73 5A C5 5E 4B 79 63  |......:.....HGd..#...{d..[  215.885123] Mem abort info:
    sZ.^Kyc|
    RX | 05 EF F7 00 E9 A1 3A E5 CA 0B CB D0 48 47 64 BD 1[  215.893447]   ESR = 0x0000000096000006
    F 23 1E A8 1C 7B 64 C5 14 73 5A C5 5E 4B 79 63  |......:.....HGd[  215.902727]   EC = 0x25: DABT (current EL), IL = 32 bits
    ..#...{d..sZ.^Kyc|
    total: tx 0.2KB, rx 0.2KB
    [  215.913567]   SET = 0, FnV = 0
    [  215.920680]   EA = 0, S1PTW = 0
    [  215.923810]   FSC = 0x06: level 2 translation fault
    [  215.928674] Data abort info:
    [  215.931542]   ISV = 0, ISS = 0x00000006, ISS2 = 0x00000000
    [  215.937011]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
    [  215.942047]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
    [  215.947344] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000083142000
    [  215.954029] [fffffffffffffff8] pgd=0000000000000000, p4d=000000008353b003, pud=000000008353c003, pmd=0000000000000000
    [  215.964631] Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
    [  215.970883] Modules linked in: onboard_usb_dev rpmsg_ctrl rpmsg_char overlay cdns3 cdns_usb_common snd_soc_hdmi_codec spidev snd_soc_simple_card wave5 snd_soc_simple_card_utils videobuf2_dma_contig crct10dif_ce pci_endpoint_test phy_can_transceiver v4l2_mem2mem cfg80211 display_connector videobuf2_v4l2 cdns3_ti rtc_ti_k3 videobuf2_memops rti_wdt k3_j72xx_bandgap videobuf2_common ti_k3_r5_remoteproc videodev mc tidss sa2ul drm_dma_helper mcrc64 bluetooth drm_display_helper ecdh_generic sii902x ecc ti_k3_dsp_remoteproc ti_k3_common rfkill drm_kms_helper snd_soc_davinci_mcasp m_can_platform snd_soc_ti_udma m_can snd_soc_ti_edma snd_soc_ti_sdma omap_mailbox can_dev omap_hwspinlock snd_soc_tlv320aic3x_i2c snd_soc_tlv320aic3x spi_omap2_mcspi drm drm_panel_orientation_quirks backlight fuse ipv6
    [  216.040679] CPU: 1 UID: 0 PID: 1027 Comm: spidev_test Not tainted 6.12.17-ti-gcdcaeac783e3-dirty #3
    [  216.049709] Hardware name: Texas Instruments J722S EVM (DT)
    [  216.055266] pstate: 000000c5 (nzcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [  216.062214] pc : complete+0x58/0x94
    [  216.065704] lr : complete+0x24/0x94
    [  216.069184] sp : ffff80008578bd10
    [  216.072486] x29: ffff80008578bd10 x28: ffff0008082e6300 x27: 0000000000000000
    [  216.079611] x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
    [  216.086736] x23: ffff0008035981a0 x22: ffff000804d1fc00 x21: 0000000000000000
    [  216.093860] x20: ffff000804f788b8 x19: 0000000000000000 x18: 0000000000000000
    [  216.100984] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
    [  216.108108] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
    [  216.115232] x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
    [  216.122356] x8 : ffff80008578bd38 x7 : 0000000000000000 x6 : 000000000000003f
    [  216.129480] x5 : ffff0008082e6300 x4 : 0000000000000000 x3 : 0000000000000001
    [  216.136605] x2 : 0000000000000000 x1 : 0000000000000003 x0 : ffff000804f788c0
    [  216.143730] Call trace:
    [  216.146166]  complete+0x58/0x94
    [  216.149301]  omap2_mcspi_target_abort+0x28/0x4c [spi_omap2_mcspi]
    [  216.155390]  spi_target_abort+0x24/0x38
    [  216.159222]  spidev_release+0xa8/0xe0 [spidev]
    [  216.163662]  __fput+0xc8/0x2d0
    [  216.166712]  __fput_sync+0x48/0x54
    [  216.170106]  __arm64_sys_close+0x38/0x7c
    [  216.174019]  invoke_syscall+0x48/0x10c
    [  216.177761]  el0_svc_common.constprop.0+0xc0/0xe0
    [  216.182456]  do_el0_svc+0x1c/0x28
    [  216.185763]  el0_svc+0x28/0x98
    [  216.188813]  el0t_64_sync_handler+0x120/0x12c
    [  216.193160]  el0t_64_sync+0x190/0x194
    [  216.196818] Code: 54000160 f9400a73 52800061 52800002 (f85f8260)
    [  216.202898] ---[ end trace 0000000000000000 ]---
    [  216.207502] note: spidev_test[1027] exited with irqs disabled
    [  216.213289] note: spidev_test[1027] exited with preempt_count 1
    Segmentation fault
    root@j722s-evm:~#
    

    Did you see something similar during implementation? 

    Regards,

    Takuma

  • Thank you Takuma san for following up on this.

    No I haven't seen any kernel panic during my tests. Beside device tree no kenel source code have been modified in my test environment except the kernel .config (defconfig) file as below. (basically only one entry `CONFIG_SPI_SLAVE=y` is the relevant change):

    $ cd ti-processor-sdk-linux-edgeai-j722s-evm-10_01_00_04/board-support/ti-linux-kernel-6.6.44+git-ti
    $ git diff 541c20281af79a7df96bb94b4e3a923092d7ceff -- 	kernel/configs/ti_arm64_prune.config
    diff --git a/kernel/configs/ti_arm64_prune.config b/kernel/configs/ti_arm64_prune.config
    index fbdb3225671e..ec1f623c6bd3 100644
    --- a/kernel/configs/ti_arm64_prune.config
    +++ b/kernel/configs/ti_arm64_prune.config
    @@ -492,3 +492,19 @@ CONFIG_DVB_TDA665x=n
     CONFIG_DVB_DRX39XYJ=n
     CONFIG_DVB_CXD2099=n
     CONFIG_DVB_SP2=n
    +CONFIG_DYNAMIC_DEBUG=y
    +CONFIG_DEBUG_DRIVER=y
    +CONFIG_I2C_DEBUG_CORE=y
    +CONFIG_I2C_DEBUG_ALGO=y
    +CONFIG_I2C_DEBUG_BUS=y
    +CONFIG_TEST_DYNAMIC_DEBUG=y
    +CONFIG_SPI_SPIDEV=m
    +CONFIG_SPI_OMAP24XX=m
    +CONFIG_SPI_DEBUG=y
    +CONFIG_SPI_SLAVE_TIME=y
    +CONFIG_SPI_SLAVE_SYSTEM_CONTROL=y
    +CONFIG_CRAMFS=y
    +CONFIG_CRAMFS_BLOCKDEV=y
    +CONFIG_CRAMFS_MTD=y
    +CONFIG_ADXL345_SPI=m
    +CONFIG_AD5686_SPI=m
    $ cd ../../..
    $ cd ti-processor-sdk-linux-edgeai-j722s-evm-11_00_00_08/board-support/ti-linux-kernel-6.12.17+git-ti/
    $ git diff 34d0b070130a8cd2cddd9260389ad974e8cb8468 --	kernel/configs/ti_arm64_prune.config
    diff --git a/kernel/configs/ti_arm64_prune.config b/kernel/configs/ti_arm64_prune.config
    index e0023c8cf50f..b27a6e8735a3 100644
    --- a/kernel/configs/ti_arm64_prune.config
    +++ b/kernel/configs/ti_arm64_prune.config
    @@ -494,3 +494,4 @@ CONFIG_DVB_TDA665x=n
     CONFIG_DVB_DRX39XYJ=n
     CONFIG_DVB_CXD2099=n
     CONFIG_DVB_SP2=n
    +CONFIG_SPI_SLAVE=y
    $
    


    looking at your console log I notice the console message: "`[ 211.835719] spidev spi3.0: RXS timed out`"

    I wonder if your slave bus is not operating under dma but in PIO mode as that message look like belong to pio related functions...


     grep -n 'RXS timed out' drivers/spi/spi-omap2-mcspi.c
    737:					dev_err(&spi->dev, "RXS timed out\n");
    750:							"RXS timed out\n");
    786:					dev_err(&spi->dev, "RXS timed out\n");
    799:							"RXS timed out\n");
    835:					dev_err(&spi->dev, "RXS timed out\n");
    848:							"RXS timed out\n");
    $ 

  • oops., sorry taking back the pio-vs-dma comment, mixed up myself mcu_spi0 supporting dma-only vs pio-only. it was pio-only!

  • re:   #define DMA_MIN_BYTES                   160 (dma vs pio)

    one more follow up test performed with size "(-S)" larger than "DMA_MIN_BYTES" as below but behavior seems the same -- when iteration "(-I)" is greater than 1 the slave (main_spi0) side tend to hang along the way... - FYI.

      master: (mcu_spi0)
         ./spidev_test -D /dev/spidev2.0  -s 5000000 -S 1024 -I 16
    
      slave: (main_spi0)
         ./spidev_test -D /dev/spidev1.0  -s 5000000 -S 1024 -I 16


  • browsing the net again: possibly relevant notes I can see (we maybe switching over to am62a-lp after j722s). Do these apply?

  • Hi Kenji-san,

    I was able to get the spidev to work on J722S on 10.1 SDK. Not sure what was going on with 11.0. I think I see a similar result as your experiment where slave side seems to hang and return back the same message after consecutive messages from master. 

    Below is an example where left side is slave and right side is master. For a write of 1 iteration at a time from master, the slave responds normally. When iterating for more than 1 iteration, the slave side will hang and master will continue to receive the last received byte. 

    I have not tested with the iterative version of spidev_test before, so there is a chance this is a limitation of the spidev_test application itself. Will need a couple of days to look into this.

    Regards,

    Takuma

  • Great! Thanks much Takuma san,


    I agree the behavior reproduced is close enough ... actually identical probably.


    internally we may be seeing implementing some gpio based backing for spidev_test program's "-R (ready)" option, might help but this is still on going and not certain. 


    https://git.ti.com/cgit/keystone-linux/linux/tree/Documentation/spi/spidev_test.c?id=b55f627feeb9d48fdbde3835e18afbc76712e49b#n147

    		case 'R':
    			mode |= SPI_READY;
    			break;


    hope we gain some insights on the original problem on this - that'd clear up our mind a lot!

  • Hi Kenji-san,

    I think this is a behavior of the -I (for iterative mode) option of spidev_test. I made a large text file with a lot of numbers and used it as an input file for the slave side spidev_test, and the hang was not seen until the end of the file (I put "endoffile" as the last text in the experimental file). At the end of the file, the spidev_test application continues to print some random value in RX until it reaches the end of the input to TX, which is similar to what we were seeing in the iterative mode of spidev_test.

    • ./spidev_test -D /dev/spidev3.0 -s 500000 -i test_text.txt -v &
    • ./spidev_test -D /dev/spidev1.0 -s 500000 -S 32 -I 10 -v

    Resulting logs:

    root@j722s-evm:~# ./spidev_test -D /dev/spidev3.0  -s 500000 -i test_text.txt -v &
    [1] 1102
    spi mode: 0x0
    bits per word: 8
    max speed: 500000 Hz (500 kHz)
    root@j722s-evm:~# ./spidev_test -D /dev/spidev1.0  -s 500000 -S 32 -I 5 -v
    spi mode: 0x0
    bits per word: 8
    max speed: 500000 Hz (500 kHz)
    TX | 67 C6 69 73 51 FF 4A EC 29 CD BA AB F2 FB E3 46 7C C2 54 F8 1B E8 E7 8D 76 5A 2E 63 33 9F C9 9A  |g.isQ.J.)......F|.T.....vZ.c3...|
    RX | 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30  |1234567890.1234567890.1234567890|
    TX | 66 32 0D B7 31 58 A3 5A 25 5D 05 17 58 E9 5E D4 AB B2 CD C6 9B B4 54 11 0E 82 74 41 21 3D DC 87  |f2..1X.Z%]..X.^.......T...tA!=..|
    RX | 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39  |.1234567890.1234567890.123456789|
    TX | 70 E9 3E A1 41 E1 FC 67 3E 01 7E 97 EA DC 6B 96 8F 38 5C 2A EC B0 3B FB 32 AF 3C 54 EC 18 DB 5C  |p.>.A..g>.~...k..8\*..;.2.<T...\|
    RX | 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38  |0.1234567890.1234567890.12345678|
    TX | 02 1A FE 43 FB FA AA 3A FB 29 D1 E6 05 3C 7C 94 75 D8 BE 61 89 F9 5C BB A8 99 0F 95 B1 EB F1 B3  |...C...:.)...<|.u..a..\.........|
    RX | 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37  |90.1234567890.1234567890.1234567|
    TX | 05 EF F7 00 E9 A1 3A E5 CA 0B CB D0 48 47 64 BD 1F 23 1E A8 1C 7B 64 C5 14 73 5A C5 5E 4B 79 63  |......:.....HGd..#...{d..sZ.^Kyc|
    RX | 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36  |890.1234567890.1234567890.123456|
    total: tx 0.2KB, rx 0.2KB
    root@j722s-evm:~# ./spidev_test -D /dev/spidev1.0  -s 500000 -S 32 -I 10 -v
    spi mode: 0x0
    bits per word: 8
    max speed: 500000 Hz (500 kHz)
    TX | 67 C6 69 73 51 FF 4A EC 29 CD BA AB F2 FB E3 46 7C C2 54 F8 1B E8 E7 8D 76 5A 2E 63 33 9F C9 9A  |g.isQ.J.)......F|.T.....vZ.c3...|
    RX | 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35  |7890.1234567890.1234567890.12345|
    TX | 66 32 0D B7 31 58 A3 5A 25 5D 05 17 58 E9 5E D4 AB B2 CD C6 9B B4 54 11 0E 82 74 41 21 3D DC 87  |f2..1X.Z%]..X.^.......T...tA!=..|
    RX | 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34  |67890.1234567890.1234567890.1234|
    TX | 70 E9 3E A1 41 E1 FC 67 3E 01 7E 97 EA DC 6B 96 8F 38 5C 2A EC B0 3B FB 32 AF 3C 54 EC 18 DB 5C  |p.>.A..g>.~...k..8\*..;.2.<T...\|
    RX | 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33  |567890.1234567890.1234567890.123|
    TX | 02 1A FE 43 FB FA AA 3A FB 29 D1 E6 05 3C 7C 94 75 D8 BE 61 89 F9 5C BB A8 99 0F 95 B1 EB F1 B3  |...C...:.)...<|.u..a..\.........|
    RX | 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32  |4567890.1234567890.1234567890.12|
    TX | 05 EF F7 00 E9 A1 3A E5 CA 0B CB D0 48 47 64 BD 1F 23 1E A8 1C 7B 64 C5 14 73 5A C5 5E 4B 79 63  |......:.....HGd..#...{d..sZ.^Kyc|
    RX | 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31  |34567890.1234567890.1234567890.1|
    TX | 3B 70 64 24 11 9E 09 DC AA D4 AC F2 1B 10 AF 3B 33 CD E3 50 48 47 15 5C BB 6F 22 19 BA 9B 7D F5  |;pd$...........;3..PHG.\.o"...}.|
    RX | 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A  |234567890.1234567890.1234567890.|
    TX | 0B E1 1A 1C 7F 23 F8 29 F8 A4 1B 13 B5 CA 4E E8 98 32 38 E0 79 4D 3D 34 BC 5F 4E 77 FA CB 6C 05  |.....#.)......N..28.yM=4._Nw..l.|
    RX | 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30  |1234567890.1234567890.1234567890|
    TX | AC 86 21 2B AA 1A 55 A2 BE 70 B5 73 3B 04 5C D3 36 94 B3 AF E2 F0 E4 9E 4F 32 15 49 FD 82 4E A9  |..!+..U..p.s;.\.6.......O2.I..N.|
    RX | 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39  |.1234567890.1234567890.123456789|
    TX | 08 70 D4 B2 8A 29 54 48 9A 0A BC D5 0E 18 A8 44 AC 5B F3 8E 4C D7 2D 9B 09 42 E5 06 C4 33 AF CD  |.p...)TH.......D.[..L.-..B...3..|
    RX | 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38  |0.1234567890.1234567890.12345678|
    TX | A3 84 7F 2D AD D4 76 47 DE 32 1C EC 4A C4 30 F6 20 23 85 6C FB B2 07 04 F4 EC 0B B9 20 BA 86 C3  |...-..vG.2..J.0. #.l........ ...|
    RX | 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37  |90.1234567890.1234567890.1234567|
    total: tx 0.3KB, rx 0.3KB
    root@j722s-evm:~# ./spidev_test -D /dev/spidev1.0  -s 500000 -S 32 -I 10 -v
    spi mode: 0x0
    bits per word: 8
    max speed: 500000 Hz (500 kHz)
    TX | 67 C6 69 73 51 FF 4A EC 29 CD BA AB F2 FB E3 46 7C C2 54 F8 1B E8 E7 8D 76 5A 2E 63 33 9F C9 9A  |g.isQ.J.)......F|.T.....vZ.c3...|
    RX | 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36  |890.1234567890.1234567890.123456|
    TX | 66 32 0D B7 31 58 A3 5A 25 5D 05 17 58 E9 5E D4 AB B2 CD C6 9B B4 54 11 0E 82 74 41 21 3D DC 87  |f2..1X.Z%]..X.^.......T...tA!=..|
    RX | 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35  |7890.1234567890.1234567890.12345|
    TX | 70 E9 3E A1 41 E1 FC 67 3E 01 7E 97 EA DC 6B 96 8F 38 5C 2A EC B0 3B FB 32 AF 3C 54 EC 18 DB 5C  |p.>.A..g>.~...k..8\*..;.2.<T...\|
    RX | 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34  |67890.1234567890.1234567890.1234|
    TX | 02 1A FE 43 FB FA AA 3A FB 29 D1 E6 05 3C 7C 94 75 D8 BE 61 89 F9 5C BB A8 99 0F 95 B1 EB F1 B3  |...C...:.)...<|.u..a..\.........|
    RX | 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33  |567890.1234567890.1234567890.123|
    TX | 05 EF F7 00 E9 A1 3A E5 CA 0B CB D0 48 47 64 BD 1F 23 1E A8 1C 7B 64 C5 14 73 5A C5 5E 4B 79 63  |......:.....HGd..#...{d..sZ.^Kyc|
    RX | 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32  |4567890.1234567890.1234567890.12|
    TX | 3B 70 64 24 11 9E 09 DC AA D4 AC F2 1B 10 AF 3B 33 CD E3 50 48 47 15 5C BB 6F 22 19 BA 9B 7D F5  |;pd$...........;3..PHG.\.o"...}.|
    RX | 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31  |34567890.1234567890.1234567890.1|
    TX | 0B E1 1A 1C 7F 23 F8 29 F8 A4 1B 13 B5 CA 4E E8 98 32 38 E0 79 4D 3D 34 BC 5F 4E 77 FA CB 6C 05  |.....#.)......N..28.yM=4._Nw..l.|
    RX | 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A  |234567890.1234567890.1234567890.|
    TX | AC 86 21 2B AA 1A 55 A2 BE 70 B5 73 3B 04 5C D3 36 94 B3 AF E2 F0 E4 9E 4F 32 15 49 FD 82 4E A9  |..!+..U..p.s;.\.6.......O2.I..N.|
    RX | 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30  |1234567890.1234567890.1234567890|
    TX | 08 70 D4 B2 8A 29 54 48 9A 0A BC D5 0E 18 A8 44 AC 5B F3 8E 4C D7 2D 9B 09 42 E5 06 C4 33 AF CD  |.p...)TH.......D.[..L.-..B...3..|
    RX | 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39  |.1234567890.1234567890.123456789|
    TX | A3 84 7F 2D AD D4 76 47 DE 32 1C EC 4A C4 30 F6 20 23 85 6C FB B2 07 04 F4 EC 0B B9 20 BA 86 C3  |...-..vG.2..J.0. #.l........ ...|
    RX | 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38  |0.1234567890.1234567890.12345678|
    total: tx 0.3KB, rx 0.3KB
    root@j722s-evm:~# ./spidev_test -D /dev/spidev1.0  -s 500000 -S 32 -I 10 -v
    spi mode: 0x0
    bits per word: 8
    max speed: 500000 Hz (500 kHz)
    TX | 67 C6 69 73 51 FF 4A EC 29 CD BA AB F2 FB E3 46 7C C2 54 F8 1B E8 E7 8D 76 5A 2E 63 33 9F C9 9A  |g.isQ.J.)......F|.T.....vZ.c3...|
    RX | 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37  |90.1234567890.1234567890.1234567|
    TX | 66 32 0D B7 31 58 A3 5A 25 5D 05 17 58 E9 5E D4 AB B2 CD C6 9B B4 54 11 0E 82 74 41 21 3D DC 87  |f2..1X.Z%]..X.^.......T...tA!=..|
    RX | 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 65 6E 64 6F 66 66 69 6C 65 0A 31 31 31 31 31 31 31  |890.1234567890.endoffile.1111111|
    TX | 70 E9 3E A1 41 E1 FC 67 3E 01 7E 97 EA DC 6B 96 8F 38 5C 2A EC B0 3B FB 32 AF 3C 54 EC 18 DB 5C  |p.>.A..g>.~...k..8\*..;.2.<T...\|
    RX | 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31  |11111111111111111111111111111111|
    TX | 02 1A FE 43 FB FA AA 3A FB 29 D1 E6 05 3C 7C 94 75 D8 BE 61 89 F9 5C BB A8 99 0F 95 B1 EB F1 B3  |...C...:.)...<|.u..a..\.........|
    RX | 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31  |11111111111111111111111111111111|
    TX | 05 EF F7 00 E9 A1 3A E5 CA 0B CB D0 48 47 64 BD 1F 23 1E A8 1C 7B 64 C5 14 73 5A C5 5E 4B 79 63  |......:.....HGd..#...{d..sZ.^Kyc|
    RX | 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31  |11111111111111111111111111111111|
    TX | 3B 70 64 24 11 9E 09 DC AA D4 AC F2 1B 10 AF 3B 33 CD E3 50 48 47 15 5C BB 6F 22 19 BA 9B 7D F5  |;pd$...........;3..PHG.\.o"...}.|
    RX | 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31  |11111111111111111111111111111111|
    TX | 0B E1 1A 1C 7F 23 F8 29 F8 A4 1B 13 B5 CA 4E E8 98 32 38 E0 79 4D 3D 34 BC 5F 4E 77 FA CB 6C 05  |.....#.)......N..28.yM=4._Nw..l.|
    RX | 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31  |11111111111111111111111111111111|
    TX | AC 86 21 2B AA 1A 55 A2 BE 70 B5 73 3B 04 5C D3 36 94 B3 AF E2 F0 E4 9E 4F 32 15 49 FD 82 4E A9  |..!+..U..p.s;.\.6.......O2.I..N.|
    RX | 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31  |11111111111111111111111111111111|
    TX | 08 70 D4 B2 8A 29 54 48 9A 0A BC D5 0E 18 A8 44 AC 5B F3 8E 4C D7 2D 9B 09 42 E5 06 C4 33 AF CD  |.p...)TH.......D.[..L.-..B...3..|
    RX | 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31  |11111111111111111111111111111111|
    TX | A3 84 7F 2D AD D4 76 47 DE 32 1C EC 4A C4 30 F6 20 23 85 6C FB B2 07 04 F4 EC 0B B9 20 BA 86 C3  |...-..vG.2..J.0. #.l........ ...|
    RX | 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31  |11111111111111111111111111111111|
    total: tx 0.3KB, rx 0.3KB
    TX | 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30  |1234567890.1234567890.1234567890|
    TX | 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39  |.1234567890.1234567890.123456789|
    TX | 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38  |0.1234567890.1234567890.12345678|
    TX | 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37  |90.1234567890.1234567890.1234567|
    TX | 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36  |890.1234567890.1234567890.123456|
    TX | 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35  |7890.1234567890.1234567890.12345|
    TX | 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34  |67890.1234567890.1234567890.1234|
    TX | 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33  |567890.1234567890.1234567890.123|
    TX | 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32  |4567890.1234567890.1234567890.12|
    TX | 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31  |34567890.1234567890.1234567890.1|
    TX | 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A  |234567890.1234567890.1234567890.|
    TX | 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30  |1234567890.1234567890.1234567890|
    TX | 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39  |.1234567890.1234567890.123456789|
    TX | 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38  |0.1234567890.1234567890.12345678|
    TX | 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37  |90.1234567890.1234567890.1234567|
    TX | 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36  |890.1234567890.1234567890.123456|
    TX | 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35  |7890.1234567890.1234567890.12345|
    TX | 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34  |67890.1234567890.1234567890.1234|
    TX | 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33  |567890.1234567890.1234567890.123|
    TX | 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32  |4567890.1234567890.1234567890.12|
    TX | 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31  |34567890.1234567890.1234567890.1|
    TX | 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A  |234567890.1234567890.1234567890.|
    TX | 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30  |1234567890.1234567890.1234567890|
    TX | 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39  |.1234567890.1234567890.123456789|
    TX | 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38  |0.1234567890.1234567890.12345678|
    TX | 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 31 32 33 34 35 36 37  |90.1234567890.1234567890.1234567|
    TX | 38 39 30 0A 31 32 33 34 35 36 37 38 39 30 0A 65 6E 64 6F 66 66 69 6C 65 0A __ __ __ __ __ __ __  |890.1234567890.endoffile.|
    RX | 5E 67 C6 69 73 51 FF 4A EC 29 CD BA AB F2 FB E3 46 7C C2 54 F8 1B E8 E7 8D 76 5A 2E 63 33 9F C9  |^g.isQ.J.)......F|.T.....vZ.c3..|
    RX | 9A 66 32 0D B7 31 58 A3 5A 25 5D 05 17 58 E9 5E D4 AB B2 CD C6 9B B4 54 11 0E 82 74 41 21 3D DC  |.f2..1X.Z%]..X.^.......T...tA!=.|
    RX | 87 70 E9 3E A1 41 E1 FC 67 3E 01 7E 97 EA DC 6B 96 8F 38 5C 2A EC B0 3B FB 32 AF 3C 54 EC 18 DB  |.p.>.A..g>.~...k..8\*..;.2.<T...|
    RX | 5C 02 1A FE 43 FB FA AA 3A FB 29 D1 E6 05 3C 7C 94 75 D8 BE 61 89 F9 5C BB A8 99 0F 95 B1 EB F1  |\...C...:.)...<|.u..a..\........|
    RX | B3 05 EF F7 00 E9 A1 3A E5 CA 0B CB D0 48 47 64 BD 1F 23 1E A8 1C 7B 64 C5 14 73 5A C5 5E 4B 79  |.......:.....HGd..#...{d..sZ.^Ky|
    RX | 63 67 C6 69 73 51 FF 4A EC 29 CD BA AB F2 FB E3 46 7C C2 54 F8 1B E8 E7 8D 76 5A 2E 63 33 9F C9  |cg.isQ.J.)......F|.T.....vZ.c3..|
    RX | 9A 66 32 0D B7 31 58 A3 5A 25 5D 05 17 58 E9 5E D4 AB B2 CD C6 9B B4 54 11 0E 82 74 41 21 3D DC  |.f2..1X.Z%]..X.^.......T...tA!=.|
    RX | 87 70 E9 3E A1 41 E1 FC 67 3E 01 7E 97 EA DC 6B 96 8F 38 5C 2A EC B0 3B FB 32 AF 3C 54 EC 18 DB  |.p.>.A..g>.~...k..8\*..;.2.<T...|
    RX | 5C 02 1A FE 43 FB FA AA 3A FB 29 D1 E6 05 3C 7C 94 75 D8 BE 61 89 F9 5C BB A8 99 0F 95 B1 EB F1  |\...C...:.)...<|.u..a..\........|
    RX | B3 05 EF F7 00 E9 A1 3A E5 CA 0B CB D0 48 47 64 BD 1F 23 1E A8 1C 7B 64 C5 14 73 5A C5 5E 4B 79  |.......:.....HGd..#...{d..sZ.^Ky|
    RX | 63 3B 70 64 24 11 9E 09 DC AA D4 AC F2 1B 10 AF 3B 33 CD E3 50 48 47 15 5C BB 6F 22 19 BA 9B 7D  |c;pd$...........;3..PHG.\.o"...}|
    RX | F5 0B E1 1A 1C 7F 23 F8 29 F8 A4 1B 13 B5 CA 4E E8 98 32 38 E0 79 4D 3D 34 BC 5F 4E 77 FA CB 6C  |......#.)......N..28.yM=4._Nw..l|
    RX | 05 AC 86 21 2B AA 1A 55 A2 BE 70 B5 73 3B 04 5C D3 36 94 B3 AF E2 F0 E4 9E 4F 32 15 49 FD 82 4E  |...!+..U..p.s;.\.6.......O2.I..N|
    RX | A9 08 70 D4 B2 8A 29 54 48 9A 0A BC D5 0E 18 A8 44 AC 5B F3 8E 4C D7 2D 9B 09 42 E5 06 C4 33 AF  |..p...)TH.......D.[..L.-..B...3.|
    RX | CD A3 84 7F 2D AD D4 76 47 DE 32 1C EC 4A C4 30 F6 20 23 85 6C FB B2 07 04 F4 EC 0B B9 20 BA 86  |....-..vG.2..J.0. #.l........ ..|
    RX | C3 67 C6 69 73 51 FF 4A EC 29 CD BA AB F2 FB E3 46 7C C2 54 F8 1B E8 E7 8D 76 5A 2E 63 33 9F C9  |.g.isQ.J.)......F|.T.....vZ.c3..|
    RX | 9A 66 32 0D B7 31 58 A3 5A 25 5D 05 17 58 E9 5E D4 AB B2 CD C6 9B B4 54 11 0E 82 74 41 21 3D DC  |.f2..1X.Z%]..X.^.......T...tA!=.|
    RX | 87 70 E9 3E A1 41 E1 FC 67 3E 01 7E 97 EA DC 6B 96 8F 38 5C 2A EC B0 3B FB 32 AF 3C 54 EC 18 DB  |.p.>.A..g>.~...k..8\*..;.2.<T...|
    RX | 5C 02 1A FE 43 FB FA AA 3A FB 29 D1 E6 05 3C 7C 94 75 D8 BE 61 89 F9 5C BB A8 99 0F 95 B1 EB F1  |\...C...:.)...<|.u..a..\........|
    RX | B3 05 EF F7 00 E9 A1 3A E5 CA 0B CB D0 48 47 64 BD 1F 23 1E A8 1C 7B 64 C5 14 73 5A C5 5E 4B 79  |.......:.....HGd..#...{d..sZ.^Ky|
    RX | 63 3B 70 64 24 11 9E 09 DC AA D4 AC F2 1B 10 AF 3B 33 CD E3 50 48 47 15 5C BB 6F 22 19 BA 9B 7D  |c;pd$...........;3..PHG.\.o"...}|
    RX | F5 0B E1 1A 1C 7F 23 F8 29 F8 A4 1B 13 B5 CA 4E E8 98 32 38 E0 79 4D 3D 34 BC 5F 4E 77 FA CB 6C  |......#.)......N..28.yM=4._Nw..l|
    RX | 05 AC 86 21 2B AA 1A 55 A2 BE 70 B5 73 3B 04 5C D3 36 94 B3 AF E2 F0 E4 9E 4F 32 15 49 FD 82 4E  |...!+..U..p.s;.\.6.......O2.I..N|
    RX | A9 08 70 D4 B2 8A 29 54 48 9A 0A BC D5 0E 18 A8 44 AC 5B F3 8E 4C D7 2D 9B 09 42 E5 06 C4 33 AF  |..p...)TH.......D.[..L.-..B...3.|
    RX | CD A3 84 7F 2D AD D4 76 47 DE 32 1C EC 4A C4 30 F6 20 23 85 6C FB B2 07 04 F4 EC 0B B9 20 BA 86  |....-..vG.2..J.0. #.l........ ..|
    RX | C3 67 C6 69 73 51 FF 4A EC 29 CD BA AB F2 FB E3 46 7C C2 54 F8 1B E8 E7 8D 76 5A 2E 63 33 9F C9  |.g.isQ.J.)......F|.T.....vZ.c3..|
    RX | 9A 66 32 0D B7 31 58 A3 5A 25 5D 05 17 58 E9 5E D4 AB B2 CD C6 9B B4 54 11 __ __ __ __ __ __ __  |.f2..1X.Z%]..X.^.......T.|
    root@j722s-evm:~#
    
    

    Regards,

    Takuma

  • okay understood. Thank you Takuma san,

    The original problem with "-I" use on slave side I think boils down to the inherent race condition in that by the time slave side issued spi "ioctl()" to do its slave transfer, master may have already started the frame transmission already; and linux driver is not written to handle that case gracefully. removing "-I" use on the slave side eliminates that race condition... That much is actually enough for the analysis on this. Let's close this thread!

  • Hi Kenji-san,

    Okay, understood.

    Regards,

    Takuma