TAMPC on the nRF54L15-DK

Is it possible to use at least one channel of the TAMPC in a Zephyr application on the nRF54L15-DK? It appears that the channel 0 pins (p1.4 and p1.5) are used by the UART on the DK. According to the tables on the back of the DK board, p1.11 and p1.12 aren't connected to anything. Can those be used for channel 3 of the TAMPC? If so, how do I go about using them to test the PRBS tamper detection? I can compile this code for channel 0, but if I change the reference to channel 3 it doesn't compile.

int tampc_active_shield_init(tampc_callback_t callback)
{
    user_callback = callback;

    /* Clear any pending events */
    nrf_tampc_event_clear(NRF_TAMPC, NRF_TAMPC_EVENT_TAMPER);
#if NRF_TAMPC_HAS_EVENT_WRITE_ERROR
    nrf_tampc_event_clear(NRF_TAMPC, NRF_TAMPC_EVENT_WRITE_ERROR);
#endif

    /* Enable active shield channel 3 */
#if NRF_TAMPC_HAS_ACTIVE_SHIELD_CHANNELS
    nrf_tampc_activeshield_channel_enable(NRF_TAMPC, NRF_TAMPC_ACTIVESHIELD_CHANNEL_3_MASK);
    printk("Active shield channel 3 enabled\n");
#else
    printk("Active shield channels not available on this device\n");
    return -ENOTSUP;
#endif

    /* Enable TAMPER interrupt */
    nrf_tampc_int_enable(NRF_TAMPC, NRF_TAMPC_INT_TAMPER_MASK);

    /* Connect and enable IRQ - TAMPC_IRQn is 220 on nRF54L15 */
    IRQ_CONNECT(TAMPC_IRQn, 1, tampc_irq_handler, NULL, 0);
    irq_enable(TAMPC_IRQn);

    printk("TAMPC initialized, IRQn=%d\n", TAMPC_IRQn);
    printk("INTENSET=0x%08x\n", nrf_tampc_int_enable_check(NRF_TAMPC, NRF_TAMPC_ALL_INTS_MASK));

    return 0;
}

Overlay for configuring p1.11 and p1.12:
/&peripheral_domain {
    tamper0: tampc@5003a000 {
        compatible = "nordic,nrf54l15-tampc";
        reg = <0x5003A000 0x1000>;
        channel-count = <4>;

        /* ASO3 = P1.11, ASI3 = P1.12 */
        aso-pins = <&gpio1 11 GPIO_ACTIVE_HIGH>;
        asi-pins = <&gpio1 12 GPIO_ACTIVE_HIGH>;
    };
};

  • Executing task: nRF Connect: Build [pristine]: beacon1/build 
    
    Building beacon1
    west build --build-dir c:/Users/12162/beacon1/build c:/Users/12162/beacon1 --pristine --board nrf54l15dk/nrf54l15/cpuapp -- -DDEBUG_THREAD_INFO=On -DCONFIG_DEBUG_THREAD_INFO=y -Dbeacon1_DEBUG_THREAD_INFO=On
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: C:/ncs/toolchains/66cdf9b75e/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v3.2.1/zephyr/.cache
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf54l15dk, qualifiers: nrf54l15/cpuapp
    Parsing C:/ncs/v3.2.1/zephyr/share/sysbuild/Kconfig
    Loaded configuration 'C:/Users/12162/beacon1/build/_sysbuild/empty.conf'
    Merged configuration 'C:/Users/12162/beacon1/build/_sysbuild/empty.conf'
    Configuration saved to 'C:/Users/12162/beacon1/build/zephyr/.config'
    Kconfig header saved to 'C:/Users/12162/beacon1/build/_sysbuild/autoconf.h'
    --
       *****************************
       * Running CMake for beacon1 *
       *****************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/Users/12162/beacon1
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/66cdf9b75e/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v3.2.1/zephyr/.cache
    -- Zephyr version: 4.2.99 (C:/ncs/v3.2.1/zephyr)
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf54l15dk, qualifiers: nrf54l15/cpuapp
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/66cdf9b75e/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/66cdf9b75e/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/66cdf9b75e/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v3.2.1/zephyr/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts
    -- Found devicetree overlay: C:/Users/12162/beacon1/boards/nrf54l15dk_nrf54l15_cpuapp.overlay
    -- Generated zephyr.dts: C:/Users/12162/beacon1/build/beacon1/zephyr/zephyr.dts
    -- Generated pickled edt: C:/Users/12162/beacon1/build/beacon1/zephyr/edt.pickle
    -- Generated devicetree_generated.h: C:/Users/12162/beacon1/build/beacon1/zephyr/include/generated/zephyr/devicetree_generated.h
    
    warning: The choice symbol MBEDTLS_BUILTIN (defined at
    C:/ncs/v3.2.1/zephyr/modules/mbedtls/Kconfig:30, modules\mbedtls\Kconfig:30) was selected (set =y),
    but no symbol ended up as the choice selection. See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MBEDTLS_BUILTIN and/or look up
    MBEDTLS_BUILTIN in the menuconfig/guiconfig interface. The Application Development Primer, Setting
    Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
    too.
    
    
    Parsing C:/ncs/v3.2.1/zephyr/Kconfig
    C:/Users/12162/beacon1/prj.conf:63: warning: attempt to assign the value 'y' to the undefined symbol TAMPCLoaded configuration 'C:/ncs/v3.2.1/zephyr/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp
    _defconfig'
    Merged configuration 'C:/Users/12162/beacon1/prj.conf'
    Merged configuration 'C:/Users/12162/beacon1/build/beacon1/zephyr/misc/generated/extra_kconfig_options.conf'
    
    Merged configuration 'C:/Users/12162/beacon1/build/beacon1/zephyr/.config.sysbuild'
    
    error: Aborting due to Kconfig warnings
    
    CMake Error at C:/ncs/v3.2.1/zephyr/cmake/modules/kconfig.cmake:387 (message):
      command failed with return code: 1
    Call Stack (most recent call first):
      C:/ncs/v3.2.1/nrf/cmake/modules/kconfig.cmake:112 (include)
      C:/ncs/v3.2.1/zephyr/cmake/modules/zephyr_default.cmake:131 (include)
      C:/ncs/v3.2.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/ncs/v3.2.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:4 (find_package)
    
    -- Configuring incomplete, errors occurred!
    
    CMake Error at cmake/modules/sysbuild_extensions.cmake:530 (message):
      CMake configure failed for Zephyr project: beacon1
    
      Location: C:/Users/12162/beacon1
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:43 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:21 (include)
      C:/ncs/v3.2.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      C:/ncs/v3.2.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      C:/ncs/v3.2.1/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/Users/12162/beacon1/build/CMakeFiles/CMakeOutput.log".
    ?[91mFATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\66cdf9b75e\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/66cdf9b75e/opt/bin/python.exe '-Bc:\Users\12162\beacon1\build' -GNinja
    -DBOARD=nrf54l15dk/nrf54l15/cpuapp -DDEBUG_THREAD_INFO=On -DCONFIG_DEBUG_THREAD_INFO=y -Dbeacon1_DEBUG_THREAD_INFO=On '-SC:\ncs\v3.2.1\zephyr\share\sysbuild' '-DAPP_DIR:PATH=c:\Users\12162\beacon1
    

  • Sorry for the late reply.  

    Currently, using DTS or Kconfig in this way is not supported for TAMPC, so it must be done through direct register writes and by working with the MDK.

    We found an issue where Channel 3 is not resolved correctly in nrf_tampc.h. Specifically, NRF_TAMPC_ACTIVESHIELD_CHANNEL_COUNT is not being resolved as expected. This is caused by incorrect symbols being used in the following conditional statements:

    Following symbols defined by MDK in nrf54l15_types.h should be used instead:

    • TAMPC_ACTIVESHIELD_CHEN_CH3_Msk

    • TAMPC_ACTIVESHIELD_CHEN_CH2_Msk

    • TAMPC_ACTIVESHIELD_CHEN_CH1_Msk

    As a temporary software workaround, you can either:

    1. Manually correct the definition in nrf_tampc.h, or

    2. Avoid using the nrf_tampc_activeshield_mask_t enumerators and instead use the MDK symbols directly (e.g., TAMPC_ACTIVESHIELD_CHEN_CHxxx_Msk).

Related