Skip to content

Conversation

@nraynaud
Copy link
Contributor

@nraynaud nraynaud commented Nov 1, 2025

there was a bug in the pointer arithmetics.

Description

calling the scan function would crash

I (27179) ESP_NCP_FRAME: 00 00 08 00 03 05 00 00 f8 ff 07 01 24 e4
I (27179) ESP_NCP_ZB: scan channel mask: 7fff800
I (27179) ESP_NCP_ZB: scan duration: 1
Guru Meditation Error: Core  0 panic'ed (Store access fault). Exception was unhandled.

Testing

I'd be curioous to know how YOU tested the feature in the first place.

when I do a scan now it doesn't crash, doesn't reboot and send a notification on the link.

I (20700) ESP_NCP_FRAME: 00 00 08 00 03 05 00 00 f8 ff 07 01 24 e4
I (20700) ESP_NCP_ZB: scan channel mask: 7fff800
I (20700) ESP_NCP_ZB: scan duration: 1
I (21510) ESP_NCP_FRAME: sending notif: 09

Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

there was a bug in the pointer arithmetics.
@github-actions github-actions bot changed the title fix network scanning report fix network scanning report (TZ-2115) Nov 1, 2025
the notification frame also had an incorrect layout
lhespress

This comment was marked as duplicate.


if (nwk_descriptor && count) {
memcpy(scan_data + sizeof(esp_ncp_zb_scan_parameters_t), nwk_descriptor, (count * sizeof(esp_zb_network_descriptor_t)));
memcpy(scan_data + 1, nwk_descriptor, (count * sizeof(esp_zb_network_descriptor_t)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memcpy((uint8_t *)scan_data + sizeof(esp_ncp_zb_scan_parameters_t), nwk_descriptor, (count * sizeof(esp_zb_network_descriptor_t))); is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as you don't mess the base pointer, do what you want. I personally would never remember the precedence of the casting vs addition but I'm not an expert.

@lhespress
Copy link
Contributor

lhespress commented Nov 21, 2025

@nraynaud You can git apply this host_scan.zip patch and run host example test the function.

@nraynaud
Copy link
Contributor Author

Sorry, I don't have a running test platform anymore, I moved to using Spinel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants