{"action":"created","issue":{"url":"https://api.github.com/repos/micropython/micropython/issues/1626","labels_url":"https://api.github.com/repos/micropython/micropython/issues/1626/labels{/name}","comments_url":"https://api.github.com/repos/micropython/micropython/issues/1626/comments","events_url":"https://api.github.com/repos/micropython/micropython/issues/1626/events","html_url":"https://github.com/micropython/micropython/pull/1626","id":117101447,"number":1626,"title":"esp8266: SPI flash access functions and user mounting.","user":{"login":"alex-march","id":171876,"avatar_url":"https://avatars.githubusercontent.com/u/171876?v=3","gravatar_id":"","url":"https://api.github.com/users/alex-march","html_url":"https://github.com/alex-march","followers_url":"https://api.github.com/users/alex-march/followers","following_url":"https://api.github.com/users/alex-march/following{/other_user}","gists_url":"https://api.github.com/users/alex-march/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-march/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-march/subscriptions","organizations_url":"https://api.github.com/users/alex-march/orgs","repos_url":"https://api.github.com/users/alex-march/repos","events_url":"https://api.github.com/users/alex-march/events{/privacy}","received_events_url":"https://api.github.com/users/alex-march/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-11-16T11:10:10Z","updated_at":"2016-01-22T16:57:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/micropython/micropython/pulls/1626","html_url":"https://github.com/micropython/micropython/pull/1626","diff_url":"https://github.com/micropython/micropython/pull/1626.diff","patch_url":"https://github.com/micropython/micropython/pull/1626.patch"},"body":"Combined all the effort from previous discussions: #1483, #1507.\r\n- FatFS and SPI flash driver now only consist of 3 files with #1597 in place. Simplified read/write functions.\r\n- Byte-by-byte writing for user space as well as 512 byte sector writes used by fatfs.\r\n- All flash access functions are added to the esp module, prefixed with flash_*, all tested.\r\n- Added user mounting via pyb.mount.\r\n\r\nNeeds further work:\r\n- All read/writes have a fixed start/end offset address defined in [flash.h#41](https://github.com/alex-march/micropython/commit/c1d945a567a5ae81103967dc9624020ed93560c5#diff-30690a12b7f3b19c7101e08e1c05a433R41) in ESP sectors. [Previously discussed](https://github.com/micropython/micropython/pull/1507#issuecomment-153207970), it is possible to have an automatic offset decided by the linker. In the meantime I can keep or remove the existing #define.\r\n- I haven't actually tested the pyb.mount yet, but shouldn't be too hard.\r\n- Byte-by-byte access can be optimised by detecting if the requested size can fit in the buffer straight away and use memcpy. [flash.c#L111](https://github.com/alex-march/micropython/commit/c1d945a567a5ae81103967dc9624020ed93560c5#diff-b1a34dda7a441839ad25186dfeed826fR111)"},"comment":{"url":"https://api.github.com/repos/micropython/micropython/issues/comments/173976744","html_url":"https://github.com/micropython/micropython/pull/1626#issuecomment-173976744","issue_url":"https://api.github.com/repos/micropython/micropython/issues/1626","id":173976744,"user":{"login":"alex-march","id":171876,"avatar_url":"https://avatars.githubusercontent.com/u/171876?v=3","gravatar_id":"","url":"https://api.github.com/users/alex-march","html_url":"https://github.com/alex-march","followers_url":"https://api.github.com/users/alex-march/followers","following_url":"https://api.github.com/users/alex-march/following{/other_user}","gists_url":"https://api.github.com/users/alex-march/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-march/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-march/subscriptions","organizations_url":"https://api.github.com/users/alex-march/orgs","repos_url":"https://api.github.com/users/alex-march/repos","events_url":"https://api.github.com/users/alex-march/events{/privacy}","received_events_url":"https://api.github.com/users/alex-march/received_events","type":"User","site_admin":false},"created_at":"2016-01-22T16:57:04Z","updated_at":"2016-01-22T16:57:04Z","body":"@dpgeorge, @pfalcon: Do let me know if this patch is still of interest with the last update. Otherwise I'll close it."}}