How to add W25Q80 flash to my board?

Hello. 

I try to connect SPI memory W25Q80 to nRF52840DK (in the future it will be my own board) but I have problem with device tree. I modified original files (nRF52840dk_nRF52840) but still I can't build project. 

dts file:

	aliases {
		led0 = &led0;
		led1 = &led1;
		led2 = &led2;
		led3 = &led3;
		pwm-led0 = &pwm_led0;
		in0 = &input0;
		in1 = &input1;
		in2 = &input2;
		in3 = &input3;
		bootloader-led0 = &led0;
		mcuboot-button0 = &input0;
		mcuboot-led0 = &led0;
		watchdog0 = &wdt0;
		//spi-flash0 = &mx25r64;
		spi-flash0 = &w25q80;
	};
	
	&qspi {
	status = "disabled";
	pinctrl-0 = <&qspi_default>;
	pinctrl-1 = <&qspi_sleep>;
	pinctrl-names = "default", "sleep";
	// mx25r64: mx25r6435f@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 = [c2 28 17];
	// 	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>;
	// 	has-dpd;
	// 	t-enter-dpd = <10000>;
	// 	t-exit-dpd = <35000>;
	// };
};

&spi3 {
	compatible = "nordic,nrf-spim";
	status = "okay";
	cs-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; 
	pinctrl-0 = <&spi3_default>;
	pinctrl-1 = <&spi3_sleep>;
	pinctrl-names = "default", "sleep";

	w25q80: w25q80@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <8000000>;
		jedec-id = [EF 40 14];
		size = <1048576>;
	};
};
 

Implementation in my W25Q80.c file:

const struct device *ex_flash_device = DEVICE_DT_GET(DT_ALIAS(spi-flash0));
I wanted to use "zephyr/samples/drivers/spi_flash" example from Zephyr repo, is it good choice for this type of memory?
Best regards
PW
Parents Reply Children
No Data
Related