Skip to content

Memory leak in ledcWriteTone #4724

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

Closed
qianqin opened this issue Jan 15, 2021 · 1 comment
Closed

Memory leak in ledcWriteTone #4724

qianqin opened this issue Jan 15, 2021 · 1 comment

Comments

@qianqin
Copy link

qianqin commented Jan 15, 2021

Hardware:

Board: ESP32-CAM
Core Installation version: 2.1.0
IDE name: Platform.io
Flash Frequency: 40Mhz
PSRAM enabled: yes
Upload Speed: 115200
Computer OS: Windows 10

Description:

After each call of ledcWriteTone, free memory is reduced by 28 bytes if frequency parameter is higher than 0.

Sketch:

#include <Arduino.h>

uint8_t channel;

void setup() {
  ledcSetup(channel, 0, 8);
  ledcAttachPin(12, channel);
}

void loop() {
  log_i("free memory %uB", esp_get_free_heap_size());
  ledcWriteTone(channel, 1000);
  delay(100);
  ledcWriteTone(channel, 0);
  delay(1000);
}

Debug Messages:

Enable Core debug level: 5
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5828
entry 0x400806ac
[D][esp32-hal-psram.c:47] psramInit(): PSRAM enabled
[I][main.cpp:11] loop(): free memory 4483656B
[I][main.cpp:11] loop(): free memory 4483628B
[I][main.cpp:11] loop(): free memory 4483600B
[I][main.cpp:11] loop(): free memory 4483572B
[I][main.cpp:11] loop(): free memory 4483544B
[I][main.cpp:11] loop(): free memory 4483516B
[I][main.cpp:11] loop(): free memory 4483488B
[I][main.cpp:11] loop(): free memory 4483460B
[I][main.cpp:11] loop(): free memory 4483432B
[I][main.cpp:11] loop(): free memory 4483404B
[I][main.cpp:11] loop(): free memory 4483376B
@qianqin
Copy link
Author

qianqin commented Jan 24, 2021

seems to be duplicate of #3555

@qianqin qianqin closed this as completed Jan 24, 2021
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

No branches or pull requests

1 participant