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

Not able to Initialize HIght Speed SPI in nRF Connect SDK v1.5.1

Hello,

I am using nRF5340DK board and I am trying to enable high-speed SPI pins in nrf5340dk_nrf5340_cpuapp.dts

&spi4 {
compatible = "nordic,nrf-spim";
status = "okay";
sck-pin = <8>;
miso-pin = <9>;
mosi-pin = <10>;
};

And enabled configuration in prj.conf :

CONFIG_SPI=y
CONFIG_SPI_4=y

Also added SPI in nrf5340dk_nrf5340_cpuapp.yaml 

identifier: nrf5340dk_nrf5340_cpuapp
name: NRF5340-DK-NRF5340-application-MCU
type: mcu
arch: arm
toolchain:
- gnuarmemb
- xtools
- zephyr
ram: 64
flash: 256
supported:
- gpio
- i2c
- spi
- pwm
- watchdog
- usb_cdc
- usb_device

Once I flash the board, immediately after power ON, DK board is resetting contineously. By connecting SEGGER IDE, I found following error

[00:00:00.405,059] [0m<inf> cp_central: >>>>>>>>>>> In cp ap main[0m
[00:00:03.889,007] [1;31m<err> os: ***** BUS FAULT *****[0m
[00:00:03.889,007] [1;31m<err> os: Precise data bus error[0m
[00:00:03.889,038] [1;31m<err> os: BFAR Address: 0x0[0m
[00:00:03.889,038] [1;31m<err> os: r0/a1: 0x200012f0 r1/a2: 0x00000000 r2/a3: 0x00000000[0m
[00:00:03.889,038] [1;31m<err> os: r3/a4: 0x00000000 r12/ip: 0x000033e4 r14/lr: 0x00018225[0m
[00:00:03.889,038] [1;31m<err> os: xpsr: 0x69000225[0m
[00:00:03.889,038] [1;31m<err> os: Faulting instruction address (r15/pc): 0x00017d98[0m
[00:00:03.889,068] [1;31m<err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0[0m
[00:00:03.889,068] [1;31m<err> os: Fault during interrupt handling
[0m
[00:00:03.889,068] [1;31m<err> os: Current thread: 0x200013a0 (unknown)[0m
[00:00:04.179,931] [1;31m<err> fatal_error: Resetting system

I need help to configure SPI pins (8- SCK,10-MOSI) and how to use them in firmware. It will be helpful if I get any examples. For now, I want SPI freq @1MHz.

Note: If I use other pins then there is no crash. 

Parents Reply Children
Related