Hi,
It seems dwt_getframelength() call corrupts stack memory, and results overwriting other local variables memories. We discussed it in the link.
I’ve been heard that new library shall be open source code that is used to be, and give more flexibilities to compilers have it optimised with whatever settings are enabled/disabled (-O1, -O2). Is this new library available already, or do you have a release/expected date? I’ve tested 6.0.14 (binary base) but this issue remains.
I have no issues with lib, because I am using the ioctl() approach above. The “dwt_xxx()” are wrappers on top of ioctl() and looks like some have issues, as you have pointed out.