pellepl / spiflash_driver Goto Github PK
View Code? Open in Web Editor NEWHardware agnostic generic spi flash driver
License: MIT License
Hardware agnostic generic spi flash driver
License: MIT License
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.
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.
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[].
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.
Preferably ifdeffed
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.
(btw, it looks like the comment is wrong)
Is my flash abnormal, is this me using your library incorrectly or is this a bug?
Thanks for your time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.