This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Is there a sample code for nRF52 SPI master without Soft device ?

I am trying to develop a simple SPI master for a custom nRF52832 uC, but I can't find anny sort of sample codes that don't use Soft devices for this task. I need the code to be simple, so no need for SD based codes. Is it possible or is the nordic SPI driver only usable through SD ?

Parents Reply Children
  • I am unable to create a project from scratch with the spi drivers and the necessary files. I tried to create a new project and added the nrf_drv_spi driver and all the associated driver and config files to the project run-time environment, but I still got those errors for just compiling

    Rebuild target 'Target 1' compiling main.c... assembling arm_startup_nrf52.s... compiling system_nrf52.c... compiling nrf_drv_common.c... compiling nrf_delay.c... C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.0.0-Beta4\CMSIS\Include\core_cm4.h(86): warning: #47-D: incompatible redefinition of macro "__WEAK" (declared at line 47 of "C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.6.1\Device\Include\compiler_abstraction.h") #define __WEAK attribute((weak)) C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\4.0.0-2.alpha\delay\nrf_delay.c: 1 warning, 0 errors compiling nrf_drv_spi.c... C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\4.0.0-2.alpha\spi_master\nrf_drv_spi.c(56): error: #35: #error directive: "Wrong configuration." #error "Wrong configuration." C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\4.0.0-2.alpha\spi_master\nrf_drv_spi.c: 0 warnings, 1 error compiling app_error.c... RTE\nRF_Libraries\nRF52832_xxAA\app_error.c(53): error: #29: expected an expression .line_num = line_num, RTE\nRF_Libraries\nRF52832_xxAA\app_error.c(54): error: #29: expected an expression .p_file_name = p_file_name, RTE\nRF_Libraries\nRF52832_xxAA\app_error.c(55): error: #29: expected an expression .err_code = error_code, RTE\nRF_Libraries\nRF52832_xxAA\app_error.c(67): error: #29: expected an expression .line_num = 0, RTE\nRF_Libraries\nRF52832_xxAA\app_error.c(68): error: #29: expected an expression .p_file_name = NULL, RTE\nRF_Libraries\nRF52832_xxAA\app_error.c(69): error: #29: expected an expression .err_code = error_code, RTE\nRF_Libraries\nRF52832_xxAA\app_error.c: 0 warnings, 6 errors compiling nrf_assert.c... ".\Objects\trial_3.axf" - 7 Error(s), 1 Warning(s). Target not created.

  • Hello Martrin,

    I tried to initialize and send packets using the SPIM0 peripheral using the nrf_spi & the nrf_spim0 environment config files and following the specification described in the product specification online, but with all my efforts I am unable to disable the other peripherals shared with the SPIM0 like the TWIM0, SPIS0 ... etc

    How can I disable the other shared peripherals ? I tried setting their enable to 0 but that didn't work

  • hi mhaggag

    I seem to came across the same problem you did. And did you figure it out? How to solve the "wrong configuration"error?

  • Hi,

    I think you are better off creating a new thread on this one. Please describe your problem in detail and tell us what SDK you are using. This thread is 2 years old and there are ~5 generations of SDKs released since then. 

Related