PPI Trace example not building

I am trying to use PPI / GPIO to measure the 32 kHz clock accuracy for crystal tuning as described in this ticket:  RE: verifying 32kHz crystal accuracy

However, the solution points to an example project (https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/debug/ppi_trace/README.html) that will not build for me. I'm using SDK 2.6.0.

Here are some of the errors I get:

.../nrf/subsys/debug/ppi_trace/ppi_trace.c: In function 'get_gpiote':
.../nrf/subsys/debug/ppi_trace/ppi_trace.c:56:22: error: unknown type name 'nrfx_gpiote_t'

and

.../nrf/subsys/debug/ppi_trace/ppi_trace.c:129:13: error: too many arguments to function 'nrfx_gpiote_channel_alloc'
  129 |         if (nrfx_gpiote_channel_alloc(gpiote, &channel) != NRFX_SUCCESS) {
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
.../modules/hal/nordic/nrfx/drivers/include/nrfx_gpiote.h:185:12: note: declared here
  185 | nrfx_err_t nrfx_gpiote_channel_alloc(uint8_t * p_channel);

Thank you!

  • Hello,

    The build errors indicate that your SDK installation includes an outdated version of the nRFX drivers for some reason. The nrfx_gpiote_t struct and the additional input parameter for nrfx_gpiote_channel_alloc() were introduced in nrfx version 3.2.0. SDK v2.6.0 should include version 3.3.0 of the nrfx repo.

    To ensure all of the repositories are aligned with the SDK version you are using, please follow these steps:

    1. In VS Code, press Ctrl+Shift+P to bring up the command palette. Then type 'nRF Connect: Open Toolchain Terminal profile' and press Enter to open the terminal. This terminal includes the toolchain executables such as 'west' in the PATH.

    2. The terminal will usually open up in the SDK directory (e.g. c:\ncs\v2.6.0). If not, use 'cd' to change directory to your SDK root folder.

    3. Run west update to update all repositories to the revision specified in the west manifest files. In the output of west update, you should see a line indicating that nordic_hal has been updated to 5470822

    $ west update
    
    ...
    === updating hal_nordic (modules/hal/nordic):
    HEAD is now at 5470822 nrfx: Fix compilation failures in nrfx_gppi_dppi_ppib.c
    
    
    ...

    Best regards,

    Vidar

  • I'm still only getting this when I run `west update`

    === updating hal_nordic (modules/hal/nordic):
    HEAD is now at 97847314 nrfx_qspi: Correct use of workaround for anomaly 215 and 43 in nrfx_qspi

    I'm guessing this is because I had to fork both zephyr (for a custom FCB implementation) and the main SDK (for that QSPI flash Kconfig line I had to comment out that you helped me with). I thought I had properly rebased those changes on top of the 2.6.0 release, but maybe I need to revisit that (unless 2.6.1 has that QSPI thing fixed, then I could just go back to the official release).

  • I forgot that you were using your own fork of Zephyr - thanks for reminding me. The problem is that the west manifest in your fork is pulling in an outdated revision of the 'hal_nordic' repository. SDK v2.6.1 uses the following revision: https://github.com/nrfconnect/sdk-zephyr/blob/3758bcbfa5cd749d977e2600b6687104b8948243/west.yml#L186 which also includes the "nrfx_qspi: Correct use of workaround for anomaly 215 and 43 in nrfx_qspi" commit. 

    v2.6.1 is also including this fix for QSPI:

  • I see what happened now. I misread the zephyr sdk tag for 2.6.0 when I was upgrading my NCS fork, so it was still on the 2.5.2 base tag. Moved my FCB to a new branch from the correct tag and now the manifest is properly updated and my project still builds. I should be able to get PPI working from here. I'll mark this as closed once I confirm. Thanks for pointing me in the right direction!

Related