[PR #1626] fix(labs): use ESP32 SRAM capacity field in lab 02 #9232

Open
opened 2026-05-03 01:29:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1626
Author: @Shashank-Tripathi-07
Created: 5/3/2026
Status: 🔄 Open

Base: devHead: fix/lab02-esp32-sram-field


📝 Commits (1)

  • 9188b7c fix(labs): use ESP32 SRAM capacity for memory check in lab 02

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 labs/vol1/lab_02_ml_systems.py (+1 -1)

📄 Description

Summary

  • Hardware.Tiny.ESP32_S3.memory.capacity returns 8 MB flash storage (7812 KiB), not SRAM
  • The correct field for the 512 KiB SRAM is memory.sram_capacity
  • Lab 02 line 58 was reading flash instead of SRAM, making ESP32_RAM_KB = 7812 instead of 512

Same root cause as PR #1625 (lab 01 fix).

Change

# Before (wrong -- reads 8 MB flash storage)
ESP32_RAM_KB = Hardware.Tiny.ESP32_S3.memory.capacity.m_as("KiB")

# After (correct -- reads 512 KiB SRAM)
ESP32_RAM_KB = Hardware.Tiny.ESP32_S3.memory.sram_capacity.m_as("KiB")

Test plan

  • Verify Hardware.Tiny.ESP32_S3.memory.sram_capacity.m_as("KiB") returns 512 in the mlsysim registry
  • Run lab 02 in Marimo and confirm ESP32_RAM_KB shows 512 KiB

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1626 **Author:** [@Shashank-Tripathi-07](https://github.com/Shashank-Tripathi-07) **Created:** 5/3/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/lab02-esp32-sram-field` --- ### 📝 Commits (1) - [`9188b7c`](https://github.com/harvard-edge/cs249r_book/commit/9188b7c1d659f34037ae3f2a84e54f8b329cd816) fix(labs): use ESP32 SRAM capacity for memory check in lab 02 ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `labs/vol1/lab_02_ml_systems.py` (+1 -1) </details> ### 📄 Description ## Summary - `Hardware.Tiny.ESP32_S3.memory.capacity` returns 8 MB **flash storage** (7812 KiB), not SRAM - The correct field for the 512 KiB SRAM is `memory.sram_capacity` - Lab 02 line 58 was reading flash instead of SRAM, making `ESP32_RAM_KB = 7812` instead of `512` Same root cause as PR #1625 (lab 01 fix). ## Change ```python # Before (wrong -- reads 8 MB flash storage) ESP32_RAM_KB = Hardware.Tiny.ESP32_S3.memory.capacity.m_as("KiB") # After (correct -- reads 512 KiB SRAM) ESP32_RAM_KB = Hardware.Tiny.ESP32_S3.memory.sram_capacity.m_as("KiB") ``` ## Test plan - [ ] Verify `Hardware.Tiny.ESP32_S3.memory.sram_capacity.m_as("KiB")` returns 512 in the mlsysim registry - [ ] Run lab 02 in Marimo and confirm `ESP32_RAM_KB` shows 512 KiB --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-03 01:29:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#9232