Commit graph

9 commits

Author SHA1 Message Date
Aidan MacDonald
d5506dfa22 echoplayer: implement boot from debugger
Add a 'make start' target which starts Rockbox using a
debugger. This only works to load the main binary, but
makes it much faster to test changes that don't affect
plugins/codecs.

Because SDRAM isn't accessible at reset and the main
binary is usually too big to fit in SRAM, the bootloader
must be flashed first before Rockbox can be loaded in
this way.

The boot protocol involves GDB writing a check pattern
to SRAM while the CPU is held in reset. The bootloader
detects the pattern and takes a breakpoint, by which
time SDRAM is accessible; GDB can then upload a binary
ELF image (copied as a raw file, since the ELF will be
loaded using RB's ELF loader) and leave the breakpoint
to continue booting.

From there the bootloader can load the ELF binary from
memory, exactly like a normal SD card boot.

Change-Id: I4eb971b4162ea422e38660455cfa0958cefaa18d
2026-01-26 08:55:01 -05:00
Aidan MacDonald
603c5bb2be echoplayer: load Rockbox from SD card in bootloader
To avoid problems with SDMMC DMA not being able to
access all SRAMs equally, the ELF binary is loaded
at the top of SDRAM and then copied into place.

Change-Id: Icf16d02bc15605539cbe781dd27709225abca8f9
2026-01-25 19:51:56 -05:00
Aidan MacDonald
0f5c42122c echoplayer: implement bootloader power on/off logic
On the Echo R1, the main regulator is enabled primarily by
the power button and USB input, and secondarily by the CPU's
own output pins (cpu_power_on signal or RTC alarm output).

From a user perspective, the player should appear to power
up and down only if the power button is long pressed, which
must be implemented in software. These logical power states
are called "active" and "inactive" in the bootloader.

Going from inactive to active will attempt to boot Rockbox
unless a button (d-pad down) is held to enter bootloader
USB mode instead. Going from active to inactive will shut
down the player. The bootloader will also automatically
shut down after a short timeout, if USB is not plugged in.

In the inactive state, the player is supposed to enumerate
over USB so it can negotiate a charging current, but should
otherwise appear "off". In particular it shouldn't expose
mass storage or even power up the SD card, nor power up the
LCD/backight. This isn't implemented yet, because there's
no way to dynamically change USB configurations (eg. going
from active to inactive should trigger re-enumeration to
switch to charge only mode). To avoid surprising behavior,
the bootloader will just boot Rockbox immediately if USB is
plugged in at boot.

Change-Id: Icd1d48ef49a31eb32b54d440e9211aaf40c6b974
2026-01-25 07:46:31 -05:00
Solomon Peachy
4e4d5ac25b Fix yellow in echoplayer bootloader
Regression introduced in 7f0bc4bd95

Change-Id: I1341319d23a2813b8473e3fceb3370bf6371ef86
2026-01-24 09:13:49 -05:00
Solomon Peachy
7f0bc4bd95 bootloader: Share definition of show_logo via common.h
For some reason it was locally defined everywhere.  Move a single
definition into common.h instead.

Change-Id: Ie2fad74acccd89e40fcbb0f47258d2e14e0f8285
2026-01-24 07:54:24 -05:00
Aidan MacDonald
97dce282b4 echoplayer: add USB support
Enable high speed USB for the Echo R1. Includes reasonably
complete support for full speed USB on the STM32H743 since
that was necessary to debug why it wasn't working at first
(which turned out to be a bug in memcpy, not a hardware or
driver issue).

Change-Id: Ie713195b22ba88c79b9b0d6eb289cb9ccd2763c2
2026-01-12 19:13:23 +00:00
Aidan MacDonald
671320b5d1 echoplayer: implement basic power-on / power-off logic
Use cpu_power_on as a GPIO to keep the main power supply
enabled when running from battery.

Change-Id: Ic79283a0cc640585a0297e11f9dcc2264ec9af26
2026-01-12 13:01:35 -05:00
Aidan MacDonald
2e532129d7 echoplayer: add storage & RTC demo in bootloader
Change-Id: I146e2205182239ed9d0176c23e3d0ad05e72a3be
2026-01-04 10:27:30 -05:00
Aidan MacDonald
83950bf233 New WIP port: Echo R1
The Echo R1 is a new open-hardware music player design, based
on the STM32H743 microcontroller. Schematics and hardware
documentation for it can be found here:

- https://github.com/amachronic/echoplayer

This is an incomplete port. The bootloader can be loaded using
OpenOCD and it can draw to the LCD using SPI. SDRAM is working
but hasn't been extensively tested.

Change-Id: Ifd2bee15c49868fbc989683d3ca14dce48bf3e18
2025-04-22 20:08:08 -04:00