<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: Charger mode on i.MX8MQ and Android 8.1</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Charger-mode-on-i-MX8MQ-and-Android-8-1/m-p/872171#M132538</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to be sure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you trying to see the boot animation for the battery charging?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, Investigating I found that the BatteryMonitor.cpp&amp;nbsp;file has something to do with the battery status of the device. Just let investigate a little more about this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Diego.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Feb 2019 22:42:44 GMT</pubDate>
    <dc:creator>diegoadrian</dc:creator>
    <dc:date>2019-02-06T22:42:44Z</dc:date>
    <item>
      <title>Charger mode on i.MX8MQ and Android 8.1</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Charger-mode-on-i-MX8MQ-and-Android-8-1/m-p/872170#M132537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are developing on i.MX8MQ and Android 8.1 BSP. We have battery and need charger manager.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have implemented the battery/charger drivers and the healthd daemon is working well. Android shows correct battery capacity and charging/discharging information. The question is if we power on the unit by plugging in the USB-C adapter it should boot into “charger” mode that shows a big battery icon on screen and plays charging animation. The method is setting “androidboot.mode=charger” in uboot but when I did this I didn’t see that the “charger” service is running. I can manually start the charger service by the following commands on the console:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ su&lt;/P&gt;&lt;P&gt;# charger&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It then starts the battery animation on the screen that is corresponding to the real battery level, and with the following logs (see attachments):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp; 19.315741] charger:&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp; 19.318054] charger: *************** LAST KMSG ***************&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp; 19.323904] charger:&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp; 19.326273] charger: last_kmsg not found. Cold reset?&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp; 19.331353] charger:&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp; 19.333634] charger: ************* END LAST KMSG *************&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp; 19.339481] charger:&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp; 19.341763] charger: --------------- STARTING CHARGER MODE ---------------&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp; 19.383070] charger: Could not open animation description at /res/values/charger/animation.txt&lt;/P&gt;&lt;P&gt;[&amp;nbsp;&amp;nbsp; 19.391753] charger: Could not parse animation description. Using default animation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the key is to automatically start the “charger” service when “androidboot.mode=charger” is set. I tried to modify device/fsl/evk_8mq/init.rc and system/core/rootdir/init.rc, but it didn’t work. In system/core/init/init.cpp it triggers the “charger” event when boot mode is charger but it looks not working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/62869i5E3318C46149EA9E/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help have a look on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached are a log that including the manual starting of the charger service, and a picture when the charger service is running.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks that&amp;nbsp;we just need a simple setting in init.rc that starts the charger service if boot mode is charger. I did the following changes in init.rc, but it doesn’t work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;diff --git a/evk_8mq/init.rc b/evk_8mq/init.rc&lt;/P&gt;&lt;P&gt;index 3309b05..ebbd1a9 100644&lt;/P&gt;&lt;P&gt;--- a/evk_8mq/init.rc&lt;/P&gt;&lt;P&gt;+++ b/evk_8mq/init.rc&lt;/P&gt;&lt;P&gt;@@ -138,6 +138,17 @@ on early-boot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Dectect DSF streams when scanning media&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setprop ro.FSL_DSF_PARSER 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;+on charger&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp; # Enable Power modes and set the CPU Freq Sampling rates&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp; write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "powersave"&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp; write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 90&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp; write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp; write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp; write /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 4&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp; write /sys/devices/system/cpu/cpu1/online 0&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp; write /sys/devices/system/cpu/cpu2/online 0&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp; write /sys/devices/system/cpu/cpu3/online 0&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;service wpa_supplicant /vendor/bin/hw/wpa_supplicant \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf -N \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \&lt;/P&gt;&lt;P&gt;@@ -223,6 +234,9 @@ service g3d /vendor/bin/g3d&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group system&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oneshot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;+service charger /sbin/charger&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp; class charger&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;on property:wc_transport.start_hci=true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; start start_hci_filter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Huanxin Jiang&lt;/P&gt;&lt;P&gt;Netscout&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2019 04:30:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Charger-mode-on-i-MX8MQ-and-Android-8-1/m-p/872170#M132537</guid>
      <dc:creator>huanxin_jiang</dc:creator>
      <dc:date>2019-01-30T04:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Charger mode on i.MX8MQ and Android 8.1</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Charger-mode-on-i-MX8MQ-and-Android-8-1/m-p/872171#M132538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to be sure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you trying to see the boot animation for the battery charging?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, Investigating I found that the BatteryMonitor.cpp&amp;nbsp;file has something to do with the battery status of the device. Just let investigate a little more about this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Diego.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2019 22:42:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Charger-mode-on-i-MX8MQ-and-Android-8-1/m-p/872171#M132538</guid>
      <dc:creator>diegoadrian</dc:creator>
      <dc:date>2019-02-06T22:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Charger mode on i.MX8MQ and Android 8.1</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Charger-mode-on-i-MX8MQ-and-Android-8-1/m-p/872172#M132539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks and we've resolved this issue. There was a SELINUX policy issue with the charger service.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2019 02:48:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Charger-mode-on-i-MX8MQ-and-Android-8-1/m-p/872172#M132539</guid>
      <dc:creator>huanxin_jiang</dc:creator>
      <dc:date>2019-02-20T02:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Charger mode on i.MX8MQ and Android 8.1</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Charger-mode-on-i-MX8MQ-and-Android-8-1/m-p/1603356#M201831</link>
      <description>&lt;P&gt;Can u share how to fix it?&lt;BR /&gt;I have the same issue.&lt;BR /&gt;Thx.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 03:11:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Charger-mode-on-i-MX8MQ-and-Android-8-1/m-p/1603356#M201831</guid>
      <dc:creator>bettychen</dc:creator>
      <dc:date>2023-02-22T03:11:13Z</dc:date>
    </item>
  </channel>
</rss>

