SST25 driver for zephyr

I am trying to get a SST25 spi flash running, but the jedec,spi-nor driver does only partially work.

As i understand now the jedec,spi-nor driver only works with CFI compatible spi flashes which the SST25 doesn't seem to comply with.

On the other hand there is this question  How to get started with NOR flash on Zephyr ? where nobody 

points out that it shouldn't work. 

Reading works as well as reading and verifying the jedec id. Writing just works byte by byte as there

is a "address increment mode" to enable that the driver doesnt enable and I also dont see a way to

enable it with the driver. I am testing it with the spi_flash example.

&spi2 {
status = "okay";
pinctrl-0 = <&spi0_default>;
pinctrl-names = "default";
cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
sst25: sst25vf016@0 {
compatible = "jedec,spi-nor";
label = "SST25";
reg = <0x0>;
spi-max-frequency = <DT_FREQ_M(1)>;
jedec-id = [bf 25 8c];
size = <2097152>;
};
max-frequency = <DT_FREQ_M(1)>;
};

Do I need to write my own driver or am I missing something. Does anybody have expericen with this flash and zephyr?

Thanks a lot

  • Hi 

    I can't find any references to an 'address increment mode' in the spi_nor driver in Zephyr, so it is possible that you need to extend the driver to support this, yes. 

    You can see the various commands defined here, and how the different commands are used you can see in spi_nor.c. If you check the datasheet for the SST25 flash you can compare it, and verify how the address increment mode needs to be enabled. With some luck you won't need to make very large changes to the spi_nor driver to add support for this. 

    The quickest way to modify the driver is to simply fork the Zephyr repo and make the changes directly to your fork. Then you can potentially open a pull request with your changes later on, to get them included in the official repo. 

    Best regards
    Torbjørn

Related