MMC standard tuning procedure does not work

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

MMC standard tuning procedure does not work

Jump to solution
2,428 Views
thomaspham
NXP Employee
NXP Employee

Hello guys,

I'm debugging standard tuning procedure for MMC card on S32G. After switching the card to HS200 mode, I followed the steps described in the S32G manual as below:

thomaspham_0-1631095392474.png

I observed these:

  • The MIX_CTRL[EXE_TUNE] bit never get set to 1, it remains 0 the whole time, which is strange.
  • The data (tuning pattern) is received on the USDHC side, and pattern is correct.
  • The AUTOCMD12_ERR_STATUS[SMP_CLK_SEL] stays 0 after all, which indicates tuning failed according to the manual.

I'd like to ask if anyone face this problem before, or if you have success with tuning procedure on S32G, please drop me a hint.

Thanks and Best Regards,

Thomas

 

 

0 Kudos
Reply
1 Solution
2,238 Views
ttz766
NXP Employee
NXP Employee

What you were attempting was the sequence in Rev 3 of the RM, which has been updated in Rev 4.

Rev 4 has still to be formally released but the new sequence is :

By default, lower frequency operation, a fixed sampling clock is used to receive signals on CMD and DAT[3:0]. Before using the

HS200, HS400, SDR104, or SDR50 modes, the Host Driver executes the tuning procedure at the mode switch sequence.

  1. Issue uSDHC SW reset, set SYS_CTRL[RSTT] to 1.
  2. Set VEND_SPEC[FRC_SDCLK_ON] to 1.
  3. Set TUNING_CTRL[DIS_CMD_CHK_FOR_STD_TUNING] to 1.
  4. Set AUTOCMD12_ERR_STATUS[EXECUTE_TUNING] to 0.
  5. Read AUTOCMD12_ERR_STATUS[EXECUTE_TUNING] to get 0, and then write 1 to clean INT_STATUS[BRR].
  6. Start the tuning procedure by setting TUNING_CTRL[STD_TUNING_EN] and

AUTOCMD12_ERR_STATUS[EXECUTE_TUNING] to 1.

  1. Issue CMD19(SD)/ CMD21(eMMC) with the proper Command Transfer Type (CMD_XFR_TYP) and Auto CMD12 Error

Status (AUTOCMD12_ERR_STATUS) settings.

  1. Wait for uSDHC BRR (Buffer Read Ready) interrupt signal is 1.
  2. Check AUTOCMD12_ERR_STATUS[EXECUTE_TUNING]. If AUTOCMD12_ERR_STATUS[EXECUTE_TUNING] = 1,

repeat 5~6. If AUTOCMD12_ERR_STATUS[EXECUTE_TUNING] = 0, standard tuning has completed, or the tuning

has not completed within 40 attempts. The Host Driver might abort this loop if the number of loops exceeds 40 or 150ms

timeout occurs. In this case, a fixed sampling clock should be used, (AUTOCMD12_ERR_STATUS[SMP_CLK_SEL] =

0).

  1. Sampling Clock Select, AUTOCMD12_ERR_STATUS[SMP_CLK_SEL] , is valid after

AUTOCMD12_ERR_STATUS[EXECUTE_TUNING] has changed from 1 to 0.

AUTOCMD12_ERR_STATUS[SMP_CLK_SEL] = 1, indicates tuning procedure passed.

AUTOCMD12_ERR_STATUS[SMP_CLK_SEL] = 0, indicates tuning procedure failed. The tuning result is applied to the

delay chain, CLK Tuning Control and Status (CLK_TUNE_CTRL_STATUS) [30:16], upon successful tuning procedure

completion.

  1. Clear VEND_SPEC[FRC_SDCLK_ON].
  2. Set MIX_CTRL[AUTO_TUNE_EN] to 1.

Can you try this out

 

View solution in original post

0 Kudos
Reply
2 Replies
2,239 Views
ttz766
NXP Employee
NXP Employee

What you were attempting was the sequence in Rev 3 of the RM, which has been updated in Rev 4.

Rev 4 has still to be formally released but the new sequence is :

By default, lower frequency operation, a fixed sampling clock is used to receive signals on CMD and DAT[3:0]. Before using the

HS200, HS400, SDR104, or SDR50 modes, the Host Driver executes the tuning procedure at the mode switch sequence.

  1. Issue uSDHC SW reset, set SYS_CTRL[RSTT] to 1.
  2. Set VEND_SPEC[FRC_SDCLK_ON] to 1.
  3. Set TUNING_CTRL[DIS_CMD_CHK_FOR_STD_TUNING] to 1.
  4. Set AUTOCMD12_ERR_STATUS[EXECUTE_TUNING] to 0.
  5. Read AUTOCMD12_ERR_STATUS[EXECUTE_TUNING] to get 0, and then write 1 to clean INT_STATUS[BRR].
  6. Start the tuning procedure by setting TUNING_CTRL[STD_TUNING_EN] and

AUTOCMD12_ERR_STATUS[EXECUTE_TUNING] to 1.

  1. Issue CMD19(SD)/ CMD21(eMMC) with the proper Command Transfer Type (CMD_XFR_TYP) and Auto CMD12 Error

Status (AUTOCMD12_ERR_STATUS) settings.

  1. Wait for uSDHC BRR (Buffer Read Ready) interrupt signal is 1.
  2. Check AUTOCMD12_ERR_STATUS[EXECUTE_TUNING]. If AUTOCMD12_ERR_STATUS[EXECUTE_TUNING] = 1,

repeat 5~6. If AUTOCMD12_ERR_STATUS[EXECUTE_TUNING] = 0, standard tuning has completed, or the tuning

has not completed within 40 attempts. The Host Driver might abort this loop if the number of loops exceeds 40 or 150ms

timeout occurs. In this case, a fixed sampling clock should be used, (AUTOCMD12_ERR_STATUS[SMP_CLK_SEL] =

0).

  1. Sampling Clock Select, AUTOCMD12_ERR_STATUS[SMP_CLK_SEL] , is valid after

AUTOCMD12_ERR_STATUS[EXECUTE_TUNING] has changed from 1 to 0.

AUTOCMD12_ERR_STATUS[SMP_CLK_SEL] = 1, indicates tuning procedure passed.

AUTOCMD12_ERR_STATUS[SMP_CLK_SEL] = 0, indicates tuning procedure failed. The tuning result is applied to the

delay chain, CLK Tuning Control and Status (CLK_TUNE_CTRL_STATUS) [30:16], upon successful tuning procedure

completion.

  1. Clear VEND_SPEC[FRC_SDCLK_ON].
  2. Set MIX_CTRL[AUTO_TUNE_EN] to 1.

Can you try this out

 

0 Kudos
Reply
2,200 Views
thomaspham
NXP Employee
NXP Employee

Hi ttz766,

I have tried your sequence, and it works.

Thanks for your support!

0 Kudos
Reply