PubInv / PubInv/krake

Krake Memory Size Sketch,

Open
#436 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
8
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Memory Size on ESP32,

Asked an AI:

Is there a sketch to load to test the allowed code size on my ESP32 WROOM?

Memory Reporting Code

It came back with this code:

/*
ESP32_CODE_SIZE
*/

#include <Arduino.h>
#include "esp_ota_ops.h" // For partition info

void setup() {
  Serial.begin(115200);
  delay(2000); // Wait for Serial Monitor

  Serial.println("\n--- ESP32 Flash & Partition Report ---");

  // 1. Total Physical Flash Size
  uint32_t flashSize = ESP.getFlashChipSize();
  Serial.printf("Total Physical Flash: %u bytes (%.2f MB)\n", 
                flashSize, flashSize / (1024.0 * 1024.0));

  // 2. Current App Partition Size (The "Allowed" Code Size)
  const esp_partition_t* running = esp_ota_get_running_partition();
  if (running != NULL) {
    Serial.printf("Current App Partition Label: %s\n", running->label);
    Serial.printf("Allowed Code Size: %u bytes (%.2f MB)\n", 
                  running->size, running->size / (1024.0 * 1024.0));
  }

  // 3. Current Code Usage
  uint32_t sketchSize = ESP.getSketchSize();
  uint32_t freeSpace = ESP.getFreeSketchSpace();
  Serial.printf("Current Sketch Size: %u bytes\n", sketchSize);
  Serial.printf("Remaining Space in Partition: %u bytes\n", freeSpace);

  Serial.println("---------------------------------------\n");
}

void loop() {
  // Do nothing
}

The Code Ran and Reported

ets Jul 29 2019 12:21:46

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:1
load:0x3fff0030,len:4832
load:0x40078000,len:16460
load:0x40080400,len:4
load:0x40080404,len:3504
entry 0x400805cc

--- ESP32 Flash & Partition Report ---
Total Physical Flash: 4194304 bytes (4.00 MB)
Current App Partition Label: app0
Allowed Code Size: 1310720 bytes (1.25 MB)
Current Sketch Size: 288464 bytes
Remaining Space in Partition: 1310720 bytes
---------------------------------------


Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the ESP32 memory-reporting sketch and the serial output included in the issue. Determine what change or project integration is actually requested, then identify how the repository builds and runs ESP32 sketches; completion criteria are not specified in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.