Quadrature Decoder Failing to build on NCS v2.1

Hello,

When enabling the Sensor system and having a qdec device enabled in my dts I get the following error:

/home/ee/ncs/zephyr/drivers/sensor/qdec_nrfx/qdec_nrfx.c:98:21: error: expression in static assertion is not constant
   98 |  BUILD_ASSERT(steps > 0, "only positive number valid");
      |               ~~~~~~^~~
/home/ee/ncs/zephyr/drivers/sensor/qdec_nrfx/qdec_nrfx.c:99:21: error: expression in static assertion is not constant
   99 |  BUILD_ASSERT(steps <= 2048, "overflow possible");
      |               ~~~~~~^~~~~~~

This seems to be a bug with the Zephyr code checking a const local var at compile time. Has anyone else had this issue?

Best,

Archie

Parents Reply
  • Hi Jørgen

    It seems to be an issue when enabling CPLUSPLUS. Could you add `CONFIG_CPLUSPLUS=y` to your proj.conf in your test up and see if it errors? 

    Edit: Actually it seems to be the `CONFIG_NO_OPTIMIZATIONS=y` option.

    Also, how do I report an issue with the DevZone website? I have noticed that the "Reply", "Verify Answer" and "More" buttons do not appear next to posts unless I interact with those buttons on a post a level above the one I want to interact with. I can provide a video if that helps. 


    Thanks,

    Archie

Children
No Data
Related