Incorrect Model Publication Set response with code optimization

I'm using the Mesh SDK v5.0.0 (for the main Mesh code), the nRF5 SDK v17.1.0 (to facilitate normal BLE GATT connections as part of this device's core functionality), and developing in SEGGER Embedded Studio.

If I set the optimization level to anything above "Level 1" ("Level 2 for Speed", "Level 2 Balanced", "Level 2 for Size" or "Optimize for Size"), I'm getting an incorrect CONFIG_OPCODE_MODEL_PUBLICATION_STATUS (0x8019) response after sending a CONFIG_OPCODE_MODEL_PUBLICATION_SET (0x03) command.

Breakpointing in 'config_server.c' in the 'handle_config_model_publication_set()' function everything look like it parsed OK, but moving my breakpoint down the end of 'send_publication_status()' the values in model_handle and response.state.publish_period are incorrect, matching the bad response.

From that same breakpoint I can also inspect m_model_pool in 'access.c', and looking at the correct model index (not the incorrect model_handle value presented by the debugger in the breakpoint), I see that the underlying data (publication_state.period) is correct and matches the value in my SET command.

If I decrease the optimization to "Level 1" or "None", everything works as expected, and both breakpoints inspect exactly as expected.

In summary, it looks like the configuration model is setting the publication values for my model correctly, but not fetching the correct value in the response if code optimization is turned up. Any ideas on what might be going on, or what I could try to dig deeper?

Thanks!

Parents Reply Children
No Data
Related