[riot-notifications] [RIOT-OS/RIOT] drivers/sdcard_spi: remove auto-init (#14476)

fabian18 notifications at github.com
Fri May 14 19:26:56 CEST 2021


Ok, we have a board that needs to read something from an `at24cxxx` EEPROM to boot up properly.
Doing that in `board_init()` is not a clean solution for that, because the read is going to lock a mutex and if the EEPROM is not responsive (because it may be broken or may not be connected), then the board crashes because ztimer is not initialized yet but a `ztimer_sleep` is triggered but the wake up does not work because the main thread is not running yet.
Putting the `ztimer_init()` before the read in `board_init()` triggers an expected assertion failure in `core/mutex.c:54`.

So what would help us IMO is an `auto_init_storage` that initializes storage devices and can take a hook from the board to read something from an MTD, whatever it expects to be there.
There is a board `mulle` which does something similar.

Second, I think it would be nice if the MTD e.g. `mtd_sdcard_t devices[]` and the underlying storage device, in that case `sdcard_spi_t devices[]`, would be set up in one place.
And if I have an extra sdcard (or EEPROM) connected to the board, it could be set up there by `auto_init_storage_<device>` as well.

How do you think about this?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/14476#issuecomment-841392462
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210514/e1dfee10/attachment.htm>


More information about the notifications mailing list