You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently trying to get the arduino MKRZERO's builtin SD card reader to work. I've made sure my hardware works by uploading and running an arduino sketch and I've used the feather_m0's adalogger example as a starting point. This is how I configure the SPI
I noticed that the logic of the chip detect pin sd_cd seems to be inverted. So I'm waiting until sd_cd is low and try to initialize:
if sd_cd.is_high().unwrap(){usbserial_write!("No card detected. Waiting...\r\n");while sd_cd.is_high().unwrap(){
delay.delay_ms(250_u32);}}usbserial_write!("Card inserted!\r\n");letmut controller = Controller::new(SdMmcSpi::new(spi, sd_cs), timer);
controller.device().init();// <-- this results in TimeoutWaitNotBusy after some time
What's weird is that I run into the timeout only if the card is already inserted when I power on the MKRZERO. Plugging in a card while it is running seems to reset the device. I'd be grateful for any advise or pointers to helpful resources.
The text was updated successfully, but these errors were encountered:
I made the adalogger example and it worked for me back then.. Are you pulling sd_cs high after initializing it? I'm also wondering if lowering the SPI speed even lower helps, or maybe some delay between detecting chip inserted and trying to initialize helps.
Can you tell what kind of reset occurs and why? Could you be panicking?
Thanks for the ideas. I do pull sd_cs high. I accidentally clipped that line from my snippet above initially. A lower speed hasn't helped, unfortunately.
How can I find out which kind of reset occurs? I'm using panic_halt so I expect the chip to stop in case of a panic and not reset.
I'm currently trying to get the arduino MKRZERO's builtin SD card reader to work. I've made sure my hardware works by uploading and running an arduino sketch and I've used the
feather_m0
'sadalogger
example as a starting point. This is how I configure the SPII noticed that the logic of the chip detect pin
sd_cd
seems to be inverted. So I'm waiting untilsd_cd
is low and try to initialize:What's weird is that I run into the timeout only if the card is already inserted when I power on the MKRZERO. Plugging in a card while it is running seems to reset the device. I'd be grateful for any advise or pointers to helpful resources.
The text was updated successfully, but these errors were encountered: