Updating PDL syspm Driver for Hard Fault Problem – KBA229335

Version 2

    Version: **

     

    Why am I seeing a hard fault upon waking from Deep Sleep in my PSoC 6 application? 

    Problem:

    In some very rare cases, waking the system from Deep Sleep could potentially cause a hard fault. This is due to the system requesting early access to flash/sflash (before they are ready to be accessed).

    Workaround:
    If you observe this behavior using ModusToolbox, update your syspm dirver to the latest version.

    • The flash access problem (workaround #1 and #3) has been addressed in version 4.30 of the syspm driver (psoc6pdl-1.3.0).
    • The sflash access problem (workaround #2 and #4) has been addressed in version 4.50 of the syspm driver (psoc6pdl-1.4.0).


    If you observe this behavior using PSoC Creator, make the following modifications related to the
    EnterDeepSleepRam() function [which is part of the Cy_SysPm_CpuEnterDeepSleep()] function in the cy_syspm.c file:

                1. Replace the following code in line #2883:

    while(0U == _FLD2VAL(IPC_STRUCT_ACQUIRE_SUCCESS, REG_IPC_STRUCT_ACQUIRE(CY_IPC_STRUCT_PTR(CY_IPC_CHAN_DDFT))))

    with this code:

    while (0U == _FLD2VAL(IPC_STRUCT_ACQUIRE_SUCCESS, (*ipcAcquire)))

    2. Replace the following code in line #2889:

    if (Cy_SysLib_GetDeviceRevision() == CY_SYSLIB_DEVICE_REV_0A)

    with this code:

    if (deviceRev == CY_SYSLIB_DEVICE_REV_0A)

    3. Add the following ipcAcquire declaration in line #2797:

    volatile uint32_t *ipcAcquire = ((uint32_t *) (&REG_IPC_STRUCT_ACQUIRE(CY_IPC_STRUCT_PTR(CY_IPC_CHAN_DDFT))));

    4. Add the following deviceRev declaration in line #2798:

    uint8_t deviceRev = Cy_SysLib_GetDeviceRevision();