AnsweredAssumed Answered

Issues with __ffs() function in util.c for ad9361 No-OS code

Question asked by rasingh on Sep 24, 2015
Latest reply on Sep 24, 2015 by DragosB

I've recently had issues with the __ffs() function defined in the the util.c file for the ad9631 No-OS linux driver code. It turns out that this function has the same name as a function in glibc that implements the same functionality. However the glibc version specifies the first bit that is set using 1-indexed notation instead of the 0-indexed notation of the __ffs() function in util.c as mentioned in here: This was causing issues where on occasion register writes to the chip were writing incorrect values because the glibc version would get called instead of the No-OS version. As a result, the chip would not initialize correctly. I was a little disappointed to find that I had spent a week debugging an issue that was reported over a year ago, so the function in util.c should be changed to avoid this for other developers.