Hello,
I have a custom IMX8ULP device with Yocto installed. After bootup, the power meter shows a power consumption of 0.08 A @5V.
I have written an application which accesses an image sensor, connected via MIPI and controlled via I2C. When running the application, the power consumption increases as expected. The strange thing is that after closing my app, it drops down to 0.12 A and never goes back to the 0.08A, it only does when I reboot the device. This behavior can be reproduced each time I run my app.
Are there any ideas how I can debug that issue? Some component seems to be not correctly unpowered. How can I find out which one?
My first idea was that the camera is somehow still powered. Since my app is shut down, it could only be the case if the driver does not completely deinitialize the camera. As a test, directly after boot, I run the camera from command line using v4l2-ctl to capture several images. After shutting it down, the power consumption goes back to 0.08A, so everything seems fine here.
In that situation after running my app:
* my application is totally shut down
* CPU use is 0%
* bus frequency is in LowPowerMode (similar to after bootup), checked in file /sys/devices/platform/imx8ulp-lpm/enable
* CPU frequency control: CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is enabled (as seen by zcat /proc/config.gz | grep CPU_FREQ)
The board has almost no peripherals, except the image sensor and a USB connection (no ethernet, wifi, blutooth, DSI, etc).
Thanks for any help.
Update:
Further tests show, that the higher power consumption is related to the last active framerate of the camera. When I capture with 60 Hz and then turn the app off, the power consumption is 0.12 A whereas it is only 0.10 A when I used 30 Hz.
As a circumvention, I can start the camera with 0 Hz each time after stopping image recording. This lowers the power consumption back to 0.08 A.
Anyway, it seems to be a bug somewhere in the camera driver (or in Yocto?). I have not enough kernel insights to debug this problem.
Hello,
This issue should not be related to yocto, since it is a toolchain so it is not related, regarding the camera driver it could be that it is still processing some image in the last frame and is causing the power consumption that you are seeing.
Best regards/Saludos,
Aldo.
Hallo,
if it would just process some camera images, the power consumption would drop after some time. But it is stable on a higher level until I reboot the device or until I actively start the camera again with 0 FPS.
Is there some advice how I can find the error? Or at least how I can narrow it down to be inside the camera driver or not?
Thanks.