You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
spi_flash_w25qxxdv still uses Zephyr semaphore kernel while MCUBoot uses CONFIG_MULTITHREADING=n. As discussed in various Github issues #8368, #9808 problems might exist when using Zephyr kernel API with CONFIG_MULTITHREADING=n.
When W25Q SPI Flash initializes itself, it checks if the Flash ID matches the expected one. To do that it sends a command through SPI using spi_transceive().
All/Most SPI drivers use spi_context.h that uses Zephyr semaphore API.
Instructions to duplicate the issue on nRF52840 PCA10056 (but the issue could in theory be duplicated on any board that their SPI driver uses spi_context.h such as the following SPI drivers: DW, Intel, STM32, Nordic) and there is no need of W25Q SPI Flash as the crash occurs before any SPI transmission:
Add to boot/zephyr/prj.conf
CONFIG_SPI=y
CONFIG_SPI_0=y
CONFIG_SPI_NRFX=y
CONFIG_FLASH=y
CONFIG_SPI_FLASH_W25QXXDV=y
CONFIG_SPI_FLASH_W25QXXDV_SPI_NAME="SPI_0"
CONFIG_SPI_FLASH_W25QXXDV_SPI_SLAVE=0
# Required by Zephyr v1.13 but must be removed for head of Zephyr (DTS is used instead):
CONFIG_SPI_0_NRF_SCK_PIN=13
CONFIG_SPI_0_NRF_MOSI_PIN=15
CONFIG_SPI_0_NRF_MISO_PIN=17
CONFIG_SPI_0_IRQ_PRI=3
It crashes with:
***** USAGE FAULT *****
Illegal load of EXC_RETURN into PC
***** Hardware exception *****
Current thread ID = 0x00000000
Faulting instruction address = 0xf7ffeb04
I suspect it is due to the semaphore not being initialized but before investigating the issue myself I would like to know the decision for MCUBoot regarding CONFIG_MULTITHREADING=n.
The text was updated successfully, but these errors were encountered:
In case anyone else ends up here when trying to debug getting W25Q SPI flash working with Zephyr, adding CONFIG_MULTITHREADING=y in the MCUBOOT prj.conf (along with the CONFIG_SPI_NOR=y, CONFIG_SPI=y and CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y options) seems to do the trick.
spi_flash_w25qxxdv
still uses Zephyr semaphore kernel while MCUBoot usesCONFIG_MULTITHREADING=n
. As discussed in various Github issues #8368, #9808 problems might exist when using Zephyr kernel API withCONFIG_MULTITHREADING=n
.When W25Q SPI Flash initializes itself, it checks if the Flash ID matches the expected one. To do that it sends a command through SPI using
spi_transceive()
.All/Most SPI drivers use spi_context.h that uses Zephyr semaphore API.
Instructions to duplicate the issue on nRF52840 PCA10056 (but the issue could in theory be duplicated on any board that their SPI driver uses
spi_context.h
such as the following SPI drivers: DW, Intel, STM32, Nordic) and there is no need of W25Q SPI Flash as the crash occurs before any SPI transmission:boot/zephyr/prj.conf
It crashes with:
I suspect it is due to the semaphore not being initialized but before investigating the issue myself I would like to know the decision for MCUBoot regarding
CONFIG_MULTITHREADING=n
.The text was updated successfully, but these errors were encountered: