Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32-S3-Mini-1-N8 module - Heap memory free space is decreasing during program execution (IEP-1289) (IDFGH-13204) #14141

Open
MN000022 opened this issue Jul 4, 2024 · 1 comment
Assignees
Labels
Status: Opened Issue is new

Comments

@MN000022
Copy link

MN000022 commented Jul 4, 2024

I am working on ESP32-S3-Mini-1-N8 module. I am using GATT server example. In this application,

  1. BLE power save mode is implemented. External 32KHz crystal is used.
  2. ESP32-S3 light sleep mode is implemented.
  3. RTC GPIO wake up is implemented.
  4. Timer periodic interrupts for 100us, 1ms & 10ms are implemented - GPtimer

Initialization for timer is as follows:
/* GPtimer 2 - 10ms */
gptimer2 = NULL;
QueueHandle_t Timer_queue2 = xQueueCreate(10, sizeof(example_queue_element_t));
if (!Timer_queue2) {
return;
}
gptimer_config_t timer_config2 = {
.clk_src = GPTIMER_CLK_SRC_DEFAULT,
.direction = GPTIMER_COUNT_UP,
.resolution_hz = 1000000, // 1MHz, 1 tick=1us
};
ESP_ERROR_CHECK(gptimer_new_timer(&timer_config2, &gptimer2));

	     gptimer_event_callbacks_t cbs2 = {
	         .on_alarm = example_timer_on_alarm_cb_v2,
	     };
	     cbs2.on_alarm = example_timer_on_alarm_cb_v2;
	     ESP_ERROR_CHECK(gptimer_register_event_callbacks(gptimer2, &cbs2, Timer_queue2));
	     ESP_ERROR_CHECK(gptimer_enable(gptimer2));

	     gptimer_alarm_config_t alarm_config2 = {
	         .alarm_count = 10000,//1000000, // period = 10ms
	     };
	     ESP_ERROR_CHECK(gptimer_set_alarm_action(gptimer2, &alarm_config2));
	     ESP_ERROR_CHECK(gptimer_start(gptimer2));

The issue I observed is, heap memory free space is getting decreased during application execution and when heap memory is around 500 bytes, ESP32-S3 goes in to unidentified state where BLE and GPIO wake up are also not working. Only it starts working once power is reset.
I checked free heap memory using function 'xPortGetFreeHeapSize' during program execution.
I have enabled task watchdog and panic handler invoked on task watchdog timeout.
I have also checked without initializing BLE. I am facing same issue.
Can anyone elaborate on this issue?

Thanks

@github-actions github-actions bot changed the title ESP32-S3-Mini-1-N8 module - Heap memory free space is decreasing during program execution ESP32-S3-Mini-1-N8 module - Heap memory free space is decreasing during program execution (IEP-1289) Jul 4, 2024
@Alvin1Zhang Alvin1Zhang transferred this issue from espressif/idf-eclipse-plugin Jul 5, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jul 5, 2024
@github-actions github-actions bot changed the title ESP32-S3-Mini-1-N8 module - Heap memory free space is decreasing during program execution (IEP-1289) ESP32-S3-Mini-1-N8 module - Heap memory free space is decreasing during program execution (IEP-1289) (IDFGH-13204) Jul 5, 2024
@suda-morris
Copy link
Collaborator

sounds like your application is leaking memory, maybe you allocated some memory in the gptimer callback and never free them? @MN000022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

4 participants