I tried to drive the flash device W25Q32 on ncs v1.3, but there was no proper spi routine to refer to.
I tried to drive the flash device W25Q32 on ncs v1.3, but there was no proper spi routine to refer to.
Hi,
It looks like there's an example for W25Qxx in zephyr, which you can try:
https://github.com/nrfconnect/sdk-zephyr/blob/master/samples/drivers/spi_flash/src/main.c
However; it does not have a board file for nrf9160, and I personally haven't tested the above sample.
Kind regards,
Håkon
Hi,
It looks like there's an example for W25Qxx in zephyr, which you can try:
https://github.com/nrfconnect/sdk-zephyr/blob/master/samples/drivers/spi_flash/src/main.c
However; it does not have a board file for nrf9160, and I personally haven't tested the above sample.
Kind regards,
Håkon
HI HåkonAlseth,
I tried to open this project, but report an error.
The relevant screenshots are as follows:
Kind regards, Peter.Min
Hi Peter,
I am not able to fully test this driver, but I created a configuration + dts overlay for W25Q32:
the .conf file goes into the ../spi_flash/boards/ folder, and the .overlay goes in ../spi_flash folder.
It tried atleast to read the JEDEC ID when I scoped the MOSI + CLK line:
Could you try this configuration + overlay and see if it works/compiles at your end? Feel free to change the settings in the overlay file to match your GPIO settings and spi frequency etc.
Kind regards,
Håkon
Hi Håkon Alseth,
I test the example used ncs v1.3 on PCA10090 0.9.0
The example path is D:\ncs\v1.3.0\zephyr\samples\drivers\spi_flash\src\main.c
The overlay path is D:\ncs\v1.3.0\zephyr\samples\drivers\spi_flash\nrf9160dk_nrf9160ns.overlay
The conf path is D:\ncs\v1.3.0\zephyr\samples\drivers\spi_flash\boards\nrf9160dk_nrf9160ns.conf
The dts path is D:\ncs\v1.3.0\zephyr\boards\arm\nrf9160dk_nrf9160\nrf9160dk_nrf9160_common.dts
The log is as below:
The cs-gpios = <&gpio0 13 0>; timing diagram is seems error.
The timing diagram is as below:
The test example is attached.
nrf9160测试demo.rar
Kind regards, Peter.Min
Hi,
Are you sure you have connected the grounding properly to the logic analyzer?
This is the scope I get when trying your code:
Kind regards,
Håkon
Hi,Håkon Alseth
This has little to do with the logic analyzer, just look at the log log and know that the w25q32 chip is not recognized.
Did you test with the development board PIN 10 11 12 13?
Kind regards, Peter.Min