NitroPC Power on after power failure does not work

Hi,
After a power loss, my running NitroPC does not start automatically, but I have to push the power button. The last entry in topic NitroPC: remote power on, seems to indicate that this should work, I also have another coreboot device (not a NitroPC) that starts automatically after a power outage.

Are there readers who know what the expected behavior is for a NitroPC? Or who have this functionality working?

Regards,

Daan

I did some more investigation myself.

DISCLAIMER: I know nothing about coreboot, so the following could be wrong. I only did buy a coreboot system to support the project.

What I think is the case:

  • For coreboot it seems that for every change in the settings you have to build new firmware.
  • The firmware in my system is possibly build with the setting ‘System Power State after Failure’ set to “Off”.

The results of my investigation:
Before the coreboot build you create a configuration with all the settings for the selected hardware and the other settings you want. From the .config file you can generate a defconfig file, which contains only the settings that are non-default. The commands are the following:

$ make distclean    -> Reset configuration
$ make menuconfig   -> Change configuration. Save as .config file
$ make savedefconfig -> Creates a defconfig from .config

Then I went to the Nitrokey corebuilder project . The NitroPC mainboard configuration seems to be the ‘Purism Librem Mini v2’. When I select this mainboard in menuconfig, I get the setting ‘System Power State after Failure’, with three options.

( ) S5 Soft Off
( ) S0 Full On
(X) Keep Previous State 

If I select the last option, the following line is added to the defconfig: CONFIG_POWER_STATE_PREVIOUS_AFTER_FAILURE=y

So it seems to me, that if I add this line to the file nitropc-defconfig, and build a new firmware image, I might get the expected behavior. The only thing that does not fit my story, is that the default setting is “S0 Full On”.

Is there anyone with more knowledge who can confirm the above is correct?

hey @ddjnitro,

you are on the right path, but also not entirely :smiley:

I’ve been looking into this previously, but actually did not find the reason why this is not working with the current coreboot firmware. In fact CONFIG_POWER_STATE_ON_AFTER_FAILURE is set for the build, you can check this in the repository by generating the entire coreboot configuration and then check for it like that:

$ git reset --hard # reset repo to original state
$ make clean
$ make TARGET=nitropc
# now cancel the build process with ctrl+c
$ cd coreboot
$ grep POWER_STATE_ .config
...
CONFIG_POWER_STATE_ON_AFTER_FAILURE=y
...

As you assumed this is the default, so sorry can’t really help here.
Might be worth a try to use PREVIOUS_STATE

disclaimer: be careful what you flash, if you flash the wrong thing your NitroPC can only be revived with an external flasher.

best

Thank you for the help. For now I leave the settings as is, and will not flash new firmware until I have an external programmer. Just to be sure, I don’t end up with a brick.

I need this feature working on my NitroPC, since I’m tired to walk to the remote location where my NitroPC is at when it down after a power failure.
Is there any progress or did anyone made this working ?

@daringer I followed your instructions above and could build a firmware image (firmware-nitropc.rom).
Could you please tell me how to flash it ? Am I right that flashrom -p internal -w firmware-nitropc.rom should do it (using flashrom v1.3rc1 ?). Proper documentation about the flash process on NitroPC - Nitrokey Documentation would be appreciated.
Also, what’s the proper pre-built firmware image to use from Index of /files/ci/nitropc ? I see a coreboot/ dir with one firmware image, and a tianocore/ dir with two potential NitroPC images (firmware-nitropc.rom and tianocore-4.13.rom).

Hey @varac,

yes, using flashrom and -p internal is the right way, please keep in mind that, something goes wrong your NitroPC will not boot anymore and you will need to flash a (working) firmware using an external flasher and opening the NitroPC.

flashrom >= 1.2 should work w/o issues, so 1.3rc1 is fine.

the current firmware image is this one: https://www.nitrokey.com/files/ci/nitropc/tianocore/firmware-nitropc.rom

best