Hi everyone:
I have a problem is that I want to control BMS BJB gpio to test isolation test, my system is 800 V Battery Management System, s32k358 platform, 33772 BJB and 33774 CMU
Software project is HVBMS Integration project from NXP example project
There is a function "HvBms_Bjb_Main_IsoMeas_GpioEnable" to set the Q1, QL1 and Opto pins, but I want to control by my self. (I even don't know how to use this function due to every functions are static)
The following is my code that I try to control these three pins in run time task
Std_ReturnType HvBms_Bjb_IsoMeas_ControlAndRead(bool enable_Q1, bool enable_QL1, bool enable_Opto, float *riso_pos, float *riso_neg)
{
Std_ReturnType RetVal = E_OK;
HvBms_Bjb_AddressInformation.ChainStart = HVBMS_BJBSENSEMON_CHAIN_ID_ISO(0);
HvBms_Bjb_AddressInformation.ChainEnd = HVBMS_BJBSENSEMON_NO_OF_CHAINS_ISO;
//control Q1
if(enable_Q1)
{
HvBms_Bjb_AddressInformation.DeviceStart = HVBMS_BJB_AFE2;
HvBms_Bjb_AddressInformation.DeviceEnd = HVBMS_BJB_AFE2;
RetVal = HVBMS_BJB_BJBIF_SETMODE(&HvBms_Bjb_AddressInformation, &HvBms_BJBConfig,(uint8)HVBMS_BJB_GPIO6_DR_HIGH);
}
else
{
HvBms_Bjb_AddressInformation.DeviceStart = HVBMS_BJB_AFE2;
HvBms_Bjb_AddressInformation.DeviceEnd = HVBMS_BJB_AFE2;
RetVal = HVBMS_BJB_BJBIF_SETMODE(&HvBms_Bjb_AddressInformation, &HvBms_BJBConfig,(uint8)HVBMS_BJB_GPIO6_DR_LOW);
}
//control QL1
if(enable_QL1)
{
HvBms_Bjb_AddressInformation.DeviceStart = HVBMS_BJB_AFE1;
HvBms_Bjb_AddressInformation.DeviceEnd = HVBMS_BJB_AFE1;
RetVal |= HVBMS_BJB_BJBIF_SETMODE(&HvBms_Bjb_AddressInformation, &HvBms_BJBConfig,(uint8)HVBMS_BJB_GPIO6_DR_HIGH);
}
else
{
HvBms_Bjb_AddressInformation.DeviceStart = HVBMS_BJB_AFE1;
HvBms_Bjb_AddressInformation.DeviceEnd = HVBMS_BJB_AFE1;
RetVal|=HVBMS_BJB_BJBIF_SETMODE(&HvBms_Bjb_AddressInformation, &HvBms_BJBConfig,(uint8)HVBMS_BJB_GPIO6_DR_LOW);
}
//control Opto
if(enable_Opto)
{
HvBms_Bjb_AddressInformation.DeviceStart = HVBMS_BJB_AFE1;
HvBms_Bjb_AddressInformation.DeviceEnd = HVBMS_BJB_AFE1;
RetVal |= HVBMS_BJB_BJBIF_SETMODE(&HvBms_Bjb_AddressInformation, &HvBms_BJBConfig,(uint8)HVBMS_BJB_GPIO5_DR_HIGH);
}
else
{
HvBms_Bjb_AddressInformation.DeviceStart = HVBMS_BJB_AFE1;
HvBms_Bjb_AddressInformation.DeviceEnd = HVBMS_BJB_AFE1;
RetVal |= HVBMS_BJB_BJBIF_SETMODE(&HvBms_Bjb_AddressInformation, &HvBms_BJBConfig,(uint8)HVBMS_BJB_GPIO5_DR_LOW);
}
After BJB current mode be active mode, and I try to control but doesn't work, and sometimes BJB current mode would be "HVBMS_MODE_HALT", I don't know why
Is there any experience or idea that you can suggest me? Maybe Mcal setting need modify?
Thanks
BR, BillWen