aboutsummaryrefslogtreecommitdiff
path: root/stmhal/diskio.c
AgeCommit message (Collapse)Author
2016-02-15extmod/vfs_fat_diskio: Reusable FatFs module, move from stmhal/diskio.Paul Sokolovsky
2016-02-14stmhal/diskio: Add provision for default returns for ioctl INIT/SEC_SIZE.Paul Sokolovsky
If None was returned for such requests (which likely means that user simply didn't handle them), it means successful init and default sector size of 512 bytes respectively. This makes only BP_IOCTL_SEC_COUNT a mandatory request, and thus re-establishes parity with old interface, where only .count() is mandatory().
2016-02-14stmhal/diskio,file: Nanbox cleanness.Paul Sokolovsky
2016-02-10extmod/fsusermount: Move BP_IOCTL_xxx constants to fsusermount.h.Damien George
2016-02-10extmod/fsusermount: Support mounting of multiple block devices.Damien George
This patch adds support to fsusermount for multiple block devices (instead of just one). The maximum allowed is fixed at compile time by the size of the fs_user_mount array accessed via MP_STATE_PORT, which in turn is set by MICROPY_FATFS_VOLUMES. With this patch, stmhal (which is still tightly coupled to fsusermount) is also modified to support mounting multiple devices And the flash and SD card are now just two block devices that are mounted at start up if they exist (and they have special native code to make them more efficient).
2016-02-10lib/fatfs: Add support for sector sizes larger than 512 bytes.Damien George
If MICROPY_FATFS_MAX_SS is defined to power of 2 value between 1024 and 4096, support for dynamic sector size in FatFs will be enabled. Note that FatFs reserves static buffer of MICROPY_FATFS_MAX_SS size for each filesystem in use, so that value should be set sparingly. Initial patch provided by @pfalcon.
2016-02-10extmod/fsusermount: Change block protocol to support ioctl method.Damien George
The new block protocol is: - readblocks(self, n, buf) - writeblocks(self, n, buf) - ioctl(self, cmd, arg) The new ioctl method handles the old sync and count methods, as well as a new "get sector size" method. The old protocol is still supported, and used if the device doesn't have the ioctl method.
2016-02-06stmhal: Move stmhal-specific FatFs routines/structs to fatfs_port.c.Paul Sokolovsky
2016-02-06stmhal/diskio: Introduce MICROPY_HW_HAS_FLASH setting.Paul Sokolovsky
To allow to reuse stmhal/diskio for ports which don't have flash but have other storage devices.
2015-11-25extmod: Move fsusermount.c from stmhal for cross-port reuse.Paul Sokolovsky
2015-11-23stmhal: Implement delayed RTC initialization with LSI fallback.T S
If RTC is already running at boot then it's left alone. Otherwise, RTC is started at boot but startup function returns straight away. RTC startup is then finished the first time it is used. Fallback to LSI if LSE fails to start in a certain time. Also included: MICROPY_HW_CLK_LAST_FREQ hold pyb.freq() parameters in RTC backup reg MICROPY_HW_RTC_USE_US option to present datetime sub-seconds in microseconds MICROPY_HW_RTC_USE_CALOUT option to enable RTC calibration output CLK_LAST_FREQ and RTC_USE_CALOUT are enabled for PYBv1.0.
2015-11-08stmhal: FatFS configuration moved to the library folder.Alex March
Port specific settings defined in mpconfigport.
2015-07-30stmhal: Replace #include "stm32f4xx_hal.h" with #include STM32_HAL_H.Dave Hylands
2015-07-27stmhal: Put fs_user_mount pointer in root ptr section of global state.Damien George
Should fix issue #1393.
2015-07-27stmhal: Check if user block device is mounted before accessing it.Damien George
In particular this fixes a bug where pyb.sync (and os.sync) fail because they try to sync the user mounted device even if it's not mounted.
2015-03-04stmhal: Include fatfs headers using lib/fatfs prefix.Damien George
This helps make files reusable across other ports.
2015-01-01stmhal: Prefix includes with py/; remove need for -I../py.Damien George
2014-12-27stmhal: Add ability to mount custom block device.Damien George
2014-09-15stmhal: Change 64-bit arithmetic to 32-bit for SD card block addressing.Damien George
By measuring SD card addresses in blocks and not bytes, one can get away with using 32-bit numbers. This patch also uses proper atomic lock/unlock around SD card read/write, adds SD.info() function, and gives error code for failed read/writes.
2014-06-28stmhal: Include mpconfig.h before all other includes.Paul Sokolovsky
It defines types used by all other headers. Fixes #691.
2014-05-03Add license header to (almost) all files.Damien George
Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
2014-04-19stmhal: Improve RTC class; make fatfs use RTC for time stamping files.Damien George
2014-04-12stmhal: Move fatfs volume/partition lookup table to ROM.Damien George
2014-03-30stmhal: Unify naming of HW config; make SD detect configurable.Damien George
All board config macros now begin with MICROPY_HW_. Renamed PYBv10 to PYBV10, since macros should be all uppercase. Made SDCARD_DETECT configurable in mpconfigport.h, so that the SD detect pin can be easily configured.
2014-03-17stmhal: Add fatfs support, working with flash and SD card.Damien George