Open microbit-carlos opened 11 months ago
Having a quick look with the debugger call stack, the hard fault handler is reached from:
Looks like this is replicable with gcc v10.3, but not with gcc v12.
And only when adding "DMESG_ENABLE": 1
to codal.json.
With the merge of PR 165 in codal-core we can now build without spurious compiler warnings on gcc 12 so the recommendation here is to move to this compiler, as the bug looks to be caused by incorect generation of the copy-on-return constructor when returning a ManagedBuffer under very specific circumstances (these, in fact!), and is rather beyond the remit of CODAL to fix.
I'm going to close this for now, but feel free to re-open if this needs to be discussed further.
If that's the case, can't we code the move constructor and workaround the gcc issue? MakeCode and CODAL users will still be using older GCC versions than v12, so if possible I think it'd be good to try to resolve this issue.
This programme erases the DAPLink storage in a separate fiber, while the main one updates the display with a bar graph using random numbers.
MICROBIT.hex.zip
Update: Replicable only when when adding "DMESG_ENABLE": 1 to codal.json, and with gcc v10.3 (gcc v12 works).
https://github.com/lancaster-university/codal-microbit-v2/issues/362#issuecomment-1669823809