[xtimer] [cc2650] Use of xtimer on top of driver causes havoc

Hi everyone,

I’m currently working on fixing the buggy timer of the CC2650. The driver I rewrote seems to be working fine when used on its own: I’m able to set a period for the timer and to generate interrupts without the CPU freezing at all.

Although I’ve setup the timer to be 16-bit@1MhZ (using a 48MhZ clock with a prescaler of 48), everything goes to hell whenever I try to use x-timer on top of my driver. One of the major issue seems to come from the prescaler value.

For example in xtimer_drift, the CPU freezes immediately with 16-bit@(48MhZ / 48)

2016-07-20 15:08:24,522 - INFO # ======================= 2016-07-20 15:08:24,524 - INFO # ===== Test begins ===== 2016-07-20 15:08:24,526 - INFO # ======================= 2016-07-20 15:08:24,528 - INFO # Starting thread 3 2016-07-20 15:08:24,530 - INFO # sending 1st msg 2016-07-20 15:08:24,612 - INFO # sending 2nd msg 2016-07-20 15:08:24,614 - INFO # Starting thread 4 2016-07-20 15:08:24,615 - INFO # sending 3rd msg 2016-07-20 15:08:24,698 - INFO # sending 4th msg

FREEZE

However with any prescaler value above 63 the test doesn’t get stuck and the time is running, albeit much faster that it should.

Does anyone have an idea regarding the origin of this behavior? Is there something more that I need to setup in xtimer?

Best,

Florent