Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problem exposing nrfx watchdog code.

Hi!  I was defining NRFX_WDT_ENABLED in sdk_config.h, but found that apply_old_config.h was undefining it.

Even though I had WDT_ENABLED defined to zero, the test in apply_old_config.h is for if it was defined AT ALL, not if it was defined to a non-zero value.

So, I undefined WDT_ENABLED and the issue resolved.

However, this isn't the behavior one would expect here, and the "#ifdef" needs to become just a "#if" I believe in apply_old_config.h

Thanks!

-Ben Burch

BTR Controls, Inc.

Elgin, IL, USA

Parents
  • This would also fail in the legacy case that apply_old_config.h was hoping to solve, as defining WDT_ENABLED prevents compilation of the new nrf wdt code

  • Ben,

    The actual purpose initially for the apply_old_config.h was to take the settings from sdk_config.h and make it work with the NRFX layer.

    defining anything in sdk_config.h should ideally overseed other defines that are underneath it. So defining _WDT_ENABLED to 0 in sdk_config.h file and defining NRFX_WDT_ENABLED to 1 is wrong.

    But this is not your mistake, I guess it is not clearly documented on how these integration of macros is happening.

    If you are intending to directly use nrfx_wdt then do not define the _WDT_ENABLED at all. I think that the check on WDT_ENABLED is correct, but it seems that the documentation on what was attempted to do here could be improved.

Reply
  • Ben,

    The actual purpose initially for the apply_old_config.h was to take the settings from sdk_config.h and make it work with the NRFX layer.

    defining anything in sdk_config.h should ideally overseed other defines that are underneath it. So defining _WDT_ENABLED to 0 in sdk_config.h file and defining NRFX_WDT_ENABLED to 1 is wrong.

    But this is not your mistake, I guess it is not clearly documented on how these integration of macros is happening.

    If you are intending to directly use nrfx_wdt then do not define the _WDT_ENABLED at all. I think that the check on WDT_ENABLED is correct, but it seems that the documentation on what was attempted to do here could be improved.

Children
Related