none
Power manager doesn't get battery status upgrade. Embedded Compact 7 RRS feed

  • Question

  • Hello everybody!

    We are using custom Freescale MX53 based board.

    We are using FAKE battery driver as our battery driver base.

    Driver succesfully built and loaded by wec7 (linked with battdrvr_mdd.lib) and I see debug messages when toggling battery.

    But power manager applet knows nothing about my battery status.

    Here are functions we've implemented:

    BatteryPDDGetStatus
    BatteryPDDGetLevels
    BatteryPDDSupportsChangeNotification
    
    

    And in our charger interrupt handle thread we've got:

    LOCKBATTERY();
    BatteryAPIGetSystemPowerStatusEx2(&gBatteryContext.st, sizeof(gBatteryContext.st), TRUE);
    UNLOCKBATTERY();
    PowerPolicyNotify(PPN_POWERCHANGE, 0);

    We see in debug that

    BatteryAPIGetSystemPowerStatusEx2

    calling

    BatteryPDDGetStatus(PSYSTEM_POWER_STATUS_EX2 pstatus, PBOOL pfBatteriesChangedSinceLastCall)

    But nothing changing in power manager. It always shows that power supply connected and battery is charging. Even if

    pstatus->ACLineStatus = AC_LINE_ONLINE;
    pstatus->BatteryFlag = BATTERY_FLAG_NO_BATTERY;
    //or
    pstatus->ACLineStatus = AC_LINE_OFFLINE;
    pstatus->BatteryFlag = BATTERY_FLAG_CRITICAL;

    EDIT:

    Don't know why but can't get GetSystemPowerStatusEx2  from test app. It returns general error(31). And not calling my

    BatteryPDDGetStatus


    Where can be the problem?





    • Edited by ammmmm Thursday, February 5, 2015 8:38 PM
    Thursday, February 5, 2015 8:35 PM

All replies

  • Are you sure you have the battery driver added from the catalog to the OS design?

    It is under Core OS Services->Battery Driver.

    Also you have to have the BSP battery driver added.


    Dave

    Friday, February 6, 2015 11:11 AM