Hi,
I have a C++ array or structure initialization issue that only occurs on nRF9160, but not other devices.
I am looking at the possibility of using JEDI in our IoT devices. On other devices, it runs without issues. On nRF9160, I used the mqtt_simple example as a starting point and wrote some test code to exercise JEDI features. Right at the beginning, it does not produce the expected results. I spent a few days tracking it down and eventually discovered at least one of the problem is about C++ array of structure initializations.
I have a 4-level nested structure. Each level is actually the same 48 bytes wrapped in the structure next level up. The issue is when the structure is initialized and declared as a scalar value, it is correctly initialized with the provided values. However, when it is declared as a single element array, all 48 bytes become zeros, as shown below.
Has anyone experienced similar issues? What am I missing? What compiler flags, options, etc could lead to such a problem? Appreciate any comments and help.
The test project is attached below.
Device: nRF9160-DK
nRF Connect 3.6.1
nRF Connect SDK v1.7.1