<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Memory Architecture &amp; Linker Configuration on Embedded Systems Development</title><link>https://applied-ee.github.io/embedded/docs/foundations/memory-and-linker/</link><description>Recent content in Memory Architecture &amp; Linker Configuration on Embedded Systems Development</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://applied-ee.github.io/embedded/docs/foundations/memory-and-linker/index.xml" rel="self" type="application/rss+xml"/><item><title>Flash &amp; SRAM Fundamentals</title><link>https://applied-ee.github.io/embedded/docs/foundations/memory-and-linker/flash-and-sram-fundamentals/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://applied-ee.github.io/embedded/docs/foundations/memory-and-linker/flash-and-sram-fundamentals/</guid><description>&lt;h1 id="flash--sram-fundamentals"&gt;Flash &amp;amp; SRAM Fundamentals&lt;a class="anchor" href="#flash--sram-fundamentals"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Every MCU has two primary memory regions: flash for non-volatile storage and SRAM for runtime data. On a typical Cortex-M device — say an STM32F407 — the flash holds 1 MB of compiled firmware starting at 0x08000000, while 192 KB of SRAM at 0x20000000 holds variables, the stack, and the heap. The entire address space, including peripheral registers, is memory-mapped into a single flat 32-bit space, which means reading a GPIO register and reading a variable in SRAM use the same load instruction.&lt;/p&gt;</description></item><item><title>Stack, Heap &amp; Static Allocation</title><link>https://applied-ee.github.io/embedded/docs/foundations/memory-and-linker/stack-heap-and-static/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://applied-ee.github.io/embedded/docs/foundations/memory-and-linker/stack-heap-and-static/</guid><description>&lt;h1 id="stack-heap--static-allocation"&gt;Stack, Heap &amp;amp; Static Allocation&lt;a class="anchor" href="#stack-heap--static-allocation"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;All runtime data on a Cortex-M lives in SRAM, and it gets divided into three categories: static allocations (globals and statics, known at link time), the stack (function calls and local variables, growing downward), and the heap (dynamic allocations via malloc, growing upward). On a device with 64 KB of SRAM, these three regions share the space with no MMU and no protection — when one grows into another, the result is silent data corruption, not a clean segfault.&lt;/p&gt;</description></item><item><title>Linker Scripts Demystified</title><link>https://applied-ee.github.io/embedded/docs/foundations/memory-and-linker/linker-scripts-demystified/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://applied-ee.github.io/embedded/docs/foundations/memory-and-linker/linker-scripts-demystified/</guid><description>&lt;h1 id="linker-scripts-demystified"&gt;Linker Scripts Demystified&lt;a class="anchor" href="#linker-scripts-demystified"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;The linker script is the contract between the compiled firmware and the physical memory of the target MCU. It tells the linker where flash begins, how large SRAM is, and which sections of the program go where. On a Cortex-M, the linker script also controls the vector table placement, the stack pointer initialization, and the data that the startup code must copy or zero before calling main(). When this file is wrong, the firmware may link successfully but crash immediately at runtime — or worse, run with subtle corruption.&lt;/p&gt;</description></item><item><title>Flash Wear &amp; Persistent Storage</title><link>https://applied-ee.github.io/embedded/docs/foundations/memory-and-linker/flash-wear-and-persistent-storage/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://applied-ee.github.io/embedded/docs/foundations/memory-and-linker/flash-wear-and-persistent-storage/</guid><description>&lt;h1 id="flash-wear--persistent-storage"&gt;Flash Wear &amp;amp; Persistent Storage&lt;a class="anchor" href="#flash-wear--persistent-storage"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Internal MCU flash is designed for firmware storage, but it also serves as the only non-volatile memory on many low-cost designs. Using it for runtime data — calibration values, configuration, event counters — is common but comes with hard constraints. Flash has limited erase endurance (typically 10,000 cycles on STM32, up to 100,000 on some NOR flash parts), erase must happen at sector granularity (not byte-level), and writes can only clear bits from 1 to 0. Working within these constraints requires deliberate strategies to avoid wearing out sectors that the firmware also depends on.&lt;/p&gt;</description></item></channel></rss>