SDK 2.7.0 LPC546xx fsl_sdif.c SDIF_SendCommand infinite loop

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SDK 2.7.0 LPC546xx fsl_sdif.c SDIF_SendCommand infinite loop

1,468 Views
tomasvavra
Contributor I

Hello, what is the reason that function

    status_t SDIF_SendCommand(SDIF_Type *base, sdif_command_t *cmd, uint32_t timeout)

ignores the timeout argument? My application fails on this and gets forever stuck on

    /* wait start_cmd bit auto clear within timeout */
    while ((base->CMD & SDIF_CMD_START_CMD_MASK) == SDIF_CMD_START_CMD_MASK)
    {
    }
Tags (2)
0 Kudos
Reply
7 Replies

1,356 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Tomas Vavra

SDK team is working on this issue. timeout is missing in SDK 2.7.0 LPC546xx fsl_sdif.c SDIF_SendCommand

The error information means that CMD13 transfer failed, can you confirm that the error is caused by the timeout?

Thanks,

Jun Zhang

0 Kudos
Reply

1,356 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

HI

I checked SDK2.7.0, I find the same issue as you described.

 if timeout is necessary for you, please use below code instead. I will check it with SDK team. Will keep you informed.

    while ((base->CMD & SDIF_CMD_START_CMD_MASK) == SDIF_CMD_START_CMD_MASK)
    {
        if (!timeout)
        {
            break;
        }

        --timeout;
    }

Have a nice day,

Jun Zhang

0 Kudos
Reply

1,356 Views
tomasvavra
Contributor I

Thank you for trying to help. If I use your code, I get random runtime errors.

    Error: send CMD13 failed with host error 1, response 0

0 Kudos
Reply

1,356 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Tomas,

I am checking this issue with SDK development team, will keep you informed.

BR
Jun Zhang

0 Kudos
Reply

1,356 Views
tomasvavra
Contributor I

Thank you. Some more information.. if I use original code which works with one card, I run into the infinite loop with a different card. When this happens SDIF registers have

CMD.START-CMD: 1

RINTSTS.RXDR: 1

RINTSTS.HTO: 1 (data starvation by host timeout)

RINTSTS.HLE: 1 (hardware locked write error)

I don't see anywhere that HTO or HLE interrupts are enabled, that may be on of the reason of infinite loop when waiting for START-CMD to clear. Errors are not expected in SDIF_SendCommand.

0 Kudos
Reply

1,356 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Tomas,

 I guess your follow up question is a new issue. I prefer to track one issue with one thread. As I can't help you create a thread, Could you please create a new thread for it? 

For your original issue, I still wait for the feedback from SDK team. the team is affected by corronavirus in China, the response would be slow. Thanks for your understanding.

Best Regards

Jun Zhang

0 Kudos
Reply

1,326 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Tomas,

I was informed this issue will be fixed in next SDK release v2.9.0.

We will Enabled the functinalify of the timeout parameter in SDIF_SendCommand.

Thanks for bringing the problem to our attention.

 

Best Regards

Jennie

 

0 Kudos
Reply