drivers: SPI NOR: Inconsistency with flash interface docs #11513
Labels
area: API
Changes to public APIs
area: Flash
bug
The issue is a bug, or the PR is fixing a bug
priority: medium
Medium impact/importance bug
Describe the bug
The addition of SPI NOR flash driver introduced an incosistency with the docs for flash.
According to the docs, flash_read/flash_write return 0 on success. On the contrary, spi_nor_read/spi_nor_write return the amount of bytes read/written from/to spi flash.
The big difference can be seen in the usage of flash interface in spi_flash sample vs this spi_flash test in which the reader of the code should assume the underlying hardware flash scheme. This destroys the abstraction that should be taken for granted.
Impact
I created a sample for my board that has a SPI NOR. It took me some time to see why the tests were failing, since I followed the docs descriptions.
The text was updated successfully, but these errors were encountered: