DPPI_PRESENT functions in modules/hal/nordic/nrfx/hal/nrf_gpiote.h questions.

Hi, I have two concerns about the functions nrf_gpiote_subscribe_set, nrf_gpiote_subscribe_clear, nrf_gpiote_publish_set, and nrf_gpiote_publish_clear. The expression

 *((volatile uint32_t *) ((uint8_t *) p_reg + (uint32_t) event + 0x80uL))

Given pointer arithmetic, the 0x80uL is the same as numerically adding 0x200 to the other terms. However, the Product Spec shows an offset of 0x180, rather than 0x200. I am confused therefore why the number in the code is not 0x60uL. Am I missing something?

Also, I want to put together some code that will publish an event from a gpiote pin changing state, to be subscribed by a timer. In addition to my concern about the functions' correctness, I have not seen any examples of them being used in the SDK. I don't know if that means I am on the wrong track, or that this is something that has not been done frequently.

Thanks for help.

Regards,

Burt Silverman

  • Hi Burt,

     

    Glad to hear that the porting is going along nicely. Let me know if you run into any issues or have any problems. I wish you a wonderful weekend!

     

    Kind regards,

    Håkon

  • Hakon,

    I would like to have a very good hint for how to enable nrfx logging. It seems like I can add

    #undef NRFX_MODULE_CONFIG_LOG_LEVEL
    #define NRFX_MODULE_CONFIG_LOG_LEVEL 4

    to zephyr/modules/hal_nordic/nrfx/nrfx_log.h and CONFIG_LOG=y to my prj.conf. But there are lots of AI hallucinations when I google search and then I come up with things such as 

    Enable nrfx Specific Logging.
    To enable logging for specific nrfx drivers, you will need to add corresponding Kconfig options to your prj.conf file. The exact option depends on the nrfx driver you wish to log. For example, to enable debug logging for the nrfx_uart driver, you would add:
    Code
        CONFIG_NRFX_UART_LOG_LEVEL_DBG=y
    Replace UART with the relevant peripheral (e.g., SPI, I2C, GPIO) to enable logging for other nrfx drivers. You can also set a lower log level if desired (e.g., INFO, WARN, ERR).
    That does not allow me to build. I would like to know the whole story and I will add that to my notebook/cheat sheets for future reference. 
    Thanks,
    Burt
  • Hi,

     

    The symbols for the nrfx driver log is declared here:

    https://github.com/nrfconnect/sdk-zephyr/blob/main/modules/hal_nordic/nrfx/Kconfig.logging#L143-L145

     

    It uses the same pattern, ie. CONFIG_NRFX_($PERIPH)_LOG.

     

    Please note that this is the nrfx driver, and not the zephyr shim for the serial driver.

     

    Kind regards,

    Håkon

  • Hi Hakon,

    I got sidetracked--I wanted to ask a related question or two about logging.

    Based on your explanation, I see that I can add config lines such as

    CONFIG_NRFX_GPIOTE_LOG=y
    CONFIG_NRFX_TIMER_LOG=y

    etc, to my prj.conf. I would like to know the recommended way to change individual log levels. I see one easy way is to modify, for example,

    #define NRFX_GPIOTE_CONFIG_LOG_LEVEL 3 //change to desired level, whatever that is

    in modules/hal/nordic/nrfx/templates/nrfx_config_nrf91.h, in my situation (nrf9160).

    I can also add that statement to the beginning of drivers/src/nrfx_gpiote.c.

    So I have plenty of choices, but is there any way that "a more sophisticated developer" would use!

    Thanks, Hakon. Meanwhile, I am having much success with the driver code.

    Burt

  • Hi Burt,

     

    The defines are guarded with a #ifndef in nrfx_config.h, so we can use the compiler preprocessor definition to override:

    CONFIG_COMPILER_OPT="-DNRFX_GPIOTE_CONFIG_LOG_LEVEL=4"

     

    Kind regards,

    Håkon

Related