Comments (6)
Since MQTTPublishInfo_t
is allocated on the stack it could be possible that an unbounded write somewhere may be corrupting the stack at that location. Could you try
-
Stepping through a debugger, add a watchpoint for pPublishInfo->payloadLength and step through the lines to see which line changes the value ?
-
Try moving the
MQTTPublishInfo_t pub
out of function call stack to a static variable and see if problem persists. This way you could isolate if this is a stack issue -
See if the stack size for the tasks are big enough. You can read more about debugging this here: https://www.freertos.org/FAQMem.html#StackSize
-
Enable coreMQTT debug logging to get any additional information by changing the config here to
LOG_DEBUG
.
from amazon-freertos.
Thanks,
I moved MQTTPublishInfo_t pub from the stack using static, now this is what I get:
Guru Meditation Error: Core 0 panic'ed (Double exception).
Core 0 register dump:
PS : 0x00050936 A0 : 0x800d1b67 A1 : 0x3fffff9c
A2 : 0x4000000c A3 : 0x00000000 A4 : 0x003ffbdb A5 : 0x00403860
A6 : 0x1049c500 A7 : 0xabffffff A8 : 0x800d1cd5 A9 : 0x49f53049
A10 : 0x00000000 A11 : 0x3ffbdb60 A12 : 0x1049c500 A13 : 0xe52049d5
A14 : 0x00000000 A15 : 0xff000000 SAR : 0x00000016 EXCCAUSE: 0x00000002
EXCVADDR: 0x40000050 LBEG : 0x400da114 LEND : 0x400da131 LCOUNT : 0x00000009
0x400da114: findInRecord at /home/tom/Documents/SLT/tecnocal/instacrop/fw/instacrop_v1/build/../amazon-freertos/libraries/coreMQTT/source/core_mqtt_state.c:434
(inlined by) MQTT_UpdateStatePublish at /home/tom/Documents/SLT/tecnocal/instacrop/fw/instacrop_v1/build/../amazon-freertos/libraries/coreMQTT/source/core_mqtt_state.c:875
0x400da131: MQTT_UpdateStatePublish at /home/tom/Documents/SLT/tecnocal/instacrop/fw/instacrop_v1/build/../amazon-freertos/libraries/coreMQTT/source/core_mqtt_state.c:849
Backtrace:0x400803bd:0x3fffff9c |<-CORRUPTED
0x400803bd: _UserExceptionVector at ??:?
I also lowered the buffer sizes in my functions that are being called by the MQTT API (send, receive), but this error remains.
I also added uxTaskGetStackHighWaterMark(NULL)
to the function that sends data via uart_write_bytes
and uart_read_bytes
to/from the modem and it always returns 1552 (I suspect these functions are the most stack intensive calls). If I increase the buffer sizes in the stack I can see it decrease its value.
Also, how do I set configCHECK_FOR_STACK_OVERFLOW value ? I have used FreeRTOS before and it is easy to do via idf.py menuconfig → Component config → FreeRTOS → Check for stack overflow
, but I do not know how to perform this in amazon-freertos.
I also changed the debug level, but it does not show any relevant information as far I can tell.
from amazon-freertos.
Ok so I think It is solved. The issue was that NetworkContext_t was being deleted in the stack because I did not declare it as a static variable in a function call.
Thanks for the help !
from amazon-freertos.
Still I would like to know how to set configCHECK_FOR_STACK_OVERFLOW, it could be in handy for some use latter.
from amazon-freertos.
It appears that you are using the ESP32 based upon the error dump you provided above. The ESP-IDF puts the kernel configuration options in the sdkconfig. This is configured according to the instructions here https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig.html
from amazon-freertos.
It appears you have resolved the original issue. Feel free to ask general configuration questions in the forums.
from amazon-freertos.
Related Issues (20)
- [BUG] `CORE_MQTT_MUTUAL_AUTH` Demo: Failed to establish new connection HOT 5
- [BUG] MbedTLS version not reflected within git modules. HOT 2
- [BUG] Array bound warning observed in iot_test_tcp.c HOT 2
- [General] Where is esp_hw_support component ? HOT 1
- [Feature Request] Allow to define custom 'help' command in freertos-cli HOT 2
- nvs_flash_init() panics HOT 1
- [BUG] Lacking a check for the return value of mbedtls_ssl_conf_own_cert() HOT 1
- [Feature Request] Update submodule "vendors/espressif/esp-idf" to release/v4.4 of esp-afr-sdk HOT 2
- [General] Unable to access esp-idf ble_wifi_provisioning component HOT 9
- [General] Cannot use Bluedroid, NVS crashes/panics HOT 15
- [General] BLE service to leverage IOT BLE data transfer service HOT 1
- ESP32 compiled binary shows absolute file path when walked through using binwalk HOT 6
- [General] STM32L4 discovary board AWS IoT Tera Term Error HOT 5
- [BUG] ESP32 Port SPI Error with S3 HOT 2
- [BUG] Trace output of ESP32-DevKitC jobs demo is clobbered HOT 2
- [General] Ethernet AWS MQTT DNS Network Error HOT 4
- [General] Is there a reason, why there is almost two months no merge in main? HOT 5
- [General] ESP32S3 OTA fails due to not multiple of 16 bytes
- [General] esp_ota_begin fails in simple example HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-freertos.