nRF5340 NCS v2.9.2: sysbuild NS application SPI pins have no output waveform

  • Goal: "I am trying to get SPI3 working with a custom MAX30003 driver in a sysbuild non-secure (_ns) application, based on the peripheral_uart example."

  • Problem: "The project compiles successfully. RTT logs show that device_is_ready() passes and my SPI read/write function is being called periodically and returns success. However, there is absolutely no waveform on the physical SCK or CS pins when checked with an oscilloscope."

  • What I've tried: "I have confirmed the pinctrl is correct in the overlay, &spi3 has status = "okay". My prj.conf has CONFIG_NRFX_SPIM3=y. My spm.conf has both CONFIG_SPM_NRF_P0_NS=y and CONFIG_SPM_NRF_SPIM3_NS=y."peripheral_uart.rar

Parents
  • Hi,

    And you are not getting any build or log errors from that? I thought CONFIG_SPM_NRF_P0_NS was a part of the old SPM that you needed to migrate away from, but I might be mistaken. Are you able to get it working from outside TFM? There are many parts that could be at fault here, so it is interesting to just consider one at the time.

    Regards,

    Elfving

  • I have sent you the project compression package. The RTT log shows:SEGGER J-Link V8.18 - Real time terminal output
    SEGGER J-Link (unknown) V1.0, SN=1050067593
    Process: JLink.exe
    [00:00:00.287,994] <inf> MAX30003: SPI bus spi@c000 is ready.
    [00:00:00.287,994] <inf> MAX30003: Starting MAX30003 chip initialization sequence...
    [00:00:00.388,549] <inf> MAX30003: MAX30003 driver initialized on max30003
    *** Booting My Application v2.9.2 - unknown commit ***
    *** Using nRF Connect SDK v2.9.2-4ab7b98fc76f ***
    *** Using Zephyr OS v3.7.99-aa34a5632971 ***
    [00:00:00.388,671] <inf> main: Minimal SPI Test Project Started on nRF5340
    [00:00:00.388,671] <inf> main: SUCCESS: MAX30003 device found and is ready!
    [00:00:00.388,793] <inf> main: MAX30003 Status Register = 0xFFFFFF
    [00:00:02.388,946] <inf> main: MAX30003 Status Register = 0xFFFFFF
    [00:00:04.389,160] <inf> main: MAX30003 Status Register = 0xFFFFFF
    [00:00:06.389,373] <inf> main: MAX30003 Status Register = 0xFFFFFF
    [00:00:08.389,587] <inf> main: MAX30003 Status Register = 0xFFFFFF
    [00:00:10.389,801] <inf> main: MAX30003 Status Register = 0x[00:03:04.408,355] <inf> main: MAX30003 Status Register = 0xFFFFFF
    [00:03:06.408,508] <inf> main: MAX30003 Status Register = 0xFFFFFF
    [00:03:08.408,660] <inf> main: MAX30003 Status Register = 0xFFFFFF
    [00:03:10.408,813] <inf> main: MAX30003 Status Register = 0xFFFFFF


    However, the oscilloscope does not have any SPI waveforms.

  • Thanks for waiting,

    So yeah, like I said earlier spm is deprecated. I see when building that it is seemingly not included in the build, which might also be why it doesn't catch that CONFIG_SPM_NRF_P0_NS is also outdated, as is anything starting with CONFIG_SPM_. Have a look here on how to run TFM instead. I agree that it looks a bit strange that it didn't give you any errors for this though, the function calls etc. does make it seem that things work as they should, and I am not immediately seeing where that problem is coming from. Did you recently upgrade this from NCS 1.9 or something?

    You also do not need to use NRFX for this, but if you did want to you would also need to set CONFIG_NRFX_SPIM3. I would rather use the zephyr drivers though. For more on SPI, see here.

    I would recommend getting it working on the normal app-core first before in the secure partition btw.

    Regards,

    Elfving

Reply
  • Thanks for waiting,

    So yeah, like I said earlier spm is deprecated. I see when building that it is seemingly not included in the build, which might also be why it doesn't catch that CONFIG_SPM_NRF_P0_NS is also outdated, as is anything starting with CONFIG_SPM_. Have a look here on how to run TFM instead. I agree that it looks a bit strange that it didn't give you any errors for this though, the function calls etc. does make it seem that things work as they should, and I am not immediately seeing where that problem is coming from. Did you recently upgrade this from NCS 1.9 or something?

    You also do not need to use NRFX for this, but if you did want to you would also need to set CONFIG_NRFX_SPIM3. I would rather use the zephyr drivers though. For more on SPI, see here.

    I would recommend getting it working on the normal app-core first before in the secure partition btw.

    Regards,

    Elfving

Children
No Data
Related