Problem retrieving diagnostic data

I discovered a very strange thing.
I put the control lines

         while (!((status_reg = dwt_read32bitreg(SYS_STATUS_ID)) & (SYS_STATUS_RXFCG | SYS_STATUS_ALL_RX_ERR)))

                { };

after the: dwt_rxenable(DWT_START_RX_IMMEDIATE) ; // turn RX on, without delay

And the code stucks in that while cycle!
It’s as my firmware doesn’t update the registers correctly, but it is the default code by Decawave!
I can’t think that the original code was incorrect…