{"action":"created","issue":{"url":"https://api.github.com/repos/espressif/arduino-esp32/issues/1398","repository_url":"https://api.github.com/repos/espressif/arduino-esp32","labels_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/1398/labels{/name}","comments_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/1398/comments","events_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/1398/events","html_url":"https://github.com/espressif/arduino-esp32/issues/1398","id":321824239,"number":1398,"title":"How do I decrease the size of my firmware?","user":{"login":"rammak","id":13752463,"avatar_url":"https://avatars3.githubusercontent.com/u/13752463?v=4","gravatar_id":"","url":"https://api.github.com/users/rammak","html_url":"https://github.com/rammak","followers_url":"https://api.github.com/users/rammak/followers","following_url":"https://api.github.com/users/rammak/following{/other_user}","gists_url":"https://api.github.com/users/rammak/gists{/gist_id}","starred_url":"https://api.github.com/users/rammak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rammak/subscriptions","organizations_url":"https://api.github.com/users/rammak/orgs","repos_url":"https://api.github.com/users/rammak/repos","events_url":"https://api.github.com/users/rammak/events{/privacy}","received_events_url":"https://api.github.com/users/rammak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-10T06:28:50Z","updated_at":"2018-05-18T19:08:07Z","closed_at":null,"author_association":"NONE","body":"### Hardware:\r\nBoard:\t\t\t\t\t\t\tESP32 Dev Module\r\nCore Installation/update date:\t\t10 May 2018\r\nIDE name:\t\t\t\t\t\tArduino IDE\r\nFlash Frequency:\t\t\t\t\t80Mhz\r\nUpload Speed:\t\t\t\t\t921600\r\n\r\n\r\n### Description:\r\nI'm working on a project where I want the smallest firmware size possible for ESP32. The sketch uses BLE so the firmware size goes to about 1.2MB but even with just a simple blink sketch the firmware size is at  161565 bytes. Is there any way I can reduce the filesize from Arduino IDE? I don't know if ESP-IDF produces smaller outputs but since the whole project is written in Arduino I would prefer not to switch and take the minimum hit in terms of extra size.\r\n \r\nI tried opening the output Blink.ino.bin file and I see that a large part of the file is made up of ASCII data like\r\n\r\n```\r\n   system_api  E (%d) %s: Base MAC address is NULL\r\n    E (%d) %s: Base MAC address from BLK3 of EFUSE version error, version = %d\r\n E (%d) %s: Base MAC address from BLK3 of EFUSE CRC error, efuse_crc = 0x%02x; calc_crc = 0x%02x\r\n    E (%d) %s: Base MAC address from BLK0 of EFUSE CRC error, efuse_crc = 0x%02x; calc_crc = 0x%02x\r\n    E (%d) %s: mac address param is NULL\r\n   E (%d) %s: mac type is incorrect\r\n   master  v3.1-dev-661-gf586f5e6  uart_tx_wait_idle   Task watchdog got triggered. The following tasks did not reset the watchdog in time:\r\n    - %s (%s)\r\n CPU %d: %s\r\n Aborting.\r\n  esp_intr_alloc(ETS_TG0_WDT_LEVEL_INTR_SOURCE, 0, task_wdt_isr, NULL, &twdt_config->intr_handle) /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/./task_wdt.c  esp_intr_free(twdt_config->intr_handle) esp_register_freertos_idle_hook_for_cpu(idle_hook_cb, i)    esp_task_wdt_add    esp_task_wdt_init   \r\nBrownout detector was triggered\r\n```\r\n\r\nOn the other sketch where I use BLE, almost 1/3rd of the file consists of such data. I wonder if this data is actually used by the sketch. Any recommendations on how to lower the size of the firmware?\r\n\r\n### Sketch:\r\n```cpp\r\nvoid setup() {\r\n  pinMode(21, OUTPUT);\r\n}\r\n\r\nvoid loop() {\r\n  digitalWrite(21, HIGH);   // turn the LED on (HIGH is the voltage level)\r\n  delay(1000);                       // wait for a second\r\n  digitalWrite(21, LOW);    // turn the LED off by making the voltage LOW\r\n  delay(1000);                       // wait for a second\r\n}\r\n```\r\n\r\n### Debug Messages:\r\n```\r\nrst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)\r\nets Jun  8 2016 00:22:57\r\n\r\nrst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)\r\nconfigsip: 0, SPIWP:0xee\r\nclk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00\r\nmode:DIO, clock div:1\r\nload:0x3fff0018,len:4\r\nload:0x3fff001c,len:956\r\nload:0x40078000,len:0\r\nload:0x40078000,len:13256\r\nentry 0x40078a90\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/espressif/arduino-esp32/issues/comments/390304039","html_url":"https://github.com/espressif/arduino-esp32/issues/1398#issuecomment-390304039","issue_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/1398","id":390304039,"user":{"login":"ArTyGill","id":23123591,"avatar_url":"https://avatars2.githubusercontent.com/u/23123591?v=4","gravatar_id":"","url":"https://api.github.com/users/ArTyGill","html_url":"https://github.com/ArTyGill","followers_url":"https://api.github.com/users/ArTyGill/followers","following_url":"https://api.github.com/users/ArTyGill/following{/other_user}","gists_url":"https://api.github.com/users/ArTyGill/gists{/gist_id}","starred_url":"https://api.github.com/users/ArTyGill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArTyGill/subscriptions","organizations_url":"https://api.github.com/users/ArTyGill/orgs","repos_url":"https://api.github.com/users/ArTyGill/repos","events_url":"https://api.github.com/users/ArTyGill/events{/privacy}","received_events_url":"https://api.github.com/users/ArTyGill/received_events","type":"User","site_admin":false},"created_at":"2018-05-18T19:08:07Z","updated_at":"2018-05-18T19:08:07Z","author_association":"NONE","body":"1. You can change the partition table for your device.\r\n2. Discard the use of \"C ++\" in favor of the pure language \"C\""}}
{"actor":{"display_login":"ArTyGill"}}