Page 1 of 2

How to add a power button to your N2

Posted: Mon Feb 25, 2019 5:33 pm
by odroid
You can add a power button with a few wires soldering.
We've written a guide on this WiKi page.
https://wiki.odroid.com/odroid-n2/appli ... key_wakeup

The blue LED in the button flashes like heartbeat action, if you edit the device-tree file.
You may like this GIF animated image. ;)
Image

Re: How to add a power button to your N2

Posted: Mon Feb 25, 2019 6:41 pm
by rooted
Very nice, thanks for the how-to.

Re: How to add a power button to your N2

Posted: Mon Feb 25, 2019 8:15 pm
by mad_ady
Nice case adjustment. You can leave an opening and it could be used for serial.
Would the power button sold with the h2 work as well?

Re: How to add a power button to your N2

Posted: Mon Feb 25, 2019 9:44 pm
by tobetter
mad_ady wrote:
Mon Feb 25, 2019 8:15 pm
Nice case adjustment. You can leave an opening and it could be used for serial.
Would the power button sold with the h2 work as well?
Technically it is, the problem is the size. In terms of hardware, it would work.

Re: How to add a power button to your N2

Posted: Mon Feb 25, 2019 11:24 pm
by hominoid
Thanks, much appreciated!

Re: How to add a power button to your N2

Posted: Tue Feb 26, 2019 12:45 am
by mad_ady
Out of curiosity, how did you cut through the case evenly?

Re: How to add a power button to your N2

Posted: Tue Feb 26, 2019 4:57 am
by tobetter
mad_ady wrote:
Tue Feb 26, 2019 12:45 am
Out of curiosity, how did you cut through the case evenly?
Simple, cut the surface with a drill and a cutter to make a hole and file until you have an 8 x 8.5mm square.

Re: How to add a power button to your N2

Posted: Thu Apr 11, 2019 12:14 pm
by wallyz21
Momentary or latched switch?

And the button diameter of the specific switch that you used is what, please?

Re: How to add a power button to your N2

Posted: Thu Apr 11, 2019 12:39 pm
by tobetter
wallyz21 wrote:
Thu Apr 11, 2019 12:14 pm
Momentary or latched switch?

And the button diameter of the specific switch that you used is what, please?
Momentary if you follow up the Wiki. Latched switch if you like to control the power at DC jack.
The hole for the switch in the Wiki is about 6-7mm.
https://www.aliexpress.com/item/Led-Lig ... 52543.html

Re: How to add a power button to your N2

Posted: Sun Apr 28, 2019 2:20 am
by sanangel
@odroide Thanks for the tutorial

Re: How to add a power button to your N2

Posted: Sun May 19, 2019 7:01 am
by istanbulls
Hi,
How to do Simple On/Off Odroid N2 Power button/switch.
I'm a beginner, can you teach it simply?
The led heartbeat do not want to led do not want, just power button.

Thank
Edit: I put a button on 9 and 11 GPIO pins, it works.

Re: How to add a power button to your N2

Posted: Sun May 19, 2019 1:35 pm
by mad_ady
For heartbeat led try:

Code: Select all

echo none > /sys/class/leds/blue\:heartbeat/trigger

Re: How to add a power button to your N2

Posted: Sat Jun 15, 2019 3:39 am
by pillemats
Hey

How does it works ?

Only Plug the button cables to gpio and it works ?
I dont Unterstand the tut because my English is Not the best.

I use my n2 with Batocera Linux for emulation!

Should i put the Button to gpio an thats it ?

Thx

Re: How to add a power button to your N2

Posted: Sat Jun 15, 2019 4:00 am
by pillemats
kardanadm wrote:
Sun May 19, 2019 7:01 am
Hi,
How to do Simple On/Off Odroid N2 Power button/switch.
I'm a beginner, can you teach it simply?
The led heartbeat do not want to led do not want, just power button.

Thank
Edit: I put a button on 9 and 11 GPIO pins, it works.
Which Switch did you use ?

In my case it wont works

Re: How to add a power button to your N2

Posted: Sat Jun 15, 2019 5:30 pm
by tobetter
pillemats wrote:
Sat Jun 15, 2019 4:00 am
kardanadm wrote:
Sun May 19, 2019 7:01 am
Hi,
How to do Simple On/Off Odroid N2 Power button/switch.
I'm a beginner, can you teach it simply?
The led heartbeat do not want to led do not want, just power button.

Thank
Edit: I put a button on 9 and 11 GPIO pins, it works.
Which Switch did you use ?

In my case it wont works
How did you connect the switch? And what's the switch you use?

Re: How to add a power button to your N2

Posted: Sat Jun 15, 2019 7:11 pm
by pillemats
This one for testing on Pin 9 + 11

Re: How to add a power button to your N2

Posted: Sun Jun 16, 2019 4:42 am
by tobetter
@pillemats, the switch would work if you wire properly. Also, please double check your boot.ini.
https://wiki.odroid.com/odroid-n2/appli ... ng_bootini

Re: How to add a power button to your N2

Posted: Sun Jun 16, 2019 5:53 am
by pillemats
How do i wired propably?

I think i Need a pic with the connections

Do you have it?

Re: How to add a power button to your N2

Posted: Thu Jul 11, 2019 10:45 pm
by democles
Here is a picture with wat jou have to copy and past in the boot.ini file.
Works great :D
I edit it with WEBMIN.

aangepast.jpg
aangepast.jpg (155.76 KiB) Viewed 11648 times

Re: How to add a power button to your N2

Posted: Fri Jul 12, 2019 3:03 pm
by joy
pillemats wrote:
Sun Jun 16, 2019 5:53 am
How do i wired propably?

I think i Need a pic with the connections

Do you have it?
Do you have a PCB layout and circuit description of your button part?

Please refer to this wiki page for the wire connections.
https://wiki.odroid.com/odroid-n2/appli ... are_set-up
https://wiki.odroid.com/odroid-c2/appli ... are_set-up

Re: How to add a power button to your N2

Posted: Sun Sep 15, 2019 9:54 pm
by superpowter77
Very nice solution. Alternately, if you just want to play "safe" without getting your hands "dirty", you can just spend $12 USD bucks and get a "Smart Plug Mini WiFi Outlet" just for the Odroid-N2 with an On/Off switch controlled from any Android phone. Also, 100% compatible with Alexa and Google Home where a simply vocal command will suffice.

Re: How to add a power button to your N2

Posted: Wed Sep 18, 2019 2:11 am
by istanbulls
Boot.ini does not work when you change boot.ini for Ubuntu Mate

setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw ${condev} ${amlogic} no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop hdmimode=${hdmimode} cvbsmode=576cvbs max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} voutmode=${voutmode} disablehpd=${disablehpd}" Do not paste this code. Protect your existing code.

Code: Select all

 
setenv gpiopower "479"
setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw ${condev} ${amlogic} no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop hdmimode=${hdmimode} cvbsmode=576cvbs max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} voutmode=${voutmode} ${cmode} disablehpd=${disablehpd} cvbscable=${cvbscable} overscan=${overscan} ${hid_quirks} monitor_onoff=${monitor_onoff} logo=osd0,loaded ${cec_enable}"
setenv bootargs ${bootargs} gpiopower=${gpiopower}

Re: How to add a power button to your N2

Posted: Wed Sep 18, 2019 8:30 am
by odroid
Sorry for the inconvenience caused.
I've updated the wiki page.
https://wiki.odroid.com/odroid-n2/appli ... ng_bootini

Re: How to add a power button to your N2

Posted: Wed Sep 18, 2019 10:22 pm
by superpowter77
Excellent job. Finally,we have a well written and Visual documented guide to DIY.

Re: How to add a power button to your N2

Posted: Thu Nov 28, 2019 12:01 am
by vayd3r
I'm also trying to get this to work for Batocera linux. I have a momentary switch on pins 9 and 11. However, my kernel bootargs are different so I don't want to just paste in what's in the wiki. Is there a specific parameter on the bootargs line I should be looking for, or add?

Code: Select all

setenv bootargs "label=BATOCERA console=tty3 quiet loglevel=0 consoleblank=0 vt.global_cursor_default=0 hdmimode=${hdmimode} max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} voutmode=${voutmode} disablehpd=${disablehpd}"

### wake stuff
setenv gpiopower "479"
setenv bootargs ${bootargs} gpiopower=${gpiopower}
I know the button works because I was using it for GPIO wake on a Raspberry Pi 3.

Re: How to add a power button to your N2

Posted: Thu Nov 28, 2019 12:29 am
by tobetter
vayd3r wrote:
Thu Nov 28, 2019 12:01 am
I'm also trying to get this to work for Batocera linux. I have a momentary switch on pins 9 and 11. However, my kernel bootargs are different so I don't want to just paste in what's in the wiki. Is there a specific parameter on the bootargs line I should be looking for, or add?

Code: Select all

setenv bootargs "label=BATOCERA console=tty3 quiet loglevel=0 consoleblank=0 vt.global_cursor_default=0 hdmimode=${hdmimode} max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} voutmode=${voutmode} disablehpd=${disablehpd}"

### wake stuff
setenv gpiopower "479"
setenv bootargs ${bootargs} gpiopower=${gpiopower}
I know the button works because I was using it for GPIO wake on a Raspberry Pi 3.
I think the last two lines are fair enough to enable GPIO switch, it just adds gpiopower=479 right after disablehpd=${disablehpd} in the command line.

Re: How to add a power button to your N2

Posted: Thu Nov 28, 2019 2:03 am
by vayd3r
Right, that's what I originally thought. But since it wasn't working I figured there must be a necessary kernel parameter also.

So does pressing the button just cut power to the N2 while it's on? And when it's off you hold the button for 2 seconds to wake it? That's what I gathered from the wiki. Really confused as to why this isn't working.

Re: How to add a power button to your N2

Posted: Thu Nov 28, 2019 2:19 am
by tobetter
vayd3r wrote:
Thu Nov 28, 2019 2:03 am
Right, that's what I originally thought. But since it wasn't working I figured there must be a necessary kernel parameter also.

So does pressing the button just cut power to the N2 while it's on? And when it's off you hold the button for 2 seconds to wake it? That's what I gathered from the wiki. Really confused as to why this isn't working.
I am not sure if the Linux kernel for BATOCERA enables GPIO input driver or not when I had tried to run it last week for some other issue, even it does not give a kernel message or shell prompt. Then I've not looked into yet. Any idea if you can get a shell problem on it?

Re: How to add a power button to your N2

Posted: Fri Nov 29, 2019 9:46 pm
by vayd3r
Yep I can get a shell on Batocera. Should I be seeing something in the kernel ring buffer (dmesg output) when I press the button? For the driver, is the kernel config option you’re talking about CONFIG_GPIO_GENERIC or is there another option that is needed? I can try to see if the kernel config is available through /proc/config.

Re: How to add a power button to your N2

Posted: Sat Jan 25, 2020 4:06 am
by Cosmicbase
Hello I have used pin 1 and 6 for the LED and 9 and 11 for the switch.
Unfortunately, the LED burns permanently. The switch does not work as it should.
My Odroid N2 comes with CoreElec.

Did I do something wrong?

Re: How to add a power button to your N2

Posted: Sat Jan 25, 2020 9:09 am
by cdu13a
Cosmicbase wrote:
Sat Jan 25, 2020 4:06 am
Hello I have used pin 1 and 6 for the LED and 9 and 11 for the switch.
Unfortunately, the LED burns permanently. The switch does not work as it should.
My Odroid N2 comes with CoreElec.

Did I do something wrong?
For the switch did you set gpiopower=479 in your config.ini file? This is required for the switch to work as a power switch. (479 = pin 11 for other pin numbers see https://wiki.odroid.com/odroid-n2/hardw ... connectors)

As for the LED, what did you intend the LED to indicate? Having it connected between the pin 1 (3.3v) and pin 6 (ground) means that it's will always have power.

Re: How to add a power button to your N2

Posted: Sat Jan 25, 2020 9:22 am
by Cosmicbase
cdu13a wrote:
Sat Jan 25, 2020 9:09 am
Cosmicbase wrote:
Sat Jan 25, 2020 4:06 am
Hello I have used pin 1 and 6 for the LED and 9 and 11 for the switch.
Unfortunately, the LED burns permanently. The switch does not work as it should.
My Odroid N2 comes with CoreElec.

Did I do something wrong?
For the switch did you set gpiopower=479 in your config.ini file? This is required for the switch to work as a power switch. (479 = pin 11 for other pin numbers see https://wiki.odroid.com/odroid-n2/hardw ... connectors)

As for the LED, what did you intend the LED to indicate? Having it connected between the pin 1 (3.3v) and pin 6 (ground) means that it's will always have power.
Thank you for your answer.
I don't want the LED to be on all the time. I loved the heartbeat.
The best way to get the LED off is when the N2 is off.

Only this 2 lines in config.ini?
setenv gpiopower "479"
setenv bootargs ${bootargs} gpiopower=${gpiopower}

For heartbeat Do I seem to have to use #6 and #8?
What exactly do I have to write in .dtsi?

Re: How to add a power button to your N2

Posted: Sat Jan 25, 2020 10:34 am
by cdu13a
Cosmicbase wrote:
Sat Jan 25, 2020 9:22 am
cdu13a wrote:
Sat Jan 25, 2020 9:09 am
Cosmicbase wrote:
Sat Jan 25, 2020 4:06 am
Hello I have used pin 1 and 6 for the LED and 9 and 11 for the switch.
Unfortunately, the LED burns permanently. The switch does not work as it should.
My Odroid N2 comes with CoreElec.

Did I do something wrong?
For the switch did you set gpiopower=479 in your config.ini file? This is required for the switch to work as a power switch. (479 = pin 11 for other pin numbers see https://wiki.odroid.com/odroid-n2/hardw ... connectors)

As for the LED, what did you intend the LED to indicate? Having it connected between the pin 1 (3.3v) and pin 6 (ground) means that it's will always have power.
Thank you for your answer.
I don't want the LED to be on all the time. I loved the heartbeat.
The best way to get the LED off is when the N2 is off.

Only this 2 lines in config.ini?
setenv gpiopower "479"
setenv bootargs ${bootargs} gpiopower=${gpiopower}

For heartbeat Do I seem to have to use #6 and #8?
What exactly do I have to write in .dtsi?
The setenv lines are for if you are changing the boot.ini file if you are using ubuntu or another similar os.

If you are using CoreELEC you just need to add just the the following line to the /flash/config.ini file.

Code: Select all

gpiopower=479
Also I should note that the /flash partition is mounted read only. So you will have to remount it to make it writable with the following command before you can edit the /flash/config.ini file

Code: Select all

mount -o remount,rw /flash

Re: How to add a power button to your N2

Posted: Sat Jan 25, 2020 11:14 am
by cdu13a
Cosmicbase wrote:
Sat Jan 25, 2020 9:22 am

For heartbeat Do I seem to have to use #6 and #8?
What exactly do I have to write in .dtsi?
Yes pins #6(GND) and #8 (GPIOX.12) if you want to be able to control the LED.

However the following instructions on the wiki has a few problems.
Odroid Wiki - https://wiki.odroid.com/odroid-n2/application_note/gpio/gpio_key_wakeup#heartbeat_led_action_on_the_power_button_led wrote:
For LED heartbeat action, you need to modify this dtsi file, build dtb image again and replace meson64_odroidn2.dtb in /media/boot.
There are a few problems here if you want this to work with CoreELEC.
1. You would need to build a dtb file using the CoreELEC kernel source not the hardkernel source. Because CoreELEC uses a different kernel that is more optimized for media playback then the one that is used by hardkernel.
2. CoreELEC has a different name and location for it's dtb files.
3. CoreELEC updates it's dtb files when you update CoreELEC, which would overwrite any custom dtb file that you used.

I can solve the first two for you by making a dtb file with the required changes, and give you instructions on where it needs to be put. Which will get it working for you for now.
As for the last one I can talk with the other CoreELEC developers and see if we can work out a way of handling this type of LED mod better.

Re: How to add a power button to your N2

Posted: Sat Jan 25, 2020 7:01 pm
by Cosmicbase
OK that would be really great if you could help me with that.

Re: How to add a power button to your N2

Posted: Sat Jan 25, 2020 11:50 pm
by Cosmicbase
So I don't need to change anything in Boot.ini?
Add "gpiopower = 479" only in config.ini?

setenv gpiopower "479"
setenv bootargs “$ {initargs} $ {displayopt} $ {coreelec} gpiopower = $ {gpiopower}”

Re: How to add a power button to your N2

Posted: Sun Jan 26, 2020 1:25 am
by cdu13a
Cosmicbase wrote:
Sat Jan 25, 2020 11:50 pm
So I don't need to change anything in Boot.ini?
Add "gpiopower = 479" only in config.ini?

setenv gpiopower "479"
setenv bootargs “$ {initargs} $ {displayopt} $ {coreelec} gpiopower = $ {gpiopower}”

The part that needs to be in the boot.ini to handle the gpiopower setting is already there on CoreELEC. You just need to add the gpiopower=479 line to the config.ini file so that it knows which gpio pin your switch is attached to.

Re: How to add a power button to your N2

Posted: Sun Jan 26, 2020 6:14 am
by Cosmicbase
@cdu13a
I've followed your steps and it works.
There are still ways to change the heartbeat.
For example, slower or faster or a soft fade-in and hide.

Thank you very much.

Re: How to add a power button to your N2

Posted: Thu Jan 30, 2020 2:20 pm
by mxmilkb
I got this, works well for me.

Re: How to add a power button to your N2

Posted: Fri Jan 31, 2020 12:44 am
by Cosmicbase
Hello, is there a way to control the LED in the power button brighter or darker?
I have disabled heartbeat. The power button works very well.
I just want to change the brightness of the LED.
Maybe there is also a smooth soft effect from light to dark ad return?

Re: How to add a power button to your N2

Posted: Fri Mar 06, 2020 10:51 pm
by Cosmicbase
@cdu13a

Hello I use CoreElec up to date.
Heartbeat is not working.
I tried all but nothing helps.

Do I need to replace a .dtb or anything?

Re: How to add a power button to your N2

Posted: Mon Mar 30, 2020 3:03 pm
by naitreia
tobetter wrote:
Thu Nov 28, 2019 12:29 am
vayd3r wrote:
Thu Nov 28, 2019 12:01 am
I'm also trying to get this to work for Batocera linux. I have a momentary switch on pins 9 and 11. However, my kernel bootargs are different so I don't want to just paste in what's in the wiki. Is there a specific parameter on the bootargs line I should be looking for, or add?

Code: Select all

setenv bootargs "label=BATOCERA console=tty3 quiet loglevel=0 consoleblank=0 vt.global_cursor_default=0 hdmimode=${hdmimode} max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} voutmode=${voutmode} disablehpd=${disablehpd}"

### wake stuff
setenv gpiopower "479"
setenv bootargs ${bootargs} gpiopower=${gpiopower}
I know the button works because I was using it for GPIO wake on a Raspberry Pi 3.
I think the last two lines are fair enough to enable GPIO switch, it just adds gpiopower=479 right after disablehpd=${disablehpd} in the command line.
Hi,
i also try to get the power button work with batocera also without success...
I implemented like above but there is no reaction when i press the button...someone here to help?

Re: How to add a power button to your N2

Posted: Sun Apr 05, 2020 5:57 pm
by XFer
Hello,
I'm on official HK Ubuntu Minimal 18.04 (headless), with latest updates:

Code: Select all

Linux odroid 4.9.216-69 #1 SMP PREEMPT Mon Mar 16 14:58:58 -03 2020 aarch64 aarch64 aarch64 GNU/Linux
Everything installed on microSD.

I've followed the instructions on the Wiki and connected a temporary switchbutton on pin9 (ground) and pin11.

My boot.ini has the following, related lines:

Code: Select all

### Power button on pin 11
setenv gpiopower "479"

# Boot Args
setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw ${condev} ${amlogic} no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop hdmimode=${hdmimode} cvbsmode=576cvbs max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} voutmode=${voutmode} ${cmode} disablehpd=${disablehpd} cvbscable=${cvbscable} overscan=${overscan} ${hid_quirks} monitor_onoff=${monitor_onoff} ${cec_enable} sdrmode=${sdrmode}"
setenv bootargs "${bootargs} gpiopower=${gpiopower}"
Shutdown works well.
Power on (long button press) does not: the red light comes on, but the boot won't start (no blue light).

Is there anything I could try?

Thanks!

Re: How to add a power button to your N2

Posted: Mon Apr 06, 2020 9:14 am
by odroid
You might need to set the slide switch position to "MMC" mode.
Also check the cmdline string whether the bootargs passed to the Linux kernel or not.

Code: Select all

cat /proc/cmdline

Re: How to add a power button to your N2

Posted: Mon Apr 06, 2020 7:10 pm
by XFer
Hello, thanks for the support.

The slide switch is already (has always been) on MMC.

/proc/cmdline:

Code: Select all

root@odroid:~# cat /proc/cmdline
root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw console=ttyS0,115200n8  no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop hdmimode=480x320p60hz cvbsmode=576cvbs max_freq_a53=1896 max_freq_a73=1800 maxcpus=6 voutmode=hdmi  disablehpd=false cvbscable=0 overscan=100 usbhid.quirks=0x0eef:0x0005:0x0004 monitor_onoff=false  sdrmode=sdr gpiopower=479
The red light turns on, but that's all.
Nothings shows up on the serial console, either. :(

Re: How to add a power button to your N2

Posted: Tue Apr 07, 2020 1:55 pm
by joy
Hi @Xfer,
Thanks for sharing the cmdline.
It looks there is no issue of your boot.ini setup.

It's needed to check the boot loader version of ubuntu image that you're using.
I will check it soon from the latest Ubuntu image version.

And could you check the followings to confirm your test environment?
(1)
Can you check uboot version using this uboot command after entering u-boot console?

Code: Select all

# version
(2)
Which Ubuntu minimal image version are you using?

Re: How to add a power button to your N2

Posted: Tue Apr 07, 2020 3:53 pm
by joy
Hi @Xfer,
I've checked this function on the latest image of Ubuntu minimal, ( https://wiki.odroid.com/odroid-n2/os_im ... u/20200229 )
and confirmed it works normally.
This function implemented quite a while ago, so it would work unless you're using very old version. :roll:
As I checked your previous post, it looks you're using the latest ubuntu minimal image, right?
And connections looks OK. pin#9 & pin#11.

To boot up using power button, long press event over 1~2 second is needed.
Could you keep pushing your button for 2 seconds?

Re: How to add a power button to your N2

Posted: Tue Apr 07, 2020 6:20 pm
by XFer
Hello joy, thanks for following up.

I'm running the latest Ubuntu Minimal image (ubuntu-18.04.4-4.9-minimal-odroid-n2-20200229), with latest updates, installed on 64GB microSD (it's the only installed media); slide switch on "MMC".

I hold the button for 2 seconds; the red LED turns on, but it remains stuck as is: no boot, nothing on the serial console, no blue LED.

If I plug off the power plug and re-connect, it boots normally.

Re: How to add a power button to your N2

Posted: Tue Apr 07, 2020 6:40 pm
by joy
@Xfer,
Thanks for sharing the detailed information of your test environment. :)

I've checked recent updates of uboot and found there are some uboot updates since Feb 17.
https://github.com/hardkernel/u-boot/co ... 5f80acaf07

The uboot version that I tested is Feb 17 and maybe it's not the latest uboot.

Code: Select all

odroidn2#ver

U-Boot 2015.01-g3b8b5cb (Feb 17 2020 - 08:16:24)
aarch64-none-elf-gcc (crosstool-NG linaro-1.13.1-4.8-2013.11 - Linaro GCC 2013.10) 4.8.3 20131111 (prerelea
se)
GNU ld (crosstool-NG linaro-1.13.1-4.8-2013.11 - Linaro GCC 2013.10) 2.23.2.20130610 Linaro 2013.10-4
:o Sorry. I will check it using the latest uboot update soon.

Re: How to add a power button to your N2

Posted: Tue Apr 07, 2020 7:44 pm
by joy
@XFer,
I've updated all packages and checked it again.
uboot version is still 17 Feb.
And then, I compiled the latest uboot source code and confirmed wakeup works normally.
It look there is no problem related to uboot. My guess was wrong.

Can you check the followings?

[1]
If you have uart-to-usb module, please share poweroff log message using gpio button poweroff.
Here is my example.

Code: Select all

.....
.....
[  OK  ] Reached target Unmount All Filesystems.
[  OK  ] Stopped target Local File Systems (Pre).
[  OK  ] Stopped Create Static Device Nodes in /dev.
[  OK  ] Stopped Remount Root and Kernel File Systems.
[  OK  ] Reached target Shutdown.
[  OK  ] Reached target Final Step.
         Starting Power-Off...
[   19.551738@0] reboot: Power down
bl31 reboot reason: 0x108
bl31 reboot reason: 0x108
system cmd  0.
bl30 get wakeup sources!
process command 00000006
bl30 enter suspend!
Little core clk suspend rate 1896000000
Big core clk suspend rate 1800000000
store restore gp0 pll
suspend_counter: 1
Enter ddr suspend
ddr suspend time: 17us
alarm=0S
process command 00000001
GPIOA_11/13 off
cec ver:2018/04/19
CEC cfg:0x003f
WAKEUP GPIO cfg:0x000001df
use vddee new table!
cec reset
Set cec pinmux:0x11
kern log_addr:0x00
cec T: 00
cec_triggle_tx:TX_ERROR
Set cec log_addr:0x10,ADDR0:10
customer pwrkeys for IR is NULL, use defaults!

(here, end of message)
[2]
Do you use 2 wires button?
Could you show me button connection?

[3]
Remove all external devices including HDMI, ethernet, then check it again.

Sorry for many request.

As you said, when you try wakeup after poweroff, red led turns on,
that means wakeup logic detects button event normally and then boot stuck at some point, I think.
I will think over points to be suspicious.