Wake using UART0 RX

Hi Robert,

Good Morning. I just have a question for the benefit of my understanding. I setup Console UART0 (Debug COM port) as wake source from sleep. It works for both Rx and Tx signals. My question is: what is reason that RX signal (RX on PC host end) can wake up the micro? Suppose the RX is connected to the TX signal of the micro. Why an output gpio is enable to generate an interrupt to the CPU?

Best Regards,
David

Hi @dzhou , oh this is custom to the AM335x, I don’t remember the exact details, but any pin on the GPIO0 bank is automatically setup as wakeup source from a deep sleep (the UART0 is also able to do this). Since uart0’s RX and TX’s are both on GPIO0, they both can trigger a startup situation.

Regards,

Hi Robert,

Thank you for your answer.
Only the GPIOs on BANK0 are capable for wake-up. But GPIO pin exports under /sys/class/gpio seem not including the wakeup attributes ( writable state for registering as enabled/disabled) .
image

Power folder:
image

Anything needs to be done for a specific GPIO, such as GPIO0_26, in order to be enabled for wakeup?

Best Regards,
David

Hi @dzhou wire the pin as a gpio_button and use the wakeup-source; flag:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/am335x-evm.dts#n105

	gpio_keys: volume_keys0 {
		compatible = "gpio-keys";
		#address-cells = <1>;
		#size-cells = <0>;
		autorepeat;

		switch9 {
			label = "volume-up";
			linux,code = <115>;
			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
			wakeup-source;
		};

		switch10 {
			label = "volume-down";
			linux,code = <114>;
			gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
			wakeup-source;
		};
	};

Regards,

Hi Robert,

I guess it needs to be recompiled or to have a patch.
With the O/S kernel we use, both GPIO0_2 and GPIO0_3 have no WAKE item under power folder.

I am going to use UART0 TXD as wake source.

Best Regards,
David

I’m not 100% sure that flag would even set a wake item in the power folder for am335x…

Regards,

Hi Robert,
So using serial
echo enabled > /sys/devices/platform/ocp/44e09000.serial/power/wakeup
is a good choice, wasting no time.

Best Regards,
David

Hi Robert,
I think I figured out that why Uart Tx can be used for triggering wake up from sleep. It is eventually through an interrupt for the port. If USB-To-SERIAL is connected to the UART0, then a pulse to Tx or Rx pin will wake up. If the cable is not connected to the UART port, then any pulses to Tx pin will not wake up, but a pulse to Rx pin will wake up.

Best Regards,
David