Giter Site home page Giter Site logo

ironsheep / p2-flash-fs Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 2.0 2.22 MB

Chip's Flash FS with a standard API for accessing the FLASH chip on the P2 Edge Module.

License: MIT License

Shell 100.00%
driver eeprom-storage p2 p2-edge p2asm parallax-propeller parallax-propeller-microcontroller pasm2 spin2

p2-flash-fs's People

Contributors

ironsheep avatar totalspectrum avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

p2-flash-fs's Issues

Off by one error on value returned from read() ?

and have you...

  • I updated to the latest version available
  • My code conforms to calling sequences shown in demo code

Version of P2 Flash FS

Tested in latest github sources

Is this a regression?

No or unsure. This never worked, or I haven't tried before.

P2 Hardware, Compiler used

P2 Board: P2 Eval Board
P2 Compiler: both flexspin and PNut v39

Description of problem

Read seems to return 1 byte more than the requested number of bytes. For example:

CON
  _clkfreq = 250_000_000

OBJ
  flash: "flash_fs"

DAT
buf	BYTE 128

PUB demo() | r, handle
  flash.mount()
  handle := flash.open(@"rwblocks.bin", "r")
  if handle >= 0
    r := flash.read(handle, @buf[0], 32)
    debug("requested 32 bytes, read returned ", sdec_(r))
    flash.close(handle)
  flash.unmount()

outputs:

Cog0  requested 32 bytes, read returned 33

Additional information

No response

Write should return number of bytes written

Issue being Addressed

The write function returns only a status, and no indication of how many bytes were written.

Enhancement

The write function should probably act like Unix (and Windows) and return the count of bytes actually written, rather than a status of 0 on success. This will allow us to detect things like flash full, and also be more consistent with how other OSes work.

Alternatives

I can work around this in the flexspin VFS layer, but it seems like it might surprise other users as well who are used to POSIX and Windows APIs.

Additional information

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.