GPIO for trigger function, but it always give us two triggers

I follow this issue almost two month.

We use one GPIO for trigger function. we configure it with falling trigger, but it always give us two triggers.

Receive function:

void InTrigerThread::run()
{
    while(workerEnd == false)
    {
        nfds = epoll_wait(epollfd, events,MAX_PLC_NUM,TIMEOUT);
        if ((nfds < 0)||(nfds ==0))
        {
            qDebug()<< "nfds is" << nfds;
            continue;
        }
        for(int i= 0;i<nfds;i++ )
        {
            for(int j=0;j < inputCnt; j++)
            {
                if((events[i].data.fd == gpio_fd[j])&& (events[i].events&EPOLLPRI))
                {
                    len = read(events[i].data.fd,buf,sizeof(buf));
                    lseek(events[i].data.fd,0,SEEK_SET);

                    if(LogHandler::getInstance()->logIsEnabled())
                    {
                        qDebug() << "InTrigerThread gpioTrigered GPIO  == "<<inputGpioList[j];
                    }
                    emit gpioTrigered(inputGpioList[j]);
                }
            }
        }
     }
}

The GPIO trigger with failing, the first signal is OK. But we always received a signal with rising(red box).
image

image

We test it with oscilloscope, when the signal with a slop, it will be triggered, this is an inevitable problem on Jetson Nano.

Thanks in advance

Not quite understand your case, please share the circuit connection on this. Is the GPIO output or input?

Hello, Trumany.

Only GPIO function. We have an application want to block waiting for the GPIO to change level. So we configure the GPIO as an interrupt source.

Step1: Configure GPIO an input and configure GPIO an interrupt source.

Step2: Configure the interrupt occurs when the GPIO signal has a falling edge.

Step3: My application read the value file and the read is block until the interrupt occurs.

We configure the interrupt occurs with a falling edge, but we also can receive an interrupt at rising edge.

Trigger 1000 times, there will be about 10 more triggers.

But TX2 is ok, no this issue.

Thank you very much.

hello leonha,

please share your GPIO configuration for reference,
you might disassembler the dtb file into text file,
for example, $ dtc -I dtb -O dts -o output.txt kernel/dtb/tegra210-p3448-0002-p3449-0000-b00.dtb

there’s definition for GPIOs,
for example,

gpio@6000d000 {
                default {
                        gpio-input = <...>;
                        gpio-output-low = <...>;
                        gpio-output-high = <...>;

Hello, Jerry

Kindly please receive the definition for GPIOs.

 gpio@6000d000 {
		compatible = "nvidia,tegra210-gpio", "nvidia,tegra124-gpio", "nvidia,tegra30-gpio";
		reg = <0x0 0x6000d000 0x0 0x1000>;
		interrupts = <0x0 0x20 0x4 0x0 0x21 0x4 0x0 0x22 0x4 0x0 0x23 0x4 0x0 0x37 0x4 0x0 0x57 0x4 0x0 0x59 0x4 0x0 0x7d 0x4>;
		#gpio-cells = <0x2>;
		gpio-controller;
		#interrupt-cells = <0x2>;
		interrupt-controller;
		gpio-ranges = <0x3b 0x0 0x0 0xf6>;
		status = "okay";
		gpio-init-names = "default";
		gpio-init-0 = <0x3c>;
		gpio-line-names = [00 00 00 00 00 00 00 00 00 00 00 00 53 50 49 31 5f 4d 4f 53 49 00 53 50 49 31 5f 4d 49 53 4f 00 53 50 49 31 5f 53 43 4b 00 53 50 49 31 5f 43 53 30 00 53 50 49 30 5f 4d 4f 53 49 00 53 50 49 30 5f 4d 49 53 4f 00 53 50 49 30 5f 53 43 4b 00 53 50 49 30 5f 43 53 30 00 53 50 49 30 5f 43 53 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 50 49 4f 31 33 00 00 00 00 00 00 00 00 00 00 00 00 55 41 52 54 31 5f 52 54 53 00 55 41 52 54 31 5f 43 54 53 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 32 53 30 5f 46 53 00 49 32 53 30 5f 44 49 4e 00 49 32 53 30 5f 44 4f 55 54 00 49 32 53 30 5f 53 43 4c 4b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 50 49 4f 30 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 50 49 4f 30 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 50 49 4f 31 32 00 00 00 00 00 00 47 50 49 4f 31 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 50 49 4f 30 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53 50 49 31 5f 43 53 31 00 00 00 00 00 00 00 00];
		linux,phandle = <0x56>;
		phandle = <0x56>;

		camera-control-output-low {
			gpio-hog;
			output-low;
			gpios = <0x97 0x0 0x98 0x0>;
			label = "cam1-pwdn", "cam2-pwdn";
		};

		e2614-rt5658-audio {
			gpio-hog;
			function;
			gpios = <0x4c 0x0 0x4d 0x0 0x4e 0x0 0x4f 0x0 0xd8 0x0 0x95 0x0>;
			label = "I2S4_LRCLK", "I2S4_SDIN", "I2S4_SDOUT", "I2S4_CLK", "AUDIO_MCLK", "AUD_RST";
			status = "disabled";
			linux,phandle = <0xda>;
			phandle = <0xda>;
		};

		system-suspend-gpio {
			status = "okay";
			gpio-hog;
			output-high;
			gpio-suspend;
			suspend-output-low;
			gpios = <0x6 0x0>;
			linux,phandle = <0xb2>;
			phandle = <0xb2>;
		};

		default {
			gpio-input = <0xd8 0xc 0xd 0xe 0xf 0xe8 0x26 0x95 0x5 0xbc 0xbd 0xbe 0xc1 0xc2 0xa8 0xa9 0xc8 0xca 0x4d 0x4e 0x4c 0x4f 0x32 0x33 0x10 0x11 0x12 0x13 0x14 0x3a 0x3d 0x3e 0xe4>;
			gpio-output-low = <0x97 0x98 0x38 0x3b 0x3c 0x3f 0x40 0x42>;
			gpio-output-high = <0x6 0xbb 0x41 0xe7>;
			linux,phandle = <0x3c>;
			phandle = <0x3c>;
		};
	};

Thank you very much.
Best regards.

output.txt (279.4 KB)

hello leonha,

may I also which GPIO pin you’re used for testing, are you using GPIO pin on Nano J41?
thanks

Hello, JerryChang

We use GPIO62, GPIO63, GPIO66, GPIO149, GPIO194.
My Nano J41 have some issue, so it cannot working now. I am trying to fix it and test this issue.
I will share you the test result ASAP.

Thank you very much.

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

Is this still an issue to support? Any result can be shared?

Hello, i have a business trip to support project in the past month.

i have test on the nvidia carry board. no issue untill now. maybe there are some difference between nvidia carry board and our customer design board. our hardware engineer just try to fix it.

thank you very much.
best regards.

Thanks for the update, if further HW issue, please don’t hesitate to ask support here.