EVB1000 boards are behaving differently with different optimization levels in Atollic TrueStudio

Hi,
I have EVK1000 kit. The DEMO images from factory worked fine and we were able to get exact distance on the LCD display of the board.

I have downloaded the source code and bin file form DECAWAVE site and built using Atollic IDE. I have integrated ST Link utility as well into Atollic.

Problem arises when I try to flash the SW built using source code to verify the behavior as I need to do some modification on source code to setup debug environment.

EVB1000 boards are behaving differently with each type of the Optimization Level form compilation settings and the SW with None of the options are working as expected to get the distance information on the LCD screen. Below are the different scenario’s.

Scenario 1::
Flash details: TAG (DecaRangingARMMP_CubeMX_3p11.bin from Decawave) & ANCHOR ( Built EVK1000_CubeMX.hex from source code for CubeMX3.11 version with OL: Optimization most(-O3) )
Result: TAG --> Stuck in Ranging with 113079C32208971F ANCHOR-- > Distance information is blank and while debugging range_distance is optimized out

Scenario 2::
Flash details: TAG (DecaRangingARMMP_CubeMX_3p11.bin from Decawave) & ANCHOR ( Built EVK1000_CubeMX.hex from source code for CubeMX3.11 version with OL: Optimization for debugging(-Og) )
Result: TAG --> Stuck in Ranging with 113079C32208971F ANCHOR-- > Distance information is blank but while debugging range_distance is showing correct distance value (range_result double 0.12778678818922778 )

Scenario 3::
Flash details: TAG (DecaRangingARMMP_CubeMX_3p11.bin from Decawave) & ANCHOR ( Built EVK1000_CubeMX.hex from source code for CubeMX3.11 version with OL: Optimization None(-O0) )
Result: TAG --> Stuck in Ranging with 113079C32208971F ANCHOR-- > Stuck @ AWAITING POLL as anchor is not able to enter new range loop in code.

Any help can be appreciated. Thanks in advance.

Hi,
There is obviously an issue with you compiling the SW and /or the modifications you have made.
I suggest you start from the basics (snd /rec) by using our example code.
Eg examples 5a/5b or 6a/6b. These are basic examples for two way ranging and can be flashed onto your boards (after compiling)

You could maybe also connect PC Decaranging to one of the boards and check what is send by the TAG. See EVK and PC Decaranging user manual.