uos docs: the abstract block device SOLVED

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

uos docs: the abstract block device SOLVED

Post by pythoncoder » Wed Dec 11, 2019 9:57 am

Maybe I'm being dumb but I find the doc rather opaque and I have two queries.

The doc seems to imply that a uos.AbstractBlockDev class exists. As far as I can see it does not, and the concept is merely a template for writing block devices. You can write a base class following the design of this template to produce devices which can be mounted as filesystems.

Secondly, in addition to the basic, aligned readblocks and writeblocks methods, the doc describes unaligned methods with an offset arg, but gives no reason why you might want to do this. In my efforts I've written only an ioctl and the aligned variants; the outcome appears to work correctly. Should I also provide unaligned methods?

Any clarification would be gratefully received.
Peter Hinch
Index to my micropython libraries.

Christian Walther
Posts: 169
Joined: Fri Aug 19, 2016 11:55 am

Re: uos docs: the abstract block device

Post by Christian Walther » Fri Dec 13, 2019 2:07 pm

I haven’t checked, but the wording of this sentence seems to imply that littlefs requires the extended readblocks/writeblocks interface:
http://docs.micropython.org/en/latest/reference/filesystem.html#custom-block-devices wrote:As it supports the extended interface, it can be used with littlefs

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: uos docs: the abstract block device

Post by pythoncoder » Sat Dec 14, 2019 7:19 am

Thank you, that does make sense and your conclusion is supported by the code examples.

I hadn't spotted that page in the docs ;)
Peter Hinch
Index to my micropython libraries.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: uos docs: the abstract block device SOLVED

Post by jimmo » Mon Dec 16, 2019 1:46 am

Thanks, I agree this could do with a better explanation -- sent https://github.com/micropython/micropython/pull/5421

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: uos docs: the abstract block device SOLVED

Post by pythoncoder » Mon Dec 16, 2019 9:12 am

That's great, but I've added some more suggestions. The doc is rather ambiguous as it stands.
Peter Hinch
Index to my micropython libraries.

Post Reply