Closed NightSkySK closed 8 months ago
Hey @NightSkySK, thanks for raising this issue Just wanted to echo the message I left in https://github.com/FreeRTOS/iot-reference-esp32c3/issues/45 that the team is looking into this and other MQTT based issues that are being raised in the iot-reference-esp32c3 repo
As we followed that issue at https://github.com/FreeRTOS/iot-reference-esp32c3/issues/63 the root cause was found in the sub_pub_unsub_demo task. Error was casued by handling PUBACK. I suppose we can close it here as it's not related with coreMQTT-Agent library
The issue was created in (https://github.com/FreeRTOS/iot-reference-esp32c3/issues/63), but I think this in fact should land here. My code is based on that repo with slight modifications to make loops indefinitely.
I found that after number of loop iteration ESP32 crash with following logs:
I was asked to set
CONFIG_ESP_SYSTEM_PANIC_GDBSTUB
option to get more logs about reasons behind it.I finally was able to make my JTAG debugging to gbd work. (sorry this is my first time when I use it and I have no clue which information is useful and how to take more useful one, any advice is more than welcome)
ESP-IDF Monitor:
The debug console output:
The debug console is only part of what you would like to see as there is much more information in the VSCode debugger...
The call stack is looking like this:
I'm not sure how to provide all useful information about variables and registers from the debugger (I should probably be able to list them out to the gdb console if I know the right commands 😉 For the time being I paste a few screenshots which in my gut filling might be useful to understand the root cause.
Am I right that issue might be caused by
pTopicName
where it is blank (and should be/filter/SubPub0
) buttopicNameLength
is40006
? So in next step in log.cformat
contain some garbage value.pPublishinfo --> pTopicName
is coming frompArgs
where in all there is0x3ffd5d34
core_mqtt_agent_commad_functions.c line:72pPublishInfo = ( const MQTTPublishInfo_t * ) ( pPublishArg );
core_mqtt_agent.c line:570
pCommandArgs = pCommand->pArgs;
I've lost track in this point as I couldn't figure out how the pPayload and pTopicName should be correctly passed into
processCommand
orMQTTAgentCommand_Publish
functionsBTW After more deep dive into this problem I feel that I should move this topic in to coreMQTT-Agent repo, isn't it?
Originally posted by @NightSkySK in https://github.com/FreeRTOS/iot-reference-esp32c3/issues/63#issuecomment-1899963315