apache / apache/nuttx

NUCLEO-L4R5ZI - SDMMC - SDIO - no communication on CMD line

Open
#6,796 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
4k
Forks
1.7k
Avg merge
1d 17h
Merged PRs (30d)
237

Description

Hi,

I'm trying to get working Nuttx 10.3.0 on NUCLEO-L4R5ZI.
I'm stuck on SDIO interface. (Clock setup works, serial communication works).
I've based my work on the stm32l4r9ai-disco, as it seams for me the closest relative.

**The issue is there is no signals changing on CMD, D0-D3**
CLK is working - is about 93kHz

Here is the log:

```
ABCDF
stm32l4_rng_initialize: Initializing RNG
Mounting procfs to /proc
stm32l4_mco_initialize: STM32L4_RCC_CFGR:0x4200000F
stm32l4_mco_initialize: STM32L4_RCC_AHB2ENR:4401FF
stm32l4_sdio_initialize: Initializing SDIO slot 0
stm32l4_sdio_initialize: STM32L4_RCC_CR:0xF000563
stm32_setclkcr: CLKCR: 00000110 PWR: 00000000
stm32_reset: CLCKR: 00000110 POWER: 00000003
stm32l4_sdio_initialize: Bind SDIO to the MMC/SD driver, minor=0
stm32_registercallback: Register 0x802cf8d(0x100032d8)
stm32_callbackenable: eventset: 02
stm32_callback: Callback 0x802cf8d(0x100032d8) cbevents: 02 cdstatus: 00
stm32l4_sdio_initialize: Successfully bound SDIO to the MMC/SD driver
sdio_mediachange: cdstatus OLD: 00 NEW: 01
stm32_callback: Callback 0x802cf8d(0x100032d8) cbevents: 02 cdstatus: 01
stm32_callback: Callback to 0x802cf8d(0x100032d8)
stm32_setclkcr: CLKCR: 00000110 PWR: 00000003
stm32_sendcmd: cmd: 00000000 arg: 00000000 regval: 00000400
stm32_waitresponse: ERROR: Timeout cmd: 00000000 events: 00000080 STA: 00000000
mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00000000 failed: -116
stm32_sendcmd: cmd: 00000208 arg: 000001aa regval: 00000448
stm32_waitresponse: ERROR: Timeout cmd: 00000208 events: 00000045 STA: 00000000
mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00000208 failed: -116
stm32_sendcmd: cmd: 00000077 arg: 00000000 regval: 00000477

stm32_waitresponse: ERROR: Timeout cmd: 00000077 events: 00000045 STA: 00000000
mmcsd_sendcmdpoll: ERROR: Wait for response to cmd: 00000077 failed: -116
stm32_recvshortcrc: ERROR: RESCMD=00 CMD=00000077
mmcsd_cardidentify: ERROR: mmcsd_recv_r1(CMD55) failed: -22
mmcsd_cardidentify: ERROR: Failed to identify card
mmcsd_probe: ERROR: Failed to initialize card: -5
romfs_open: ERROR: Failed to find directory directory entry for 'init.d/rc.sysinit': -2
nsh: sysinit: fopen failed: 2

NuttShell (NSH) NuttX-10.3.0
nsh>
```

As I understand STM32L4R5ZI doesn't have SDMMC DMA - I've compiled without DMA.

What I've checked:
- Hardware seams to be OK - did an example with platformio and arduino framework, and SD card works properly.
- Did a setup without NCD GPIO - to simplify things.
- CPU clock seams to be OK. Checked by the MCO output.
- CLK of SDIO interface is working (about 93kHz).

Things I don't know:
- how to check if SDIO have proper clock.
- debug simple communication by SDIO.

Any constructive thoughts will be appreciated.

All the best,
Jakub

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.