2100.app_event_manager_issue.zip
Hello,
I hope you are having a nice day. I recently updated from ncs v1.6.1 to v2.2.0. My application is based on the "Application Event Manager" module. I have found that section placement of the event subscribers is being sorted alphabetically by the linker. This has the side effect of potentially having subscriber sections interspersed if there happens to be overlap in the event names. For example, say an application has two events ("event_rx", and "event_rx_error"). The zephyr.map will be generated with sections in the following order:
event_subscribers_event_rx_a
event_subscribers_event_rx_error_a --------------------> WHOOPS!
event_subscribers_event_rx_error_p10
event_subscribers_event_rx_error_z
event_subscribers_event_rx_p10
event_subscribers_event_rx_z
As noted, these sections are listed alphabetically, but the Application Event Manager logic does not handle interspersed subscriber sections.
I have attached an example using the application event manager reference example. In the example, I changed the "control_event" to "measurement_event_control_event". I added a text file containing how the zephyr.map file ends up not laid out properly. In the reference material, nordic (by convention) ends their events with "_event". Following this practice can mitigate the section placement issue to a degree, but if the name of one event overlaps with the name of another event, this section placement issue can still occur.
Is there a way to explicitly eliminate this section placement issue?
(aside from manually enforcing naming convention rules)
Additionally, I noticed on ncs v2.2.0 while debugging event listeners (an activity which blocks the system work queue) zephyr timer callbacks (in my case running every 10ms) that create events will hit event allocation failure. Is this mitigatable, perhaps by instead using delayed work items instead of timer callbacks? What is best practice here?
Thank you very much for your time!