Hi all!
I have a custom board with an nRF52840 and an SX1262. They communicate via SPI. When I use CONFIG_SPI=y, I get the following error when the board turns on:
<err> qspi_nor: JEDEC id [00 00 00] expect [c2 28 17]
This is my prj.conf:
# Use GPIOs CONFIG_GPIO=y # Configs to use J-Link RTT CONFIG_PRINTK=y CONFIG_STDOUT_CONSOLE=y # CONFIG_RTT_CONSOLE=n CONFIG_RTT_CONSOLE=y # BLE configs CONFIG_BT=y CONFIG_BT_CENTRAL=y CONFIG_BT_SCAN=y CONFIG_BT_FILTER_ACCEPT_LIST=y CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_BT_GATT_CLIENT=y # Assert CONFIG_ASSERT=n # Use serial CONFIG_UART_ASYNC_API=y # Log configs CONFIG_LOG=y CONFIG_LOG_BUFFER_SIZE=2048 CONFIG_LOG_BACKEND_UART=y CONFIG_CBPRINTF_FP_SUPPORT=y CONFIG_MCUBOOT_UTIL_LOG_LEVEL_INF=y CONFIG_HWINFO_LOG_LEVEL_INF=y CONFIG_LOG_MODE_MINIMAL=n # CONFIG_USE_SEGGER_RTT=n # CONFIG_LOG_BACKEND_RTT=n CONFIG_USE_SEGGER_RTT=y CONFIG_LOG_BACKEND_RTT=y # Hardware info and log configs CONFIG_HWINFO=y # NVS configs CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_MPU_ALLOW_FLASH_WRITE=y CONFIG_REBOOT=y # use floating point CONFIG_FPU=y # use math functions CONFIG_NEWLIB_LIBC=y # use k_uptime_get CONFIG_SYS_CLOCK_EXISTS=y # DFU CONFIG_BOOTLOADER_MCUBOOT=y # Some command handlers require a large stack. CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096 CONFIG_MAIN_STACK_SIZE=4096 CONFIG_BT_RX_STACK_SIZE=4096 CONFIG_LED_BLINK_PERIOD=1000 CONFIG_MCUBOOT_IMAGE_VERSION="0.0.1" CONFIG_IMG_MANAGER=y # Use SPI to communicate with LR62E CONFIG_SPI=y CONFIG_SPI_NRFX=y CONFIG_LORA=y CONFIG_LORA_SX12XX=y
And this is my overlay file:
/ { aliases { led0 = &led0; sw0 = &button0; lora0 = &lora; }; leds { compatible = "gpio-leds"; led0: led_0 { gpios = <&gpio0 0x02 GPIO_ACTIVE_LOW>; label = "Meu LED vermelho"; }; led1: led_1 { gpios = <&gpio0 0x03 GPIO_ACTIVE_LOW>; label = "Meu LED amarelo"; }; }; buttons { compatible = "gpio-keys"; button0: button_0 { gpios = <&gpio0 0x10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; label = "OTA button"; }; }; pinctrl: pin-controller { spi0_default: spi0_default { phandle = <0xa>; group1 { psels = <NRF_PSEL(SPIM_MOSI, 0, 23)>, <NRF_PSEL(SPIM_MISO, 0, 24)>, <NRF_PSEL(SPIM_SCK, 0, 25)>; }; }; spi0_sleep: spi0_sleep { phandle = <0xb>; group1 { psels = <NRF_PSEL(SPIM_MOSI, 0, 23)>, <NRF_PSEL(SPIM_MISO, 0, 24)>, <NRF_PSEL(SPIM_SCK, 0, 25)>; low-power-enable; }; }; }; }; &spi0 { compatible = "nordic,nrf-spi"; #address-cells = <0x1>; #size-cells = <0x0>; interrupts = <0x4 0x1>; max-frequency = <16000000>; status = "okay"; pinctrl-0 = <&spi0_default>; pinctrl-1 = <&spi0_sleep>; pinctrl-names = "default", "sleep"; lora: sx1262@0 { compatible = "semtech,sx1262"; reg = <0>; dio1-gpios = <&gpio0 21 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>; reset-gpios = <&gpio0 20 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; busy-gpios = <&gpio0 14 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>; spi-max-frequency = <16000000>; }; }; // &spi1 { // compatible = "nordic,nrf-spi"; // #address-cells = <0x1>; // #size-cells = <0x0>; // reg = <0x40004000 0x1000>; // interrupts = <0x4 0x1>; // max-frequency = <0x7a1200>; // status = "okay"; // pinctrl-0 = <&spi1_default>; // pinctrl-1 = <&spi1_sleep>; // pinctrl-names = "default", "sleep"; // }; // tentar colocar isso dentro de pinctrl: pin-controller (acima) &pinctrl { uart0_default: uart0_default { group1 { psels = <NRF_PSEL(UART_TX, 0, 13)>, <NRF_PSEL(UART_RTS, 0, 26)>; }; group2 { psels = <NRF_PSEL(UART_RX, 0, 12)>, <NRF_PSEL(UART_CTS, 0, 27)>; bias-pull-up; }; }; uart0_sleep: uart0_sleep { group1 { psels = <NRF_PSEL(UART_TX, 0, 13)>, <NRF_PSEL(UART_RX, 0, 12)>, <NRF_PSEL(UART_RTS, 0, 26)>, <NRF_PSEL(UART_CTS, 0, 27)>; low-power-enable; }; }; };
I have seen other issues related to this error on the Q&A but it seems that it's usually thrown when you try to interact with the flash via SPI, but it's not my case because I get the error upon initialization, without trying to directly use the SPI. My questions are:
- When do I have to worry about this error?
- How can I find out the origin of the error and solve it?
Thanks in advance.