Skip to content

Infinite loop in SDHC driver. #70

@jmichiels

Description

@jmichiels

I ran into an issue due to following line:

while ((${SDHC_INSTANCE_NAME}_REGS->SDHC_PSR & (SDHC_PSR_CMDINHC_Msk | SDHC_PSR_CMDINHD_Msk)) != 0U)

https://github.com/Microchip-MPLAB-Harmony/csp/blob/90adeccd9213d7d66be8a14a17220638f25ef9fd/peripheral/sdhc_u2011/templates/plib_sdhc.c.ftl#L386C25-L386C25

With some specific hardware issues, those bits may never be cleared, which causes an infinite loop. There should probably be some kind of max iteration count, in order to return false if the bits are not eventually cleared.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions