Configuration of custom flash memory for standard zephyr driver

Hello!

I have a device on which the S25HL01GT memory is soldered. The problem is that I don’t understand how I should work with .dts in order for this memory to work with the standard driver from zephyr.

I added the following to the .overlay:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
&qspi {
status = "okay";
pinctrl-0 = <&qspi_default>;
pinctrl-1 = <&qspi_sleep>;
pinctrl-names = "default", "sleep";
s25h: s25hl01gt@0 {
compatible = "nordic,qspi-nor";
reg = <0>;
/* MX25R64 supports only pp and pp4io */
writeoc = "pp4io";
/* MX25R64 supports all readoc options */
readoc = "read4io";
sck-frequency = <8000000>;
jedec-id = [34 2B 1B 0F 03 90];
sfdp-bfp = [
e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb
ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52
10 d8 00 ff 23 72 f5 00 82 ed 04 cc 44 83 68 44
30 b0 30 b0 f7 c4 d5 5c 00 be 29 ff f0 d0 ff ff
];
size = <67108864>;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

And I use the following code:

Fullscreen
1
2
3
4
5
const struct device *flash_dev = DEVICE_DT_GET(DT_ALIAS(spi_flash0));
if (!device_is_ready(flash_dev)) {
printk("%s: device not ready.\n", flash_dev->name);
return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

But it doesn't work and I don't understand how to debug such problems. I'm not even sure that the jedec-id is correct. When compiling into zephyr.dts, I see that for qspi there are two mx25r64 flash memories and my s25h is also in the list, is this bad? I tried to delete it via /delete-node/mx25r6435f; in &qspi but it didn't work.

Thanks in advance!