This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

using spi_nor driver with nrf sdk connect / zephyr - driver not found

hello Nordic

i am working with nrf52832, ncs 1.7.1

i am trying to work with external flash driver (25lp128)

so my dts looks like this:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
nordic,pm-ext-flash = &flash_25lp128;
};
....
&spi2 {
status = "okay";
sck-pin = <5>; // gpio 0 pin 5
mosi-pin = <4>; // gpio 0 pin 4
miso-pin = <2>; // gpio 0 pin 2
compatible = "nordic,nrf-spim";
cs-gpios = <&gpio0 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
flash_25lp128: flash_25lp128@0 {
compatible = "issi,is25lp128", "jedec,spi-nor";
reg = <0>;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

my configs are this:

myboard.conf:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# SPI Flash
CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
# Enable flash operations.
CONFIG_FLASH_MAP=y
CONFIG_FLASH_TESTS=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_25LP128=y
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_BT_RX_STACK_SIZE=1024
# CONFIG_MAIN_STACK_SIZE=1024
CONFIG_MPSL_SIGNAL_STACK_SIZE=640
CONFIG_IDLE_STACK_SIZE=128
CONFIG_ISR_STACK_SIZE=1024
# keep CONFIG_HEAP_MEM_POOL_SIZE=16384 because this is needed by usb /nrfx modules
# CONFIG_HEAP_MEM_POOL_SIZE=16384
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

in myboard dir - Kconfig.defconfig:

Fullscreen
1
2
3
config FLASH_25LP128
bool "enables flash device"
default y
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 

when i call on device_get_binding like this:

Fullscreen
1
2
3
4
5
const struct device *dev = device_get_binding("FLASH_25LP128");
if (!dev) {
LOG_ERR("FLASH_25LP128 not found in zephyr\n");
return;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

also tried with - device_get_binding("FLASH_25LP128");  

and got the same result

i added a print in the ncs in the spi_nor.c file (lines 352-354) in the 'spi_nor_access' static function for debugging:

Fullscreen
1
2
3
4
int res = spi_transceive_dt(&driver_cfg->spi, &tx_set, &rx_set);
LOG_ERR("spi_transceive_dt ret - %d\n", res);
return res; //spi_transceive_dt(&driver_cfg->spi, &tx_set, &rx_set);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

and i get this logs before the app :

Fullscreen
1
2
3
4
5
6
[00000020] <err> spi_nor: JEDEC ID device acquired
[00000021] <wrn> spi_nrfx_spim: Transaction aborted since it would trigger nRF52832 PAN 58
[00000021] <err> spi_nor: spi_transceive_dt ret - -5
[00000022] <err> spi_nor: JEDEC ID read failed: -5
*** Booting Zephyr OS build v2.6.99-ncs1-1 ***
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

and after obviously the driver bind returns null

any ideas what i am doing wrong ?

hope to read from you soon

best regards

Ziv