I am planning to use apalis imx8 to develop a QT application, which boots on startup.
The plan wasas following
When toradex is powered. it goes to a sleep state (ie with uboot starting but system in a low power mode)
The system will be waiting for change in Gpio ( connected to Push button). When its pressed and hold for X Seconds, Normal boot of toradex happens.
I assume to implement this change , some modifications need to be done on uboot. But is it possible to give reference to perform these changes
especially on following points
a. Is there a low power or sleep state possible in uboot , if so any reference regarding switching to same.
b. entry point to u boot where we can implement the wait part
Why exactly do you want to suspend your board once you power it? Is your goal to have a power-on button or a wake-up button?
Which image do you intend to use? Is this one of our Reference Images or TorizonCore?
Which carrier board are you going to use?
About your questions:
This would probably not be possible on u-boot as the main function of u-boot is just to boot up the kernel and the device trees. What I’d suggest you is to have a look on this article: Suspend/Resume (Linux) | Toradex Developer Center
Therefore, what you could do is to create a systemd service to put your system to sleep/suspend once the boot is complete. Otherwise, you could make your application to do so once it starts. Then you could use a GPIO as wake-up source.
Please tell us if this helps you already or if you’d need further assistance.
Why exactly do you want to suspend your board once you power it? Is your goal to have a power-on button or a wake-up button?
Ans- The final goal is to use a GPIO as a power on button. with use case where user can press and hold this button(for X Seconds) to turn on the toradex.
Which image do you intend to use? Is this one of our Reference Images or TorizonCore?
Ans - The plan is to use Reference image( Customize it if required)
Which carrier board are you going to use?
Ans - Ixora V1.2A Board.
I misunderstood the scope of U-Boot I guess.
The intend was to make toradex wait for above push button hold, even before boot up (ie even before kernel loading). Since this state will be only waiting for GPIO i referred it as a “low power or sleep state”.
If u-boot cannot perform this , at which level can we modify to implement this scenario ?
There is already a button like this on the Ixora Carrier Board. It’s described on section 3.2.2 of the datasheet (https://docs.toradex.com/107020-ixora-v12-datasheet.pdf). This button is called SW1 On/Off. You can also follow the carrier board design guide for the module (https://docs.toradex.com/101123-apalis-arm-carrier-board-design-guide.pdf) to understand how to design the schematics of such a button on your own. In sections 3.4 to 3.6, you can better understand the power cycles and find some reference designs.
Basically what happens on Ixora is that once you plug it in, if you have the JP1 disconnected, once you connect the power supply, you’ll be in the off state. Then, once you press SW1, the module will change to power state Run where it will load kernel, device trees and so on. The other lower power consumption scenario would be the suspended case. To enter into the suspend case, however, you need to have your module running and then send a suspend request as we proposed here:
there are different Push button controllers available with different timing settings or adjustable timing . In your case, you can build a custom board and use a little micro controller instead of the linear push button controller. then you can programm the timing you want.
The Apalis SOM has already a pin which can be used to shut down the Carrier board.
The Apalsi SOM is design to power up whenever the supplie voltage is avaliable.
So if you want to power up the SOM via push button you can use the push button controller or a microcontroler on your carrier board. This is saves you power since you can shut down the power consuming peripherals on your carrier as well.