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

NRF52840 SPIM3 SCK not Pluse

SCK:P014

MOSI:P016

MISO:P015

CS:P017(SOFT)

nrf_gpio_cfg(SCK, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
nrf_gpio_cfg(MOSI, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
nrf_gpio_cfg(CS, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);


The SCK pin cannot generate the correct pulse, and it is necessary to use JLINK for soft reset。

Power on reset and software reset are invalid。

The MCU must be connected with JLINK (it will send a reset automatically) to output pulse normally, no matter whether the frequency of SCK is 125k or 32m。

May I ask why there is such a problem? Is there a bug in spim3 itself?

Parents
  • I've got the same issue on my custom HW board. Tested on both SPI2 and SPI3 with exactly the same GPIO and SPI configuration (SCK=P0.19, MOSI=P0.06, MISO=P0.07, CS=P0.08) @ 1MHz with soft CS. NRFX_SPIM2_ENABLED and NRFX_SPIM3_ENABLED are both set to 1 in the sdk_config.h file. SCK and MOSI are both H0H1.

    No issues with the SPI2 bus but after I switch to the SPI3 literally by just replacing NRFX_SPIM_INSTANCE(2) with NRFX_SPIM_INSTANCE(3) the uC stops generating signals on the SCK/MOSI lines.

    Strangely enough, if the CLI via UART0 is enabled the SPIM3 works fine.

Reply
  • I've got the same issue on my custom HW board. Tested on both SPI2 and SPI3 with exactly the same GPIO and SPI configuration (SCK=P0.19, MOSI=P0.06, MISO=P0.07, CS=P0.08) @ 1MHz with soft CS. NRFX_SPIM2_ENABLED and NRFX_SPIM3_ENABLED are both set to 1 in the sdk_config.h file. SCK and MOSI are both H0H1.

    No issues with the SPI2 bus but after I switch to the SPI3 literally by just replacing NRFX_SPIM_INSTANCE(2) with NRFX_SPIM_INSTANCE(3) the uC stops generating signals on the SCK/MOSI lines.

    Strangely enough, if the CLI via UART0 is enabled the SPIM3 works fine.

Children
Related