Giter Club home page Giter Club logo

spiflash_driver's People

Contributors

enes1313 avatar pellepl avatar sonofusion82 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spiflash_driver's Issues

Aggregating SPI operations

Hi,
I am using your driver and I'd like to reduce the number of calls to the low level SPI driver. Do you foresee any problems in aggregating SPI operations into a single one? As an example, page program (write) actually performs: write enable, command + address, data (3 SPI operations). I'd like to try to change the driver to use a larger buffer and call the driver with a single SPI operation.

tx_internal_buffer alignment

I had and issue using this driver in a STM32F030xxx. Whenever I call HAL_SPI_Transmit(...) inside the _spiflash_spi_txrx callback, the system goes in HardFault.
I started to investigate and I discovered that the problem was in a cast to uint16_t *, made inside the HAL_SPI function, of tx_data passed as argument by the callback, because the address was not aligned to a 16 bit address.
The fix I propose is to align the tx_internal_buffer of the spiflash_t struct.
I already tried uint8_t tx_internal_buf[16] __attribute__ ((aligned(16))); at line 275 and it works.
Maybe due to the wide targets of this driver would be even better to align to a 32 bit address.

_spiflash_clz() can't work right?

I don't know if I understand right or not, _spiflash_clz() can't work correctly.

assuming the addr is 4096, _spiflash_clz(4096) = 249, it gonna have an overflow error at array MultiplyDeBruijnBitPosition[].

Question: what is the purpose of `spi->could_be_busy`?

I'm trying to understand in what situation the spi->busy_pre_check routine would be executed.`
This flag seems to be set in only one condition:

  if (spi->could_be_busy) {
    spi->busy_pre_check = 1;
  }

The spi->could_be_busy flag does not seems to get set anywhere.
In what case would the busy_pre_check would be triggered?

Am I missing something?
Thanks for this great library.

Padding bytes for the Read-ID command ?

Hi !
I'm trying to port your great library to the Microchip SST25PF040C SPI flash and I'm encountering a problem while using the SPIFLASH_read_product_id to read the product ID.

As you can see in the datasheet [1], it looks like the Read-ID command requires 3 padding bytes.
The SpiFlash driver does not seem to support byte padding for this command.

image

(btw, it looks like the comment is wrong)

My question:

Is my flash abnormal, is this me using your library incorrectly or is this a bug?

Thanks for your time.


[1] Microchip SST25PF040C datasheet
image

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.