WBUS-EMMC how to tell if it's present

The official PYBD running MicroPython, and its accessories.
Target audience: Users with a PYBD
User avatar
jimmo
Posts: 2262
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: WBUS-EMMC how to tell if it's present

Post by jimmo » Tue Oct 20, 2020 10:16 pm

Stevo52 wrote:
Mon Oct 05, 2020 8:57 pm
That wasn't really what I was asking, I understand the benefits of EMMC and the single file system etc. My question was if it is not possible to use EMMC and SDCard together (as the documentation says), how is that detected/managed? I got around it with a try/except, checking for EMMC before the SD..
I don't think there's code in the firmware that detects the eMMC's presence (which is why you see it freeze if it's not there).

On first boot, the SD/MMC driver has a flag to indicate which mode it's in (one of: None, SD, MMC), and as soon as you construct either a pyb.SDCard() or pyb.MMCard() it sets that flag (permanantly until next _hard_ reset, as far as I can tell).

The trick is that on boot, main.c checks for presence of the SDCard (by directly looking at the detect pin), which will have the effect of implicitly creating an SDCard object (not quite, but the flag gets set either way). This is why your try/except works on creating pyb.MMCard().
Faloten wrote:
Tue Oct 20, 2020 7:42 pm
Dual storage is also possible as you told for that kind hardware spi (https://911electronic.com/spi-communica ... spi-works/) connections
Yes, but in this case it's a limitation of the two devices sharing the same peripheral in the F7, and the same driver.

Post Reply