Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
4 years, 1 month ago.
I downloaded this code for IAR and have it running on an Nucleo F103RB board. It runs well, and I can receive packets to a Lora network (I am using a MultiConnect Conduit). However, sometimes the code freezes!
Debuggin on IAR, it seems that it is getting stuck on "static u2_t deltaticks( u4_t time )" on hal.c. It is getting the time from "u4_t hal_ticks( void )". The problem is that function is getting stuck with an incorrect time, so the time count never advances and the MCU is stuck on this function.
It seems that this happens because timer.read_us() is getting stuck on a value. Since this function is compiled I cannot see what is going inside...What I can only see is that the time returned just loops back, refusing to go over a certain value. Here are example values of succesive "timer.read_us()" calls when it gets stuck:
1.) 1669026 2.) 1673646 3.) 1692942 4.) 1635976 5.)1639285 ...
It seems as it loops back when trying to go over 1700000...
If I change variables in the debugger to continue with the program the program runs fine for a while, but eventually gets this problem again!