Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

embedded-memory-constraints

/embedded-memory-constraints

Mieści firmware w kilobajtach przez alokację statyczną, mierzone rozmiary stosu i budżetowanie według mapy linkera, przy mikrokontrolerach oraz przepełnieniach i fragmentacji na urządzeniu.

Repozytorium
AI-SKILLS ↗
Licencja
MIT
Ostatnia zmiana repozytorium
05.09.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 05.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Mieści firmware w kilobajtach przez alokację statyczną, mierzone rozmiary stosu i budżetowanie według mapy linkera, przy mikrokontrolerach oraz przepełnieniach i fragmentacji na urządzeniu.

Oryginalny opis (EN)

Fit firmware into kilobytes with static allocation, measured stack sizing, and linker-map budgeting. Use when developing on microcontrollers or debugging overflows and fragmentation on-device.

Jak działa

  1. Method
  2. Boundaries
Sekcje z nagłówków SKILL.md, w oryginale · 67 linii, 455 słów
Podgląd SKILL.md
---
name: embedded-memory-constraints
description: Fit firmware into kilobytes with static allocation, measured stack sizing, and linker-map budgeting. Use when developing on microcontrollers or debugging overflows and fragmentation on-device.
---

# Embedded memory constraints

A microcontroller gives you kilobytes, no MMU, and no swap: memory
bugs do not throw, they corrupt. The discipline is knowing where every
byte lives at link time and proving the stack fits before the field
proves it does not.

## Method

1. **Allocate statically; ban or bound the heap.** Fixed-size
   pools, static buffers, and compile-time arrays for everything
   long-lived: heap use after init is where fragmentation slowly
   kills month-uptime devices. Where dynamic-ish behavior is
   needed, fixed-block pools (same-size chunks per object type)
   fragment nothing and fail loudly on exhaustion (the
   c-memory-safety arena idea, sized for kilobytes).
2. **Read the linker map as a budget.** Per-section (.text,
   .data, .bss, per-module) sizes tracked in CI with diffs per
   PR (see bundle-size's twin): flash and RAM budgets with
   headroom targets (~15-20% for growth and stack). The map also
   catches the classics: accidental stdlib pull-ins (printf's
   float support doubling .text), debug strings shipping to
   production, duplicated const tables missing `PROGMEM`/flash
   placement.
3. **Size stacks by measurement, not vibes.** Fill stacks with a
   pattern at boot, measure high-water marks under worst-case
   load (deep call paths, nested interrupts: see
   interrupt-safe-code) per task (see rtos-task-design);
   static analysis (`-fstack-usage`, call-graph tools) bounds
   what tests miss. Enable hardware protection where available
   (MPU guard regions, stack canaries): a silent stack overflow
   into .bss is the least debuggable bug on a device (see
   embedded-debugging).
4. **Choose data representations for the platform.** Right-sized
   integer types, packed flags, indices instead of pointers
   (2 bytes vs 4/8, and serializable: see
   entity-component-system's handle logic), lookup tables in
   flash not RAM, strings as IDs resolved off-device where a
   log pipeline exists (see sensor-data-handling's batching).
   Alignment padding audit on structs (`-Wpadded` spot checks)
   recovers surprising bytes in arrays of thousands.
5. **Make exhaustion behavior explicit.** Every pool and queue
   has a stated full policy (drop-oldest for telemetry,
   reject-and-flag for commands: see backpressure's policy
   table, message-queues) and a counter observable in the field;
   out-of-memory in an embedded system must be a designed state,
   never a surprise, because there is no OOM-killer to blame.
6. **Keep debug and release honest.** Asserts and logging cost
   RAM/flash: use link-time-removable levels (see log-levels),
   but keep the *safety* checks (bounds, pool exhaustion,
   watchdog kicks) in release; a build that only asserts in the
   lab ships its bugs silently (see
   defensive-programming's release-assert stance).

## Boundaries

- Linux-class embedded (Pi-grade, with MMU) relaxes these rules
  toward ordinary systems programming (see c-memory-safety);
  this skill is for the MCU world beneath it.
- Rust-on-embedded moves several disciplines into the compiler
  (no-heap enforced by no_std, ownership: see rust-ownership)
  but stack sizing and linker budgeting remain manual.
- Ultra-low-power sleep states interact with RAM retention
  (which banks survive sleep); memory layout and power design
  are coupled decisions (see low-power-design).

Wersje

W bazie nie ma innych skilli o nazwie embedded-memory-constraints.

Migawka bazy z 13.11.2026 · wersja paczki 0aa73d0acd09 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90esp32-linker-map-review
    Przegląda mapę linkera firmware ESP32 i wskazuje sekcje, które zajmują zbyt dużo pamięci albo leżą w niewłaściwym miejscu.
  • 100memory-audit
    Sprawdza kod wbudowany pod kątem przepełnienia stosu, fragmentacji sterty, wzorców alokacji statycznej i wycieków pamięci na urządzeniach o ograniczonych zasobach.
  • 100embedded-firmware-engineer
    Wspiera decyzje inżyniera firmware'u: analizę najgorszego czasu wykonania, statyczną alokację pamięci, krótkie procedury przerwań i synchronizację zmiennych współdzielonych między ISR a główną pętlą.
  • 100c-cpp-patterns
    Pisze i przegląda firmware w C i C++ dla mikrokontrolerów: dostęp do rejestrów, ISR, bufory kołowe, pakowanie struktur i skrypty linkera.
  • 100resource-optimization-lowend
    Zmniejsza zużycie pamięci flash i RAM w mikrokontrolerach, analizując mapę linkera, głębokość stosu i kompromis rozmiar kontra szybkość.
  • 90esp32-linker-script-change-review
    Przegląda zmiany w skrypcie linkera ESP32 pod kątem wpływu na umieszczenie kodu i danych w pamięci urządzenia.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.