nRF52832 SPI

Hello,

I am attempting to convert my I2c connection to an SPI connection and am stuck on what I need to change (the device is wired for SPI but to I2c pins).

I would love to make a device tree node and be able to change the default pins of the SPI as the wires are currently connected to the I2c default pins.

or 

Is there a way to set pin P0.26 to ground or active low or a voltage. How would I go about setting that pin? This would enable my I2c to work (hopefully).

Any help would be very appreciated. 

// &spi0 {
//     status = "okay";
//     BMA456: BMA456@0 {
//         compatible = "spi-device";
//         reg = <0>;
//         spi-max-frequency = <10000000>;
//         label = "BMA456";        
//         status = "okay";
//     };
// };

#define SPI0_NODE DT_NODELABEL(BMA456)
static const struct spi_dt_spec dev_spi = SPI_DT_SPEC_GET(SPI0_NODE, SPI_OP_MODE_MASTER, 0);

// BMA4_INTF_RET_TYPE bma4_spi_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *intf_ptr)
// {
//     uint8_t dev_address = *(uint8_t*)intf_ptr;

//     (void)intf_ptr;

//     return coines_read_spi(COINES_SPI_BUS_0, dev_address, reg_addr, reg_data, (uint16_t)len);
// }

// BMA4_INTF_RET_TYPE bma4_spi_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr)
// {
//     uint8_t dev_address = *(uint8_t*)intf_ptr;

//     (void)intf_ptr;

//     return coines_write_spi(COINES_SPI_BUS_0, dev_address, reg_addr, (uint8_t *)reg_data, (uint16_t)len);
// }

My attempt

BMA4_INTF_RET_TYPE bma4_spi_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *intf_ptr)
{
    rslt= spi_transeive(&dev_spi, reg_addr, reg_data);
    return rslt;
}

BMA4_INTF_RET_TYPE bma4_spi_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr)
{
    rslt= spi_write_dt(&dev_spi, *reg_data);
    return rslt;
}

I2c code

&i2c0 {   
    mysensor: mysensor@18{
        compatible = "i2c-device";
        status = "okay";
        reg = < 0x18 >; //
        label = "mysensor";
        sda-gpios = <&gpio0 25 0>; /*GPIO0_25*/
        /*Turn off when not in use */
        i2c-gpio,disable-on-idle; /*not sure if this works */       
    };
};

/*I2C Bus Initialization*/
#define I2C0_NODE DT_NODELABEL(mysensor)
static const struct i2c_dt_spec dev_i2c = I2C_DT_SPEC_GET(I2C0_NODE);

BMA4_INTF_RET_TYPE bma4_i2c_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *intf_ptr)
{   
    //turn on i2c bus    
    //pm_device_action_run(i2c0_dev, PM_DEVICE_STATE_ACTIVE);  
    //add i2c function for nrf52832    
    uint8_t buffer[] = {reg_addr, *reg_data};         
    rslt = i2c_write_read_dt(&dev_i2c, &buffer[0], 1, reg_data, len);   
    //turn off i2c bus    
    // Disable the I2C peripheral
    //pm_device_action_run(i2c0_dev, PM_DEVICE_ACTION_SUSPEND); 
    
    return rslt;   
}

/*!
 * I2C write function map to nRF52832 platform
 */
BMA4_INTF_RET_TYPE bma4_i2c_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr)
{           
    //turn on i2c bus    
    //rslt = pm_device_action_run(&i2c0_dev, PM_DEVICE_STATE_ACTIVE);  
    //add i2c function for nrf52832
    uint8_t buffer[] = {reg_addr, *reg_data};  
    //rslt= i2c_write_dt(&dev_i2c, buffer, len);      
    rslt= i2c_burst_write_dt(&dev_i2c, buffer[0], (uint8_t *)reg_data, len);    
    //turn off i2c bus    
    //rslt = pm_device_action_run(&i2c0_dev, PM_DEVICE_STATE_OFF); 
    return rslt;
}

The errors I get

* Executing task: nRF Connect: Build: BMA456W_nRF52832_CB/build (active)

Building BMA456W_nRF52832_CB
C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir c:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB/build c:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB"

[0/1] Re-running CMake...
Loading Zephyr default modules (Zephyr base (cached)).
-- Application: C:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB
-- CMake version: 3.20.5
-- Cache files will be written to: C:/ncs/v2.4.0/zephyr/.cache
-- Zephyr version: 3.3.99 (C:/ncs/v2.4.0/zephyr)
-- Found west (found suitable version "1.0.0", minimum required is "0.7.1")
-- Board: nrf52dk_nrf52832
-- Found host-tools: zephyr 0.16.0 (C:/ncs/toolchains/31f4403e35/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.16.0 (C:/ncs/toolchains/31f4403e35/opt/zephyr-sdk)
-- Found BOARD.dts: C:/ncs/v2.4.0/zephyr/boards/arm/nrf52dk_nrf52832/nrf52dk_nrf52832.dts
-- Found devicetree overlay: C:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB/boards/nrf52dk_nrf52832.overlay
-- Generated zephyr.dts: C:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: C:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: C:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB/build/zephyr/dts.cmake
Parsing C:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB/Kconfig
Loaded configuration 'C:/ncs/v2.4.0/zephyr/boards/arm/nrf52dk_nrf52832/nrf52dk_nrf52832_defconfig'
Merged configuration 'C:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB/prj.conf'
Configuration saved to 'C:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB/build/zephyr/.config'
Kconfig header saved to 'C:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB/build/zephyr/include/generated/autoconf.h'
CMake Warning at C:/ncs/v2.4.0/zephyr/CMakeLists.txt:838 (message):
No SOURCES given to Zephyr library: lib__libc__common

Excluding target from build.


-- Configuring done
-- Generating done
-- Build files have been written to: C:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB/build
[1/225] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
[2/225] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
[3/225] Generating include/generated/offsets.h
[4/225] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/multi_heap.c.obj
[5/225] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
[6/225] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap-validate.c.obj
[7/225] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
[8/225] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/bitarray.c.obj
[9/225] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
[10/225] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/thread_entry.c.obj
[11/225] Building C object CMakeFiles/app.dir/src/battery.c.obj
[12/225] Building C object CMakeFiles/app.dir/src/bma456w.c.obj
[13/225] Building C object CMakeFiles/app.dir/src/my_sensor.c.obj
[14/225] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
[15/225] Building C object CMakeFiles/app.dir/src/step_counter.c.obj
[16/225] Building C object CMakeFiles/app.dir/src/common.c.obj
FAILED: CMakeFiles/app.dir/src/common.c.obj
C:\ncs\toolchains\31f4403e35\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DNRF52832_XXAA -DUSE_PARTITION_MANAGER=0 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/ncs/v2.4.0/nrf/drivers/mpsl/clock_control -IC:/ncs/v2.4.0/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.4.0/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/ncs/v2.4.0/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.4.0/zephyr/subsys/bluetooth -IC:/ncs/v2.4.0/nrf/include -IC:/ncs/v2.4.0/nrf/lib/multithreading_lock/. -IC:/ncs/v2.4.0/nrf/subsys/bluetooth/controller/. -IC:/ncs/v2.4.0/nrf/tests/include -IC:/ncs/v2.4.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.4.0/modules/hal/nordic/nrfx -IC:/ncs/v2.4.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.4.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.4.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.4.0/modules/debug/segger/SEGGER -IC:/ncs/v2.4.0/modules/debug/segger/Config -IC:/ncs/v2.4.0/zephyr/modules/segger/. -IC:/ncs/v2.4.0/modules/crypto/tinycrypt/lib/include -IC:/ncs/v2.4.0/nrfxlib/mpsl/include -IC:/ncs/v2.4.0/nrfxlib/mpsl/include/protocol -IC:/ncs/v2.4.0/nrfxlib/softdevice_controller/include -isystem C:/ncs/v2.4.0/zephyr/lib/libc/minimal/include -isystem c:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include -isystem c:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include-fixed -fno-strict-aliasing -Os -imacros C:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs --sysroot=C:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.4.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -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=C:/ncs/RevelWear_Custom_Board/BMA456W_nRF52832_CB=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.4.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.4.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/common.c.obj -MF CMakeFiles\app.dir\src\common.c.obj.d -o CMakeFiles/app.dir/src/common.c.obj -c ../src/common.c
In file included from C:\ncs\v2.4.0\zephyr\include\zephyr\toolchain\gcc.h:92,
from C:\ncs\v2.4.0\zephyr\include\zephyr\toolchain.h:50,
from C:\ncs\v2.4.0\zephyr\lib\libc\minimal\include\stdio.h:12,
from c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:9:
C:\ncs\v2.4.0\zephyr\include\zephyr\device.h:84:41: error: '__device_dts_ord_DT_N_NODELABEL_BMA456_BUS_ORD' undeclared here (not in a function)
84 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\device.h:210:37: note: in expansion of macro 'DEVICE_NAME_GET'
210 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
| ^~~~~~~~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\device.h:227:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
227 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
| ^~~~~~~~~~~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\drivers\spi.h:409:24: note: in expansion of macro 'DEVICE_DT_GET'
409 | .bus = DEVICE_DT_GET(DT_BUS(node_id)), \
| ^~~~~~~~~~~~~
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:34:43: note: in expansion of macro 'SPI_DT_SPEC_GET'
34 | static const struct spi_dt_spec dev_spi = SPI_DT_SPEC_GET(SPI0_NODE, SPI_OP_MODE_MASTER, 0);
| ^~~~~~~~~~~~~~~
In file included from C:\ncs\v2.4.0\zephyr\include\zephyr\arch\arm\aarch32\arch.h:20,
from C:\ncs\v2.4.0\zephyr\include\zephyr\arch\cpu.h:19,
from C:\ncs\v2.4.0\zephyr\include\zephyr\kernel_includes.h:33,
from C:\ncs\v2.4.0\zephyr\include\zephyr\kernel.h:17,
from c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:13:
C:\ncs\v2.4.0\zephyr\include\zephyr\devicetree.h:192:36: error: 'DT_N_NODELABEL_BMA456_P_spi_max_frequency' undeclared here (not in a function)
192 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
| ^~~~~~~~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\devicetree.h:4051:29: note: in definition of macro 'DT_CAT3'
4051 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
| ^~
C:\ncs\v2.4.0\zephyr\include\zephyr\drivers\spi.h:347:30: note: in expansion of macro 'DT_PROP'
347 | .frequency = DT_PROP(node_id, spi_max_frequency), \
| ^~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\drivers\spi.h:410:27: note: in expansion of macro 'SPI_CONFIG_DT'
410 | .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
| ^~~~~~~~~~~~~
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:34:43: note: in expansion of macro 'SPI_DT_SPEC_GET'
34 | static const struct spi_dt_spec dev_spi = SPI_DT_SPEC_GET(SPI0_NODE, SPI_OP_MODE_MASTER, 0);
| ^~~~~~~~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\devicetree.h:192:29: note: in expansion of macro 'DT_CAT'
192 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
| ^~~~~~
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:33:19: note: in expansion of macro 'DT_NODELABEL'
33 | #define SPI0_NODE DT_NODELABEL(BMA456)
| ^~~~~~~~~~~~
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:34:59: note: in expansion of macro 'SPI0_NODE'
34 | static const struct spi_dt_spec dev_spi = SPI_DT_SPEC_GET(SPI0_NODE, SPI_OP_MODE_MASTER, 0);
| ^~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\devicetree.h:192:36: error: 'DT_N_NODELABEL_BMA456_P_duplex' undeclared here (not in a function); did you mean 'DT_N_NODELABEL_bma456'?
192 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
| ^~~~~~~~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\devicetree.h:4051:29: note: in definition of macro 'DT_CAT3'
4051 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
| ^~
C:\ncs\v2.4.0\zephyr\include\zephyr\drivers\spi.h:349:25: note: in expansion of macro 'DT_PROP'
349 | DT_PROP(node_id, duplex) | \
| ^~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\drivers\spi.h:410:27: note: in expansion of macro 'SPI_CONFIG_DT'
410 | .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
| ^~~~~~~~~~~~~
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:34:43: note: in expansion of macro 'SPI_DT_SPEC_GET'
34 | static const struct spi_dt_spec dev_spi = SPI_DT_SPEC_GET(SPI0_NODE, SPI_OP_MODE_MASTER, 0);
| ^~~~~~~~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\devicetree.h:192:29: note: in expansion of macro 'DT_CAT'
192 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
| ^~~~~~
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:33:19: note: in expansion of macro 'DT_NODELABEL'
33 | #define SPI0_NODE DT_NODELABEL(BMA456)
| ^~~~~~~~~~~~
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:34:59: note: in expansion of macro 'SPI0_NODE'
34 | static const struct spi_dt_spec dev_spi = SPI_DT_SPEC_GET(SPI0_NODE, SPI_OP_MODE_MASTER, 0);
| ^~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\devicetree.h:192:36: error: 'DT_N_NODELABEL_BMA456_P_frame_format' undeclared here (not in a function)
192 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
| ^~~~~~~~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\devicetree.h:4051:29: note: in definition of macro 'DT_CAT3'
4051 | #define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
| ^~
C:\ncs\v2.4.0\zephyr\include\zephyr\drivers\spi.h:350:25: note: in expansion of macro 'DT_PROP'
350 | DT_PROP(node_id, frame_format), \
| ^~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\drivers\spi.h:410:27: note: in expansion of macro 'SPI_CONFIG_DT'
410 | .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
| ^~~~~~~~~~~~~
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:34:43: note: in expansion of macro 'SPI_DT_SPEC_GET'
34 | static const struct spi_dt_spec dev_spi = SPI_DT_SPEC_GET(SPI0_NODE, SPI_OP_MODE_MASTER, 0);
| ^~~~~~~~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\devicetree.h:192:29: note: in expansion of macro 'DT_CAT'
192 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
| ^~~~~~
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:33:19: note: in expansion of macro 'DT_NODELABEL'
33 | #define SPI0_NODE DT_NODELABEL(BMA456)
| ^~~~~~~~~~~~
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:34:59: note: in expansion of macro 'SPI0_NODE'
34 | static const struct spi_dt_spec dev_spi = SPI_DT_SPEC_GET(SPI0_NODE, SPI_OP_MODE_MASTER, 0);
| ^~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\devicetree.h:192:36: error: 'DT_N_NODELABEL_BMA456_REG_IDX_0_VAL_ADDRESS' undeclared here (not in a function); did you mean 'DT_N_S_cpus_S_cpu_0_REG_IDX_0_VAL_ADDRESS'?
192 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
| ^~~~~~~~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\devicetree.h:4053:33: note: in definition of macro 'DT_CAT4'
4053 | #define DT_CAT4(a1, a2, a3, a4) a1 ## a2 ## a3 ## a4
| ^~
C:\ncs\v2.4.0\zephyr\include\zephyr\devicetree.h:2192:30: note: in expansion of macro 'DT_REG_ADDR_BY_IDX'
2192 | #define DT_REG_ADDR(node_id) DT_REG_ADDR_BY_IDX(node_id, 0)
| ^~~~~~~~~~~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\drivers\spi.h:351:26: note: in expansion of macro 'DT_REG_ADDR'
351 | .slave = DT_REG_ADDR(node_id), \
| ^~~~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\drivers\spi.h:410:27: note: in expansion of macro 'SPI_CONFIG_DT'
410 | .config = SPI_CONFIG_DT(node_id, operation_, delay_) \
| ^~~~~~~~~~~~~
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:34:43: note: in expansion of macro 'SPI_DT_SPEC_GET'
34 | static const struct spi_dt_spec dev_spi = SPI_DT_SPEC_GET(SPI0_NODE, SPI_OP_MODE_MASTER, 0);
| ^~~~~~~~~~~~~~~
C:\ncs\v2.4.0\zephyr\include\zephyr\devicetree.h:192:29: note: in expansion of macro 'DT_CAT'
192 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
| ^~~~~~
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:33:19: note: in expansion of macro 'DT_NODELABEL'
33 | #define SPI0_NODE DT_NODELABEL(BMA456)
| ^~~~~~~~~~~~
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:34:59: note: in expansion of macro 'SPI0_NODE'
34 | static const struct spi_dt_spec dev_spi = SPI_DT_SPEC_GET(SPI0_NODE, SPI_OP_MODE_MASTER, 0);
| ^~~~~~~~~
../src/common.c: In function 'bma4_spi_read':
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:82:11: warning: implicit declaration of function 'spi_transeive'; did you mean 'spi_transceive'? [-Wimplicit-function-declaration]
82 | rslt= spi_transeive(&dev_spi, reg_addr, reg_data);
| ^~~~~~~~~~~~~
| spi_transceive
../src/common.c: In function 'bma4_spi_write':
c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:88:34: warning: passing argument 2 of 'spi_write_dt' makes pointer from integer without a cast [-Wint-conversion]
88 | rslt= spi_write_dt(&dev_spi, *reg_data);
| ^~~~~~~~~
| |
| uint8_t {aka unsigned char}
In file included from c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\src\common.c:17:
C:\ncs\v2.4.0\zephyr\include\zephyr\drivers\spi.h:697:58: note: expected 'const struct spi_buf_set *' but argument is of type 'uint8_t' {aka 'unsigned char'}
697 | const struct spi_buf_set *tx_bufs)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
[17/225] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
[18/225] Building C object CMakeFiles/app.dir/src/bma4.c.obj
[19/225] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
[20/225] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
[21/225] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\31f4403e35\opt\bin\cmake.EXE' --build 'c:\ncs\RevelWear_Custom_Board\BMA456W_nRF52832_CB\build'

* The terminal process terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.

Parents Reply Children
Related