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

Configure ESB in SDK_config

  • I am using ses and trying to set the max payload length or enable debug mode in NRF_ESB.h. I could of course just change the values in the header file, but I prefer not changing the SDK directly.  It seems NRF_ESB.h never references sdk_config.h, which I assume would be the best place to define those constants. Is there another recommended approach? Most libraries it's not a problem since they include nrfx.h. The esb library only references nrf.h.
  • Hi,

    The esb_init() will setup the ESB to the default values (which are from the legacy nRF24L01 which was the first radio that supported ESB).

    Edit: I can see now that you may want to for instance change many of the parameters that are default in esb_init(), in that case I suggest to copy the defines you want to change from nrf_esb.h to main and modify them to your requirements, instead of modifying the nrf_esb.h.

    Best regards,
    Kenneth

  • Thanks Kenneth,

    While this solution does work, it is not ideal. 

    SES has an awesome feature which greys out code that is enabled or disabled based on preprocessor definitions.  When the definitions NRF_ESB_MAX_PAYLOAD_LENGTH or NRF_ESB_DEBUG are defined before any references to nrf_esb.h, the preprocessor logic in that header file does not recognize they have been defined and it is not clear to other developers reading my code that those constants might be defined and set in another location. Also there is no compile time way to  see what the value is, only runtime by adding a watch.

    If I could suggest fixing this issue on a future release of the SDK, it would be very helpful.

Related