I've found a bug in the C2000 compiler version TMS320C2000 v21.6.0.LTS.
In the C programming language, if you want to initialise a static array to all zeroes, you must do:
static int monkey[5u] = { 0 };
In the C++ programming language, you don't need that 0 in there -- you can just do:
static int monkey[5u] = {};
The C2000 compiler requires the former syntax even though it's a C++ compiler. If you use the latter syntax, the array does not get initialised to all zeroes.
I spent a few hours this morning debugging code wondering why it was malfunctioning, until I discovered that the array wasn't zero-initialised.