I am using an iMX6UL evk in combination with a µC module. The µC is connected to the iMX's UART2 (ttymxc1, since I'm using the default dt configuration provided for the 14x14 evk). The evk is running a Yocto Linux image with kernel 4.1.15.
My application requires the iMX6 to be in the lower possible power state for most of the time, so I've configured it to enter DSM mode (using "echo mem > /sys/power/state") and wake up on interrupts from the UART pins, so that whenever the µC module has any data to transmit, the iMX can wake up and handle the coming messages. Wake up on UART is configured echoing "enabled" into the corresponding sysfs "wakeup" entry.
What I'm currently achieving is:
- the communication between the iMX and the µC works correctly when the iMX is NOT in DSM mode;
- the iMX wakes up correctly in about 120 ms when some data is transmitted from the µC module, but I'm not seeing any UART message being reported to my application. To be noted that the message sent from the µC module to the iMX is of few (1 to 10) bytes @ 115200 bps. The µC module never changes its state, so it is expected to have a consistent behavior independently from the iMX power state.
My questions are then the following:
- Should I expect to receive the message when the system is woken up from UART (so by the message itself being transmitted) or is it normal that at least some byte is being discarded?
- If I should expect to lose some data with my current configuration, what changes should I perform in order to avoid losing any message? In other words what would be the most (power) efficient way to wake up the iMX6UL from UART without losing any message?
Thank you for your help