Hi All,
I´m using custom PCB with i.MX1061, MCUXpresso11.2, SDK2.8.0 Manifest Ver 3.6.0, BareMetal, Win10.
The program runs from an external Flash SPI. I'm using power save mode. One GPT timer and three uarts are still ON. Every minute, the MCU wakes up itself(LPM_PowerModeLowPowerRun --> LPM_PowerModeFullRun) and then goes back to sleep (LPM_PowerModeFullRun --> LPM_PowerModeLowPowerRun).
After 1-4 hours the program ends with HardFault (WatchDog was disable). When I connect a JTag, the program always ended in the function LPM_FullSpeedRun(), (DCDC_AdjustTargetVoltage (DCDC, 0x13,0x1)). I copied this function to the RAM DTC.
Behavior has changed in only one thing. Now the program always ends in the EDMA_CreateHandle () function. This function is also called during wake-up(LPM_PowerModeLowPowerRun --> LPM_PowerModeFullRun).
Is anyone able to advise me on what is wrong? Is there a better way to look for the cause?
Attached are prinsreens of both situations. Printscreen 1:The LPM_FullSpeedRun () function runs from QSPI. Printscreen 2: The LPM_FullSpeedRun () function runs from DTC RAM.
Here is the PowerMode switch sequence:
if (APP_CheckPowerMode(s_curRunMode, s_targetPowerMode))
{
maskDisableEnableInterrupt = DisableGlobalIRQ();
APP_PowerPreSwitchHook(s_targetPowerMode); // OFF GPIO
APP_PowerModeSwitch(s_targetPowerMode);
APP_PowerPostSwitchHook(s_targetPowerMode); // ON GPIO
EnableGlobalIRQ(maskDisableEnableInterrupt);
}
Thank you for the advice.
Best Regards
Jaroslav C.
Hi cerma,
Sorry for the later reply, because of the Chinese National day from 10.1 to 10.8.
Do you disable the low power mode, just test the run mode, whether the hardfault still happens or not?
Just to check, whether it is related to the low power or not.
Any updated information, please kindly let me know.
Best Regards,
kerry
Hi Kerry,
When I disable the low power mode, I don't see these errors. I suspect USB (virtual com). I turn off the USB when switching from Full Speed Run to Low Power Run. I turn on USB after switching from Low Power Run to Full Speed Run. I don't think my way of turning off USB is right.
What is the correct USB power on / off procedure? (stop USB, free memory, ..)?
//*******************************************************************************************
USB switch ON:
void APPInit(void)
{
USB_DeviceClockInit();
s_cdcVcom.speed = USB_SPEED_HIGH;//USB_SPEED_FULL; //
s_cdcVcom.attach = 0;
s_cdcVcom.cdcAcmHandle = (class_handle_t)NULL;
s_cdcVcom.deviceHandle = NULL;
if (kStatus_USB_Success != USB_DeviceClassInit(CONTROLLER_ID, &s_cdcAcmConfigList, &s_cdcVcom.deviceHandle))
{
usb_echo("USB device init failed\r\n");
}
else
{
usb_echo("USB device CDC virtual com demo\r\n");
s_cdcVcom.cdcAcmHandle = s_cdcAcmConfigList.config->classHandle;
}
USB_DeviceIsrEnable();
USB_DeviceRun(s_cdcVcom.deviceHandle);
}
//*******************************************************************************************
USB switch OFF:
USB_DeviceStop(s_cdcVcom.deviceHandle);
USB_DeviceClassDeinit(CONTROLLER_ID);
//*******************************************************************************************
What is the correct USB switch procedure?
Best Regards,
Jaroslav