code
#include <zephyr/logging/log.h> #include <zephyr/net/socket.h> #include <zephyr/sys/fdtable.h> #include <zephyr/device.h> #include <zephyr/devicetree.h> #include <zephyr/drivers/gpio.h> #include <zephyr/drivers/spi.h> #include <unistd.h> #include <errno.h> #include <stdio.h> #include "UDP_Server_Ack.h" LOG_MODULE_DECLARE(spi, CONFIG_LOG_DEFAULT_LEVEL); #include "deviceInformation.h" #define SPI_RHD_STACK_SIZE 4096 #define STM_PRIORITY 7 static struct k_thread intanspi_rhd; K_THREAD_STACK_DEFINE(INTANSPI_RHD, SPI_RHD_STACK_SIZE); #include <stdint.h> #include <stdbool.h> #define INTAN_DT DT_NODELABEL(intanrhs) #define MY_CLOCK_FREQ DT_DROP(DT_PATH(soc, peripheral_50000000, spi_c000, intanrhs_0), clock_fequency) #define SPIOP SPI_OP_MODE_MASTER | SPI_WORD_SET(16) struct spi_dt_spec rhd_spi_spec = SPI_DT_SPEC_GET(INTAN_DT,SPIOP,0); bool convert_mode = 0; static void readRegister(uint16_t reg, uint16_t *values, uint8_t size){ uint16_t tx_buffer; tx_buffer = reg; struct spi_buf tx_spi_buf = {.buf = (void *)&tx_buffer, .len = 1}; struct spi_buf_set tx_spi_buf_set = {.buffers = &tx_spi_buf, .count = 1}; struct spi_buf rx_spi_bufs = {.buf = values, .len = size}; struct spi_buf_set rx_spi_buf_set = {.buffers = &rx_spi_bufs, .count = 1}; spi_transceive_dt(&rhd_spi_spec, &tx_spi_buf_set, &rx_spi_buf_set); }; int rhd_calibration(){ uint16_t no_op=0; uint16_t dummydata[9]={0}; uint16_t cal_command =0; // cal_command=0101 0101 0000 0000 cal_command |= (1<<14);cal_command |= (1<<12);cal_command |= (1<<10);cal_command |= (1<<8); readRegister(cal_command,&dummydata[0],1); LOG_INF("Start Calibration"); for (int i=1 ; i<9; i++){ readRegister(no_op,&dummydata[i],1); }; LOG_INF("End Calibration"); return 0; }; int rhd_reader(uint8_t reg){ uint16_t no_op=0; uint16_t dummydata[2]={0}; uint16_t read_command =0; uint16_t read_result; // read_command=11 reg[6] 0000 0000 read_command |= ((reg) << 8); read_command |= (1<<15); read_command |= (1<<14); readRegister(read_command,&dummydata[0],1); readRegister(no_op,&dummydata[1],1); readRegister(no_op,&read_result,1); return read_result; } int rhd_write(uint8_t reg, uint8_t data){ uint16_t no_op=0; uint16_t dummydata[2]={0}; uint16_t write_command =0; uint16_t write_result; // write_command=10 reg[6] data[8] write_command |= ((data)); write_command |= ((reg) << 8); write_command |= (1<<15); readRegister(write_command,&dummydata[0],1); readRegister(no_op,&dummydata[1],1); readRegister(no_op,&write_result,1); return write_result; }; int rhd_convert_channel(uint8_t reg){ uint16_t no_op=0; uint16_t dummydata[2]={0}; uint16_t onechannel_command =0; uint16_t onechannel_result; // onechannel_command=00 reg[6] 0000 0000 onechannel_command |= ((reg) << 8); readRegister(onechannel_command,&dummydata[0],1); readRegister(no_op,&dummydata[1],1); readRegister(no_op,&onechannel_result,1); return onechannel_result; }; int rhd_convert_multichannel() { uint16_t convert_data[512]; uint16_t dummydata[2]={0}; uint16_t no_op=0; uint16_t convert1_command =0; uint16_t convert2_command =0; uint16_t convert30_command =0; uint16_t convert31_command =0; uint8_t channel = 2; uint16_t convert_command=0; uint8_t cha; convert1_command |= 1; convert2_command |= 1; convert2_command |= (1<<8); convert30_command |= 1; convert30_command |= (30<<8); convert31_command |= 1; convert31_command |= (31<<8); LOG_INF("Start Multichannel Convert"); readRegister(convert1_command,&dummydata[0],1); readRegister(convert2_command,&dummydata[1],1); while(1){ cha = channel % 32; convert_command =0; convert_command |= ((cha)<<8); readRegister(convert_command,&convert_data[channel-2],1); if (convert_mode == 0){ readRegister(no_op,&convert_data[channel-2],1); readRegister(no_op,&convert_data[channel-2],1); UDP_Ack_Server_Send(convert_data, sizeof(convert_data)); break; }; channel++; if (channel == 511){ readRegister(convert1_command,&convert_data[510],1); readRegister(convert2_command,&convert_data[511],1); UDP_Ack_Server_Send(convert_data, sizeof(convert_data)); channel = 2; }; }; return channel; }; int spi_rhd(){ rhd_calibration(); while(1){ rhd_convert_multichannel(); } }; void Intan_SPI_Init( void ){ k_thread_create ( \ &intanspi_rhd, \ INTANSPI_RHD, \ SPI_RHD_STACK_SIZE, \ (k_thread_entry_t)spi_rhd, \ NULL, \ NULL, \ NULL, \ STM_PRIORITY, \ 0, \ K_NO_WAIT); k_thread_name_set(&intanspi_rhd, "rhd"); k_thread_start(&intanspi_rhd); }
error
FAILED: CMakeFiles/app.dir/src/Task/intanSPI.c.obj ccache /opt/nordic/ncs/toolchains/b8efef2ad5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=213024 -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"nrf-psa-crypto-config.h\" -DMBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE=\"nrf-psa-crypto-user-config.h\" -DNRF52_ERRATA_215_ENABLE_WORKAROUND=0 -DNRF5340_XXAA_APPLICATION -DNRF53_ERRATA_159_ENABLE_WORKAROUND=0 -DNRF53_ERRATA_43_ENABLE_WORKAROUND=0 -DNRF70_ANT_GAIN_2G=0 -DNRF70_ANT_GAIN_5G_BAND1=0 -DNRF70_ANT_GAIN_5G_BAND2=0 -DNRF70_ANT_GAIN_5G_BAND3=0 -DNRF70_BAND_2G_LOWER_EDGE_BACKOFF_DSSS=0 -DNRF70_BAND_2G_LOWER_EDGE_BACKOFF_HE=0 -DNRF70_BAND_2G_LOWER_EDGE_BACKOFF_HT=0 -DNRF70_BAND_2G_UPPER_EDGE_BACKOFF_DSSS=0 -DNRF70_BAND_2G_UPPER_EDGE_BACKOFF_HE=0 -DNRF70_BAND_2G_UPPER_EDGE_BACKOFF_HT=0 -DNRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HE=0 -DNRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HT=0 -DNRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HE=0 -DNRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HT=0 -DNRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HE=0 -DNRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HT=0 -DNRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HE=0 -DNRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HT=0 -DNRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HE=0 -DNRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HT=0 -DNRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HE=0 -DNRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HT=0 -DNRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HE=0 -DNRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HT=0 -DNRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HE=0 -DNRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HT=0 -DNRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HE=0 -DNRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HT=0 -DNRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HE=0 -DNRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HT=0 -DNRF70_DATA_TX -DNRF70_LOG_VERBOSE -DNRF70_MAX_TX_PENDING_QLEN=12 -DNRF70_MAX_TX_TOKENS=10 -DNRF70_PCB_LOSS_2G=0 -DNRF70_PCB_LOSS_5G_BAND1=0 -DNRF70_PCB_LOSS_5G_BAND2=0 -DNRF70_PCB_LOSS_5G_BAND3=0 -DNRF70_REG_DOMAIN=00 -DNRF70_RPU_PS_IDLE_TIMEOUT_MS="" -DNRF70_RX_MAX_DATA_SIZE=1600 -DNRF70_RX_NUM_BUFS=48 -DNRF70_STA_MODE -DNRF70_SYSTEM_MODE -DNRF70_TCP_IP_CHECKSUM_OFFLOAD -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_WIFI_AP_DEAD_DETECT_TIMEOUT=20 -DNRF_WIFI_IFACE_MTU=1500 -DNRF_WIFI_MGMT_BUFF_OFFLOAD -DNRF_WIFI_PS_INT_PS=y -DNRF_WIFI_RPU_RECOVERY_PS_ACTIVE_TIMEOUT_MS="" -DUSE_PARTITION_MANAGER=1 -D_ANSI_SOURCE -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/opt/nordic/ncs/v2.9.0/zephyr/subsys/net/ip -I/Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/build_8/spi_wifi_v1_RHD_TEST/zephyr/include/generated/zephyr -I/opt/nordic/ncs/v2.9.0/zephyr/include -I/Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/build_8/spi_wifi_v1_RHD_TEST/zephyr/include/generated -I/opt/nordic/ncs/v2.9.0/zephyr/soc/nordic -I/opt/nordic/ncs/v2.9.0/zephyr/lib/libc/newlib/include -I/opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/posix -I/opt/nordic/ncs/v2.9.0/zephyr/lib/posix/options/getopt -I/opt/nordic/ncs/v2.9.0/zephyr/soc/nordic/nrf53/. -I/opt/nordic/ncs/v2.9.0/zephyr/soc/nordic/common/. -I/opt/nordic/ncs/v2.9.0/zephyr/subsys/net/l2 -I/opt/nordic/ncs/v2.9.0/zephyr/subsys/settings/include -I/opt/nordic/ncs/v2.9.0/zephyr/subsys/shell/modules/kernel_service/thread/.. -I/opt/nordic/ncs/v2.9.0/zephyr/drivers/wifi/nrf_wifi/inc -I/opt/nordic/ncs/v2.9.0/nrf/include -I/Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/build_8/spi_wifi_v1_RHD_TEST/zephyr/misc/generated -I/opt/nordic/ncs/v2.9.0/modules/lib/hostap/port/mbedtls -I/opt/nordic/ncs/v2.9.0/nrf/tests/include -I/opt/nordic/ncs/v2.9.0/modules/hal/cmsis/CMSIS/Core/Include -I/opt/nordic/ncs/v2.9.0/zephyr/modules/cmsis/. -I/opt/nordic/ncs/v2.9.0/modules/hal/nordic/nrfx -I/opt/nordic/ncs/v2.9.0/modules/hal/nordic/nrfx/drivers/include -I/opt/nordic/ncs/v2.9.0/modules/hal/nordic/nrfx/mdk -I/opt/nordic/ncs/v2.9.0/zephyr/modules/hal_nordic/nrfx/. -I/opt/nordic/ncs/v2.9.0/zephyr/modules/hostap/src -I/opt/nordic/ncs/v2.9.0/modules/lib/hostap -I/opt/nordic/ncs/v2.9.0/modules/lib/hostap/wpa_supplicant -I/opt/nordic/ncs/v2.9.0/modules/lib/hostap/src -I/opt/nordic/ncs/v2.9.0/modules/lib/hostap/src/common -I/opt/nordic/ncs/v2.9.0/modules/lib/hostap/src/eap_common -I/opt/nordic/ncs/v2.9.0/modules/lib/hostap/src/eap_server -I/opt/nordic/ncs/v2.9.0/modules/lib/hostap/src/radius -I/opt/nordic/ncs/v2.9.0/modules/lib/hostap/src/crypto -I/opt/nordic/ncs/v2.9.0/modules/lib/hostap/src/ap -I/opt/nordic/ncs/v2.9.0/modules/lib/hostap/src/drivers -I/opt/nordic/ncs/v2.9.0/modules/lib/hostap/src/rsn_supp -I/Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/build_8/spi_wifi_v1_RHD_TEST/generated/library_nrf_security_psa -I/opt/nordic/ncs/v2.9.0/nrf/subsys/nrf_security/include -I/opt/nordic/ncs/v2.9.0/nrf/subsys/nrf_security/src/threading/include -I/opt/nordic/ncs/v2.9.0/nrf/subsys/nrf_security/src/utils -I/opt/nordic/ncs/v2.9.0/modules/crypto/oberon-psa-crypto/oberon/drivers -I/opt/nordic/ncs/v2.9.0/modules/crypto/oberon-psa-crypto/include -I/opt/nordic/ncs/v2.9.0/modules/crypto/oberon-psa-crypto/library -I/opt/nordic/ncs/v2.9.0/modules/crypto/mbedtls/library -I/opt/nordic/ncs/v2.9.0/modules/crypto/mbedtls/include -I/opt/nordic/ncs/v2.9.0/modules/crypto/mbedtls/include/library -I/opt/nordic/ncs/v2.9.0/nrfxlib/crypto/nrf_oberon/include -I/opt/nordic/ncs/v2.9.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -I/opt/nordic/ncs/v2.9.0/zephyr/modules/nrf_wifi/os -I/opt/nordic/ncs/v2.9.0/zephyr/modules/nrf_wifi/os/../bus -I/opt/nordic/ncs/v2.9.0/modules/lib/nrf_wifi/utils/inc -I/opt/nordic/ncs/v2.9.0/modules/lib/nrf_wifi/os_if/inc -I/opt/nordic/ncs/v2.9.0/modules/lib/nrf_wifi/bus_if/bus/qspi/inc -I/opt/nordic/ncs/v2.9.0/modules/lib/nrf_wifi/bus_if/bal/inc -I/opt/nordic/ncs/v2.9.0/modules/lib/nrf_wifi/fw_if/umac_if/inc -I/opt/nordic/ncs/v2.9.0/modules/lib/nrf_wifi/fw_load/mips/fw/inc -I/opt/nordic/ncs/v2.9.0/modules/lib/nrf_wifi/hw_if/hal/inc -I/opt/nordic/ncs/v2.9.0/modules/lib/nrf_wifi/hw_if/hal/inc/fw -I/opt/nordic/ncs/v2.9.0/modules/lib/nrf_wifi/fw_if/umac_if/inc/fw -I/opt/nordic/ncs/v2.9.0/modules/lib/nrf_wifi/fw_if/umac_if/inc/default -isystem /opt/nordic/ncs/v2.9.0/zephyr/lib/libc/common/include -isystem /opt/nordic/ncs/v2.9.0/nrfxlib/crypto/nrf_cc312_platform/include -Os -DNDEBUG -fno-strict-aliasing -Os -imacros /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/build_8/spi_wifi_v1_RHD_TEST/zephyr/include/generated/zephyr/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=/opt/nordic/ncs/toolchains/b8efef2ad5/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST=CMAKE_SOURCE_DIR -fmacro-prefix-map=/opt/nordic/ncs/v2.9.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/opt/nordic/ncs/v2.9.0=WEST_TOPDIR -ffunction-sections -fdata-sections -D_POSIX_THREADS -std=c99 -MD -MT CMakeFiles/app.dir/src/Task/intanSPI.c.obj -MF CMakeFiles/app.dir/src/Task/intanSPI.c.obj.d -o CMakeFiles/app.dir/src/Task/intanSPI.c.obj -c /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/src/Task/intanSPI.c In file included from /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/arch/arm/arch.h:20, from /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/arch/cpu.h:19, from /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/sys/cbprintf_internal.h:17, from /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/sys/cbprintf.h:124, from /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/logging/log_msg.h:11, from /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/logging/log_core.h:9, from /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/logging/log.h:11, from /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/src/Task/intanSPI.c:2: /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/build_8/spi_wifi_v1_RHD_TEST/zephyr/include/generated/zephyr/devicetree_generated.h:16792:33: error: 'DT_N_S_soc_S_peripheral_50000000_S_spi_c000_S_intanrhs_0_P_spi_max_frequency' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_peripheral_50000000_S_spi_c000_S_intanrhs_0_P_reg_IDX_0_EXISTS'? 16792 | #define DT_N_NODELABEL_intanrhs DT_N_S_soc_S_peripheral_50000000_S_spi_c000_S_intanrhs_0 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4879:29: note: in definition of macro 'DT_CAT3' 4879 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3 | ^~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/drivers/spi.h:349:30: note: in expansion of macro 'DT_PROP' 349 | .frequency = DT_PROP(node_id, spi_max_frequency), \ | ^~~~~~~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/drivers/spi.h:404:27: note: in expansion of macro 'SPI_CONFIG_DT' 404 | .config = SPI_CONFIG_DT(node_id, operation_, delay_) \ | ^~~~~~~~~~~~~ /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/src/Task/intanSPI.c:31:35: note: in expansion of macro 'SPI_DT_SPEC_GET' 31 | struct spi_dt_spec rhd_spi_spec = SPI_DT_SPEC_GET(INTAN_DT,SPIOP,0); | ^~~~~~~~~~~~~~~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4877:24: note: in expansion of macro 'DT_N_NODELABEL_intanrhs' 4877 | #define DT_CAT(a1, a2) a1 ## a2 | ^~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:200:29: note: in expansion of macro 'DT_CAT' 200 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label) | ^~~~~~ /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/src/Task/intanSPI.c:27:18: note: in expansion of macro 'DT_NODELABEL' 27 | #define INTAN_DT DT_NODELABEL(intanrhs) | ^~~~~~~~~~~~ /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/src/Task/intanSPI.c:31:51: note: in expansion of macro 'INTAN_DT' 31 | struct spi_dt_spec rhd_spi_spec = SPI_DT_SPEC_GET(INTAN_DT,SPIOP,0); | ^~~~~~~~ /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/build_8/spi_wifi_v1_RHD_TEST/zephyr/include/generated/zephyr/devicetree_generated.h:16792:33: error: 'DT_N_S_soc_S_peripheral_50000000_S_spi_c000_S_intanrhs_0_P_duplex' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_peripheral_50000000_S_spi_c000_S_intanrhs_0_P_reg'? 16792 | #define DT_N_NODELABEL_intanrhs DT_N_S_soc_S_peripheral_50000000_S_spi_c000_S_intanrhs_0 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4879:29: note: in definition of macro 'DT_CAT3' 4879 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3 | ^~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/drivers/spi.h:351:25: note: in expansion of macro 'DT_PROP' 351 | DT_PROP(node_id, duplex) | \ | ^~~~~~~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/drivers/spi.h:404:27: note: in expansion of macro 'SPI_CONFIG_DT' 404 | .config = SPI_CONFIG_DT(node_id, operation_, delay_) \ | ^~~~~~~~~~~~~ /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/src/Task/intanSPI.c:31:35: note: in expansion of macro 'SPI_DT_SPEC_GET' 31 | struct spi_dt_spec rhd_spi_spec = SPI_DT_SPEC_GET(INTAN_DT,SPIOP,0); | ^~~~~~~~~~~~~~~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4877:24: note: in expansion of macro 'DT_N_NODELABEL_intanrhs' 4877 | #define DT_CAT(a1, a2) a1 ## a2 | ^~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:200:29: note: in expansion of macro 'DT_CAT' 200 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label) | ^~~~~~ /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/src/Task/intanSPI.c:27:18: note: in expansion of macro 'DT_NODELABEL' 27 | #define INTAN_DT DT_NODELABEL(intanrhs) | ^~~~~~~~~~~~ /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/src/Task/intanSPI.c:31:51: note: in expansion of macro 'INTAN_DT' 31 | struct spi_dt_spec rhd_spi_spec = SPI_DT_SPEC_GET(INTAN_DT,SPIOP,0); | ^~~~~~~~ /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/build_8/spi_wifi_v1_RHD_TEST/zephyr/include/generated/zephyr/devicetree_generated.h:16792:33: error: 'DT_N_S_soc_S_peripheral_50000000_S_spi_c000_S_intanrhs_0_P_frame_format' undeclared here (not in a function); did you mean 'DT_N_S_soc_S_peripheral_50000000_S_spi_c000_S_intanrhs_0_P_reg'? 16792 | #define DT_N_NODELABEL_intanrhs DT_N_S_soc_S_peripheral_50000000_S_spi_c000_S_intanrhs_0 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4879:29: note: in definition of macro 'DT_CAT3' 4879 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3 | ^~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/drivers/spi.h:352:25: note: in expansion of macro 'DT_PROP' 352 | DT_PROP(node_id, frame_format) | \ | ^~~~~~~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/drivers/spi.h:404:27: note: in expansion of macro 'SPI_CONFIG_DT' 404 | .config = SPI_CONFIG_DT(node_id, operation_, delay_) \ | ^~~~~~~~~~~~~ /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/src/Task/intanSPI.c:31:35: note: in expansion of macro 'SPI_DT_SPEC_GET' 31 | struct spi_dt_spec rhd_spi_spec = SPI_DT_SPEC_GET(INTAN_DT,SPIOP,0); | ^~~~~~~~~~~~~~~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:4877:24: note: in expansion of macro 'DT_N_NODELABEL_intanrhs' 4877 | #define DT_CAT(a1, a2) a1 ## a2 | ^~ /opt/nordic/ncs/v2.9.0/zephyr/include/zephyr/devicetree.h:200:29: note: in expansion of macro 'DT_CAT' 200 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label) | ^~~~~~ /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/src/Task/intanSPI.c:27:18: note: in expansion of macro 'DT_NODELABEL' 27 | #define INTAN_DT DT_NODELABEL(intanrhs) | ^~~~~~~~~~~~ /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/src/Task/intanSPI.c:31:51: note: in expansion of macro 'INTAN_DT' 31 | struct spi_dt_spec rhd_spi_spec = SPI_DT_SPEC_GET(INTAN_DT,SPIOP,0); | ^~~~~~~~ [148/517] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_cache.c.obj [149/517] Building C object zephyr/CMakeFiles/zephyr.dir/lib/utils/onoff.c.obj [150/517] Building C object zephyr/CMakeFiles/zephyr.dir/lib/utils/bitarray.c.obj [151/517] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_mgmt.c.obj [152/517] Building C object CMakeFiles/app.dir/src/Task/UDP_Server_Ack.c.obj [153/517] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map_layout.c.obj [154/517] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/storage/flash_map/flash_map.c.obj [155/517] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_core.c.obj [156/517] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_msg.c.obj [157/517] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_output.c.obj [158/517] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/mem_mgmt/mem_attr.c.obj [159/517] Building C object CMakeFiles/app.dir/src/Task/Wifi_Stationing.c.obj [160/517] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/fs/nvs/nvs.c.obj ninja: build stopped: subcommand failed. FAILED: _sysbuild/sysbuild/images/spi_wifi_v1_RHD_TEST-prefix/src/spi_wifi_v1_RHD_TEST-stamp/spi_wifi_v1_RHD_TEST-build /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/build_8/_sysbuild/sysbuild/images/spi_wifi_v1_RHD_TEST-prefix/src/spi_wifi_v1_RHD_TEST-stamp/spi_wifi_v1_RHD_TEST-build cd /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/build_8/spi_wifi_v1_RHD_TEST && /opt/nordic/ncs/toolchains/b8efef2ad5/Cellar/cmake/3.21.0/bin/cmake --build . ninja: build stopped: subcommand failed. FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/b8efef2ad5/bin/cmake --build /Users/leehyunjae/firmware_nordic/spi_wifi_v1_RHD_TEST/build_8 * The terminal process terminated with exit code: 1. * Terminal will be reused by tasks, press any key to close it.
dts
/dts-v1/; #include <nordic/nrf5340_cpuapp_qkaa.dtsi> #include "bridge_wifi_nrf5340-pinctrl.dtsi" #include "nrf5340_cpuapp_common.dtsi" / { model = "Nordic NRF7002 DK NRF5340 Application"; compatible = "nordic,nrf7002-dk-nrf5340-cpuapp"; chosen { zephyr,sram = &sram0_image; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; zephyr,sram-secure-partition = &sram0_s; zephyr,sram-non-secure-partition = &sram0_ns; zephyr,wifi = &wlan0; }; }; #include "bridge_wifi_nrf5340-cpuapp_partitioning.dtsi" #include "bridge_wifi_nrf5340-shared_sram.dtsi" &qspi { nrf70: nrf7002@1 { compatible = "nordic,nrf7002-qspi"; status = "okay"; reg = <1>; qspi-frequency = <24000000>; qspi-quad-mode; #include "nrf70_common.dtsi" #include "nrf70_common_5g.dtsi" }; }; &spi3 { compatible = "nordic,nrf-spim"; status = "okay"; cs-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; pinctrl-0 = <&spi3_default>; pinctrl-1 = <&spi3_sleep>; pinctrl-names = "default", "sleep"; intanrhs: intanrhs@0 { compatible = "spi-device"; reg = <0>; spi-max-frequency = <16000000>; label = "IntanRHS"; frame-format = <0>; }; max-frequency = <DT_FREQ_M(160)>; }; &spi4 { /delete-property/ rx-delay-supported; status = "disabled"; }; &gpiote1 { status = "okay"; };
deconfig file
# SPDX-License-Identifier: Apache-2.0 # Enable MPU CONFIG_ARM_MPU=y # Enable hardware stack protection CONFIG_HW_STACK_PROTECTION=y # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y # Enable GPIO CONFIG_GPIO=y # Enable PINCTRL CONFIG_PINCTRL=y # Enable uart driver CONFIG_SERIAL=y # enable console CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_SPI=y