Skip to content

Fix zero w aligned new panic#196

Merged
danifunker merged 2 commits into
mainfrom
fix-zero-w-aligned-new-panic
Jun 12, 2026
Merged

Fix zero w aligned new panic#196
danifunker merged 2 commits into
mainfrom
fix-zero-w-aligned-new-panic

Conversation

@danifunker

Copy link
Copy Markdown
Owner

Fixed issues with recent builds for Pi Zero / W

danifunker and others added 2 commits June 12, 2026 15:58
…MA buffers

Circle 51 builds with -std=c++17 (GCC 15.2), so heap-allocating an
over-aligned type now calls C++17 aligned operator new, which Circle
asserts against HEAP_BLOCK_ALIGN. That cap is the data cache line
length: 32 on RASPPI=1, 64 on every other model. alignas(64) on the
CUSBCDGadget DMA buffer members raised alignof(CUSBCDGadget) to 64, so
'new CUSBCDGadget' in cdromservice panicked at boot on the Pi Zero W
while working everywhere else (issue #195).

DMA_BUFFER already applies CACHE_ALIGN, which matches the platform
cache line (32 on RASPPI=1, 64 elsewhere) - exactly what DMA coherence
needs - so the explicit alignas was redundant on all other models.

Same bug class as the FTP alignas(512) panic fixed in 9b4c622.

Verified with arm-none-eabi-g++ 15.2 (-DRASPPI=1 -std=c++17):
alignof(CUSBCDGadget) now fits the 32-byte heap cap; the old header
fails the same static_assert.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@danifunker danifunker merged commit 7880065 into main Jun 12, 2026
1 check passed
@danifunker danifunker deleted the fix-zero-w-aligned-new-panic branch June 12, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant