Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <sstream>
static void task(void *)
{
std::stringstream ss;
while (1)
sleep(1);
}
extern "C" void app_main()
{
// std::stringstream ss; -- fixes it
sleep(1);
for (int i = 0; i < 8; ++i)
xTaskCreate(task, "", 4096, NULL, 1, NULL);
while (1)
sleep(1);
}
/*
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_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:0x3fff0030,len:4
load:0x3fff0034,len:7152
ho 0 tail 12 room 4
load:0x40078000,len:13696
load:0x40080400,len:4000
entry 0x40080688
I (31) boot: ESP-IDF v4.2-dev-1126-gd85d3d969 2nd stage bootloader
I (31) boot: compile time 18:27:18
I (31) boot: chip revision: 1
I (35) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (42) boot.esp32: SPI Speed : 40MHz
I (47) boot.esp32: SPI Mode : DIO
I (51) boot.esp32: SPI Flash Size : 2MB
I (56) boot: Enabling RNG early entropy source...
I (61) boot: Partition Table:
I (65) boot: ## Label Usage Type ST Offset Length
I (72) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (80) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (87) boot: 2 factory factory app 00 00 00010000 00100000
I (95) boot: End of partition table
I (99) boot_comm: chip revision: 1, min. application chip revision: 0
I (106) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x16548 ( 91464) map
I (150) esp_image: segment 1: paddr=0x00026570 vaddr=0x3ffb0000 size=0x02378 ( 9080) load
I (154) esp_image: segment 2: paddr=0x000288f0 vaddr=0x40080000 size=0x00404 ( 1028) load
I (157) esp_image: segment 3: paddr=0x00028cfc vaddr=0x40080404 size=0x0731c ( 29468) load
I (178) esp_image: segment 4: paddr=0x00030020 vaddr=0x400d0020 size=0x3bc34 (244788) map
I (272) esp_image: segment 5: paddr=0x0006bc5c vaddr=0x40087720 size=0x02c3c ( 11324) load
I (283) boot: Loaded app from partition at offset 0x10000
I (283) boot: Disabling RNG early entropy source...
I (284) cpu_start: Pro cpu up.
I (287) cpu_start: Application information:
I (292) cpu_start: Project name: hello-world
I (297) cpu_start: App version: 1
I (302) cpu_start: Compile time: Apr 18 2020 18:27:36
I (308) cpu_start: ELF file SHA256: d0ca6db32e029486...
I (314) cpu_start: ESP-IDF: v4.2-dev-1126-gd85d3d969
I (320) cpu_start: Starting app cpu, entry point is 0x40081464
I (312) cpu_start: App cpu up.
I (331) heap_init: Initializing. RAM available for dynamic allocation:
I (338) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (344) heap_init: At 3FFB3CD0 len 0002C330 (176 KiB): DRAM
I (350) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (356) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (363) heap_init: At 4008A35C len 00015CA4 (87 KiB): IRAM
I (369) cpu_start: Pro cpu start user code
I (387) spi_flash: detected chip: gd
I (388) spi_flash: flash io: dio
W (388) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (398) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
assertion "heap != NULL && "free() target pointer is outside heap areas"" failed: file "/home/tassadar/mickoflus/esp-idf/components/heap/heap_caps.c", line 271, function: heap_caps_free
abort() was called at PC 0x400f0133 on core 0
Backtrace:0x40085277:0x3ffb9710 0x40084b11:0x3ffb9730 0x400876ba:0x3ffb9750 0x400f0133:0x3ffb97c0 0x40083943:0x3ffb97f0 0x400875b5:0x3ffb9810 0x400d67ed:0x3ffb9830 0x400df16c:0x3ffb9850 0x400d70d5:0x3ffb9870 0x400d73cb:0x3ffb9890 0x400d7ae6:0x3ffb98c0 0x400d7bd0:0x3ffb9900 0x400d7bf5:0x3ffb9920 0x400d7c06:0x3ffb9940 0x400f0051:0x3ffb9970 0x400e7f65:0x3ffb9990 0x400d6523:0x3ffb99b0 0x400d38e1:0x3ffb99d0 0x40087885:0x3ffb9ac0
#0 0x40085277:0x3ffb9710 in panic_abort at /home/tassadar/mickoflus/esp-idf/components/esp_system/panic.c:330
#1 0x40084b11:0x3ffb9730 in esp_system_abort at /home/tassadar/mickoflus/esp-idf/components/esp_system/system_api.c:68
#2 0x400876ba:0x3ffb9750 in abort at /home/tassadar/mickoflus/esp-idf/components/newlib/abort.c:46
#3 0x400f0133:0x3ffb97c0 in __assert_func at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/stdlib/assert.c:62 (discriminator 8)
#4 0x40083943:0x3ffb97f0 in heap_caps_free at /home/tassadar/mickoflus/esp-idf/components/heap/heap_caps.c:271 (discriminator 1)
#5 0x400875b5:0x3ffb9810 in free at /home/tassadar/mickoflus/esp-idf/components/newlib/heap.c:47
#6 0x400d67ed:0x3ffb9830 in operator delete(void*) at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/del_op.cc:49
#7 0x400df16c:0x3ffb9850 in std::__numpunct_cache<char>::~__numpunct_cache() at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/build/build-cc-gcc-final/xtensa-esp32-elf/no-rtti/libstdc++-v3/include/bits/locale_facets.h:1661
#8 0x400d70d5:0x3ffb9870 in std::locale::facet::_M_remove_reference() const at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/build/build-cc-gcc-final/xtensa-esp32-elf/no-rtti/libstdc++-v3/include/bits/locale_classes.h:458 (discriminator 1)
#9 0x400d73cb:0x3ffb9890 in std::locale::_Impl::_M_install_facet(std::locale::id const*, std::locale::facet const*) at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/src/c++98/locale.cc:415
#10 0x400d7ae6:0x3ffb98c0 in std::locale::_Impl::_Impl(unsigned int) at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/build/build-cc-gcc-final/xtensa-esp32-elf/no-rtti/libstdc++-v3/include/bits/locale_classes.h:611
(inlined by) std::locale::_Impl::_Impl(unsigned int) at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/src/c++98/locale_init.cc:541
#11 0x400d7bd0:0x3ffb9900 in std::locale::_S_initialize_once() at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/src/c++98/locale_init.cc:307
#12 0x400d7bf5:0x3ffb9920 in std::locale::_S_initialize() at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/src/c++98/locale_init.cc:319
#13 0x400d7c06:0x3ffb9940 in std::locale::locale() at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/src/c++98/locale_init.cc:250
#14 0x400f0051:0x3ffb9970 in std::ios_base::ios_base() at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/src/c++11/ios.cc:79 (discriminator 2)
#15 0x400e7f65:0x3ffb9990 in std::basic_ios<char, std::char_traits<char> >::basic_ios() at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/build/build-cc-gcc-final/xtensa-esp32-elf/no-rtti/libstdc++-v3/include/bits/basic_ios.h:462
#16 0x400d6523:0x3ffb99b0 in std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode) at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/build/build-cc-gcc-final/xtensa-esp32-elf/no-rtti/libstdc++-v3/include/sstream:705
(inlined by) std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode) at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/build/build-cc-gcc-final/xtensa-esp32-elf/no-rtti/libstdc++-v3/include/sstream:706
#17 0x400d38e1:0x3ffb99d0 in task(void*) at /home/tassadar/mickoflus/hello_world/main/hello_world_main.cpp:7
#18 0x40087885:0x3ffb9ac0 in vPortTaskWrapper at /home/tassadar/mickoflus/esp-idf/components/freertos/xtensa/port.c:143
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment