IMX7ULPEVK - Vol- and Vol+ button handling on Cortex A7

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX7ULPEVK - Vol- and Vol+ button handling on Cortex A7

1,114 Views
brosandic
Contributor II

Hi,

We are using IMX7ULP EVK board and imx-linux-zeus yocto release ( imx-5.4.70-2.3.0.xml manifest) and we are looking for example that executes on Cortex A7 core in linux, and that would demonstrate how Vol+ and Vol- buttons are handled.

Our understanding is that these buttons are connected to Ports of the imx7ulp that are handled by Cortex M4 core.

Can you please share what example should we use to understand how to handle these buttons in Linux application executing in Cortex A7?

Best regards,

Bogdan

Tags (1)
0 Kudos
Reply
3 Replies

1,084 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

 

1. button signal is not handled by M4

2. Let me explain the handle process in linux:

You can define the button io in dts, set it input mode and irq number. When you click the button ,it will create a irq in linux kernel, so the irq_handler  function will handle this irq, see if it is been clicked.(1:high ,0:low)

3.Actually, if you  want to use button in application, you can see this url https://developer.toradex.com/knowledge-base/gpio-linux

0 Kudos
Reply

1,074 Views
brosandic
Contributor II

Hi,

What confuses me is that in the example I provided it says that rpmsg-keys device is being used? 

I was under impression that these buttons on the imx7ulp evk are handled using MU (Message unit)?

In the M4 firmware that comes by default on the SD card, there is an example where M4 core exits from one of the modes, which is chosen by pressing B, on Vol+ button.

#################### Power Mode Switch Task ####################

Build Time: Jul 17 2020--03:47:59
Core Clock: 115200000Hz
Power mode: RUN

Select the desired operation

Press A for enter: RUN - Normal RUN mode
Press B for enter: WAIT - Wait mode-----------------------------------B is pressed in console
Press C for enter: STOP - Stop mode
Press D for enter: VLPR - Very Low Power Run mode
Press E for enter: VLPW - Very Low Power Wait mode
Press F for enter: VLPS - Very Low Power Stop mode
Press G for enter: HSRUN - High Speed RUN mode
Press H for enter: LLS - Low Leakage Stop mode
Press I for enter: VLLS - Very Low Leakage Stop mode
Press Q for query CA7 core power status.
Press W for wake up CA7 core in VLLS/VLPS.
Press T for reboot CA7 core.
Press U for shutdown CA7 core.
Press V for boot CA7 core.
Press R for read PF1550 Register.
Press S for set PF1550 Register.
Press Z for enhanced power configuration.

Waiting for power mode select..

WorkingTask 1: Transfer from RUN to WAIT
Select the wake up source:
Press T for LPTMR - Low Power Timer
Press S for switch/button VOL+.

Waiting for key press..

So how come M4 firmware changes its state on Vol+ key press?

Thanks,

Bogdan

0 Kudos
Reply

1,095 Views
brosandic
Contributor II

I think I've just found something useful.

oot@imx7ulpevk:/unit_tests/Keyboard# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: rpmsg-keys
/dev/input/event1: fts_ts
/dev/input/event2: step_detector
/dev/input/event3: step_counter
Select the device event number [0-3]: 0
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "rpmsg-keys"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 114 (KEY_VOLUMEDOWN)
Event code 115 (KEY_VOLUMEUP)
Event code 116 (KEY_POWER)
Properties:
Testing ... (interrupt to exit)
Event: time 1615552640.384524, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 1615552640.384524, -------------- SYN_REPORT ------------
Event: time 1615552640.613127, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 1615552640.613127, -------------- SYN_REPORT ------------
Event: time 1615552641.531526, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 1615552641.531526, -------------- SYN_REPORT ------------
Event: time 1615552641.709455, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 1615552641.709455, -------------- SYN_REPORT ------------
Event: time 1615552642.260209, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 1615552642.260209, -------------- SYN_REPORT ------------
Event: time 1615552642.445113, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 1615552642.445113, -------------- SYN_REPORT ------------
Event: time 1615552642.757307, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 1615552642.757307, -------------- SYN_REPORT ------------
Event: time 1615552642.898507, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 1615552642.898507, -------------- SYN_REPORT ------------
Event: time 1615552643.794227, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 1615552643.794227, -------------- SYN_REPORT ------------
Event: time 1615552643.962250, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 1615552643.962250, -------------- SYN_REPORT ------------
Event: time 1615552644.734817, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
Event: time 1615552644.734817, -------------- SYN_REPORT ------------
Event: time 1615552644.956617, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 1615552644.956617, -------------- SYN_REPORT ------------
Event: time 1615552645.468571, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
Event: time 1615552645.468571, -------------- SYN_REPORT ------------
Event: time 1615552645.675356, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 1615552645.675356, -------------- SYN_REPORT ------------
Event: time 1615552646.023229, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
Event: time 1615552646.023229, -------------- SYN_REPORT ------------
Event: time 1615552646.161420, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 1615552646.161420, -------------- SYN_REPORT ------------
 
Please let me know if there's something better than this one.
 
Thanks,
Bogdan
0 Kudos
Reply