mirror of
https://github.com/juanjiant-bit/JIANT.git
synced 2026-12-06 04:44:33 +01:00
docs/BLE_FEASIBILITY.md stage 2 step 5 (section 8 added: as built). - In: what a central writes, decoded by the stack (ble_midi.c), goes into the one MIDI input ring as USB's does (firmware/bt/bt_midi.h bt_midi_accept: channel messages, F8 FA FB FC; no SysEx), source 1 = USB: notes, CC, PC, bend, CLK USB, LEARN, ROUT, MIDI MAP alike. src/bt.c bt_midi_rx enqueues with the interrupts off (the BLE interrupts at priority 2 are preempted by TIMER5, the ring's other producer). No change to the sound's code for input. - Out: usb.c midi_out_event (everything MENU > CONTROL > MIDI OUT lets out) also fills bt_oq (64) while a central listens; the stack packs it each connection event (header, timestamps from TIMER4, running status). The sound's code moved 64 B (tools/audio_layout.txt repinned). - Flash: the app's cold constants / code can live in the segment (bt.c BTAPP_RO / BTAPP_FN, app.ld .btapp.* inside the segment's CRC-32), checked once at power-on (bt_boot, after the splash). MENU > ABOUT's THE PROJECT, CREDITS and LICENSES moved there; NO SEG: ABOUT without them. - MENU's overview tiles (the slide between tabs): a bottom tile shows seven rows (SYSTEM's eighth, from V10.12, ran off the panel: 595 ui_render lint findings). - Tests: tests/ble_midi_test.c (fm1-base's codec test, credited in LICENSING.md), tests/bt_midi_test.c (packets as apps send them, the out ring and its packets), tests/ui_test.c (ABOUT's lines); run_tests.sh runs the two new ones. App 582,140 B of 584,336 (2,196 B free); RAM .data+.bss 95,564 B (+284); pool spare 9,568 B; segment 30,660 B (8 sectors). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
83 lines
6.5 KiB
Plaintext
83 lines
6.5 KiB
Plaintext
/* SPDX-License-Identifier: GPL-3.0-only
|
|
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
|
|
/* FELUCCA memory map.
|
|
* Code + constants execute in place from XIP (app.bin offset 0 = 0x02000120).
|
|
* RAMTEXT (JIANT 0.6.78: at the top of the pool, was 0x01C00000): .ram_text (code that must run while the flash is
|
|
* busy: the flash driver), .c1_text (the second core's loop), .hot_text (core 0's hottest audio code). A call reaches
|
|
* +-4 MiB (pi32v2 imm23 x 2, no long calls in this compiler): RAM code there reaches the whole XIP image (build.py
|
|
* checks the margin); at 0x01C00000 it reached none of it.
|
|
* LOWBUF 0x01C00000..0x01C08000 (0.6.78; 0.6.82: 4 KiB more, the steps grew): main-loop buffers (undo, the song
|
|
* section's stage; the project scratch until 0.8.4 and the fonts' decode tables in 0.8.4, both in the pool since
|
|
* 0.8.5; 0.9.9-beta4: the fonts' tables and the user presets' banks back here, 9 KiB of the pool given to RAMTEXT),
|
|
* zeroed at boot. 0x01C07000..0x01C08000 was kept for RAM-run debug until 0.9.9-beta4 (LOWBUF took it).
|
|
* RAM : .data/.bss (96 KiB)
|
|
* POOL : big zero-initialised buffers (FX lines, canvases), section .pool
|
|
* STACKS with 256-byte guard bands; NOINIT survives resets and UBOOT entry.
|
|
* 0x01C7FD50.. is reserved: boot_info, boot-state mailbox, vector table. */
|
|
MEMORY
|
|
{
|
|
XIP (rx) : ORIGIN = 0x02000120, LENGTH = 0x8EA90 /* = tools/fm1pkg_make.py APP_SLOT (0.9.13: the region ends at 0x92FFE) */
|
|
LOWBUF (rw) : ORIGIN = 0x01C00000, LENGTH = 0x8000
|
|
RAM (rwx) : ORIGIN = 0x01C08000, LENGTH = 96K
|
|
POOL (rw) : ORIGIN = 0x01C20000, LENGTH = 0x4D800
|
|
RAMTEXT (rwx): ORIGIN = 0x01C6D800, LENGTH = 0x8800 /* (0.6.97, 0.7.0: up 4 KiB each, the image grew: a call from here must
|
|
* reach its end; the user stack 4 KiB shorter each time, 15.75 KiB;
|
|
* 0.9.9-stab, as 0.9.12: 1 KiB lower, from the pool: the 320 MHz switch;
|
|
* 0.9.9-beta4: 9 KiB lower, from the pool (8 KiB of its main-loop
|
|
* buffers moved to LOWBUF): the delay's, the reverbs' and the
|
|
* chorus's block code in RAM, out of the I-cache the engines share) */
|
|
NOINIT (rw) : ORIGIN = 0x01C7C000, LENGTH = 0x3D50
|
|
BTSEG (rx) : ORIGIN = 0x020E6000, LENGTH = 0x12000 /* (V10.12) flash 0xEA000..0xFBFFF (hal/fm1_flash.h FL_EXT_*): the
|
|
* Bluetooth segment, read in place through the plain XIP window */
|
|
}
|
|
SECTIONS
|
|
{
|
|
/* (V10.12) the Bluetooth segment (firmware/bt/bt_seg.c, its own unit): its header first (bt_seg.c bt_head, filled by
|
|
* tools/build.py), then its code and constants, outside the app slot; written by the update loader from the
|
|
* package's bt.bin (firmware/loader/ldr_core.c), checked by the app before any call (src/bt_hw.c). First here so
|
|
* that no rule below takes its sections; its zeroed RAM goes to the pool (below), its RAM code (.ram_text) with
|
|
* the app's. No initialised data (tools/build.py). (V10.13) then the app's own code and constants kept there (src/bt.c
|
|
* BTAPP_FN / BTAPP_RO: cold, read only once the segment checked) */
|
|
.bt : { _bt_start = .; KEEP(*(.bt_head)) *bt_seg.o(.text .text.* .rodata .rodata.*)
|
|
*(.btapp.text) *(.btapp.rodata) . = ALIGN(4); _bt_end = .; } > BTSEG
|
|
/* (0.9.9-snd3) the code in tools/audio_layout.txt's order, each run of the sound at its recorded address (tools/build.py
|
|
* writes build/layout.ld: the UI cannot move the sound; "cannot move location counter backwards" = the code before a
|
|
* run grew: FELUCCA_REPIN=1), the tables (the sound's first), the merged constants (their small tables, then the
|
|
* strings), the UI's tables that filled no hole (.rodata.n.*), code not in the layout */
|
|
.text : { KEEP(*(.text.crt0)) *(.text) INCLUDE build/layout.ld *(.rodata) *(.rodata.cst*) *(.rodata.str*)
|
|
*(SORT_BY_ALIGNMENT(.rodata.n.*)) *(.text*) *(.rodata*)
|
|
. = ALIGN(4); _etext = .; } > XIP
|
|
.ram_text : { _rt_start = .; KEEP(*(.ram_text*)) . = ALIGN(4); _rt_end = .; } > RAMTEXT AT > XIP
|
|
_rt_load = LOADADDR(.ram_text);
|
|
/* (JIANT 0.6.71) the second core's waiting loop (hal/fm1_multicore.h): in RAM, after the flash driver, inside the
|
|
* guard's RAM code window (_rt_start .. _c1t_end); its own section, as it calls the jobs (the build's check that
|
|
* .ram_text calls nothing still holds) */
|
|
.c1_text : { _c1t_start = .; KEEP(*(.c1_text*)) . = ALIGN(4); _c1t_end = .; } > RAMTEXT AT > XIP
|
|
_c1t_load = LOADADDR(.c1_text);
|
|
/* (JIANT 0.6.78) core 0's hottest audio code (tools/build.py HOT_FNS): in RAM after the second core's loop, inside the
|
|
* same RAM code window (_rt_start .. _hot_end) */
|
|
.hot_text : {
|
|
_hot_start = .;
|
|
KEEP(*(.hot_text*)) /* (tools/build.py HOT_FNS: their sections renamed in the optimised IR) */
|
|
. = ALIGN(4);
|
|
_hot_end = .;
|
|
} > RAMTEXT AT > XIP
|
|
_hot_load = LOADADDR(.hot_text);
|
|
.data : { . = ALIGN(4); _data_start = .; *(.data*) *(.sdata*) . = ALIGN(4); _data_end = .; } > RAM AT > XIP
|
|
_data_load = LOADADDR(.data);
|
|
/* (V10.12) the Bluetooth segment's RAM in the pool, but its baseband block (ble_hw_wl82.c bb, 1508 B, read and
|
|
* written by the radio's DMA) here, in the RAM every DMA reaches */
|
|
.bss (NOLOAD) : { _bss_start = .; *(EXCLUDE_FILE(*bt_seg.o) .bss*) *(EXCLUDE_FILE(*bt_seg.o) .sbss*)
|
|
*(EXCLUDE_FILE(*bt_seg.o) COMMON) *bt_seg.o(.bss.bb) . = ALIGN(4); _bss_end = .; } > RAM
|
|
.pool (NOLOAD) : { _pool_start = .; *(.pool*) *bt_seg.o(.bss* .sbss* COMMON) . = ALIGN(4); _pool_end = .; } > POOL
|
|
/* (JIANT 0.6.71) the second core's stacks (hal/fm1_multicore.h): 6 KiB for the render, 1 KiB for an exception */
|
|
.c1_stacks (NOLOAD) : { . = ALIGN(32); _c1_stack_lo = .; . += 7168; _c1_stack_hi = .; } > POOL
|
|
_c1_ustack_top = _c1_stack_lo + 6144;
|
|
_c1_sstack_top = _c1_stack_hi;
|
|
.lowbuf (NOLOAD) : { _low_start = .; *(.lowbuf*) . = ALIGN(4); _low_end = .; } > LOWBUF
|
|
.noinit (NOLOAD) : { *(.noinit) *(.noinit.*) } > NOINIT /* (V10.12: .noinit.* after: none of the others moves) */
|
|
_guard0 = 0x01C76000; _ustack_lo = 0x01C76100; _ustack_top = 0x01C7A000;
|
|
_guard1 = 0x01C7A000; _sstack_lo = 0x01C7A100; _sstack_top = 0x01C7C000;
|
|
/DISCARD/ : { *(.comment) *(.note*) }
|
|
}
|