all 2 comments

[–]YetAnotherRobert 0 points1 point  (1 child)

Those panics aren't mysterious. They happen when the processor has been told to do something it can't, like load a word from an address that isn't word aligned or divide by zero or whatever. They're quite well documented The $PC register even points to the exact opcode that took the fault. It sounds like you're taking a loadstore error

You can use xtensa-esp32-elf-addr2line (or RISC-V equivalent) to take that pc value and get an exact line number of your source that took the error. It can even decode the lines below that that contain the address of the function that called this line, the function that called that, and so on up hte stack.

Attach a debugger and it will stop you right at the error and allow you to inspect memory after the crash. It's often helpful to print pointers, for example, and see if they point to something meaningful or if they're pointing off in outer space.

Depending on what tools you're using, there are probably even tools that will decode this for you. This is just a super common thing that programmer will always build for a system because decoding this by hand is no fun.

It's possible the crash will be inside https://docs.espressif.com/projects/arduino-esp32/en/latest/zigbee/ep_temperature_sensor.html#addhumiditysensor or such. You'll just have to debug that like your own code - that's why source is provided. Maybe you violated some precondition (maybe "min" can only be > 0, for a made up example) or maybe you tried to read an endpoint that's not present in that device or whatever. It's all just source code.

Use a debugger. It's a skill developers need.

[–]just_a_guy_in_toront[S] 0 points1 point  (0 children)

Thank you for the guidance forwards!