Commit graph

38862 commits

Author SHA1 Message Date
Aidan MacDonald
b8b55128b1 firmware: make config.h IRAM usage defines more readable
Split up the single massive '#if' condition into several
smaller blocks to make it easier to understand what is
happening. Compiled binaries should remain unchanged.

Change-Id: I65359cb55c60d71d5a424cafda83c83bddb20974
2026-01-29 18:38:16 -05:00
Solomon Peachy
1f30d9efe3 FS#13769 - Updated Italian translation (Alessio Lenzi)
Change-Id: Ieeefb31f70f1924c8de25ea640ad75e17cac40f5
2026-01-29 17:16:51 -05:00
Solomon Peachy
2a4cb29b27 synopsis-dwmac: Make ep0_buffer (and friends) static.
Looks like an oversight

Change-Id: Ia730fd1f9e19ca31add581400372dfacead7b452
2026-01-28 15:55:45 -05:00
Solomon Peachy
62200ff4d7 FS#13768: Updated Serbian Translation (Ivan Pesic)
Change-Id: Iae502c6757823ae00ec22a65d83c3e151d0c4c55
2026-01-27 19:48:37 -05:00
Solomon Peachy
83420e0a95 voice: Switch default en_GB TTS voice to Piper's 'alba' #2
The previous commit just switched the voice used for the nightlies; this
changes the default used when using the cmdline voice.pl tool without
the user overriding it with something else.

Change-Id: I5144fe66e355f3c41677ca37226a743667d291bf
2026-01-27 17:45:19 -05:00
Solomon Peachy
30ff611529 voice: Switch default en_GB TTS voice to Piper's 'alba'.
Does better for short phrases/words than 'semaine'. "No/Yes" and
numbers in were pretty bad in particular.

Change-Id: I795ad57b7ca8c5b8a3fe0c2b721ef167d0dd9f6d
2026-01-27 17:27:20 -05:00
Solomon Peachy
b349eea2c9 usb: fix yellow in eb69211791
Bootloaders with HAVE_USBSTACK but without HAVE_BOOTLOADER_USB_MODE end
up with USB_NUM_DRIVERS of 0 which leads to a warning due to a signed
number being checked to see if it's >= 0.

Work around this temporarily; the proper fix is to not build usb_core
and its class drivers when BOOTLOADER & !HAVE_BOOTLOADER_USB_MODE

Change-Id: I1b41140d31ba9df6b4c760478c4265d4e5584963
2026-01-27 15:23:47 -05:00
mojyack
eb69211791 usb: introduce USB_NOTIFY_CLASS_DRIVER
this invokes specified class driver's notify_event method.
initial purpose is to trigger a callback from isr, like a timer event.

Change-Id: Id600e9f0d8840a12da779d5a15783edf14bd76b5
2026-01-27 13:39:58 -05:00
Solomon Peachy
fce8248267 usb: Hopefully resolve the red in 41f9285def
First, leave USB_FULL_INIT on for all non-bootloader builds; this is
needed for devices that don't have a USBSTACK (such as most hosted
targets and ones that provide USB<>ATA in hardware)

Then unwind another hack that is no longer needed now that USB_FULL_INIT
is not set in most bootloaders.

Change-Id: I00881ac76b2469e5cd7700bad2203c58ef1e09e7
2026-01-27 13:05:57 -05:00
Solomon Peachy
a5b589cf5b vx747: Target needs HAVE_BOOTLOADER_USB_MODE
Change-Id: I735cbf5575b0368741f2b8147eb80a71e0a67c98
2026-01-27 12:21:42 -05:00
Solomon Peachy
41f9285def usb: Clean up the pile of USB_FULL_INIT exceptions
The intent here is that when HAVE_USBSTACK is not defined, or we are
in a bootloader wthout HAVE_BOOTLOADER_USB_MODE, a device may still
some of USB subsystem initialized.  For example, this may be needed
to enable USB-based charging functionality.

So, get rid of the blanket enables of USB_FULL_INIT based on target SoC,
enabling HAVE_BOOTLOADER_USB_MODE on targets that need it, and clean up
the initial mess. Most of this mess is because usb_core.c has no sense
of USB_FULL_INIT or not, and is always included when HAVE_USBSTACK is
set (even in bootloaders without BOOTLOADER_USB_MODE), but dealing with
that latter case will come later.

Change-Id: I7f805b89dded39aeea2db9038209780069e3b600
2026-01-27 10:27:09 -05:00
Aidan MacDonald
7b77752aff echoplayer: reduce USB storage buffer size for bootloader
This saves 64k of BSS, freeing up space in AXI SRAM.

Change-Id: I37079c5fa5ed2b969d70622491dbf0f4dca2c759
2026-01-27 10:05:20 -05:00
Aidan MacDonald
d15bb5f848 stm32h7: move LCD framebuffer to AXI SRAM
Framebuffer access consumes a lot of SDRAM bandwidth.
Moving it to AXI SRAM should be a big improvement as
it's around 8x faster (2x clock speed, 4x bus width).

Also take advantage of explicitly assigning sections
to the special :NONE segment, which means they will
not appear in any ELF program header and thus aren't
visible to the bootloader. They can then overlap
areas used by the bootloader -- by the time they're
written, the bootloader will be long gone -- making
it easier to make efficient use of SRAM.

Change-Id: I2392fd23b17472cc08dc5fe4556f6def3cc186ed
2026-01-27 10:04:59 -05:00
Aidan MacDonald
77f30202d0 tools: detect Git revision correctly in non-default worktrees
In a non-default Git worktree, the .git directory is replaced
by a file containing the path to the real .git directory. This
breaks the version detection logic because it expects .git to
be a directory.

Passing the root of the source tree via "git -C", letting Git
figure out if we're in a repo or not, solves this problem.

Change-Id: I595f1a694258cad490b1a4964f8ae9d51ae76de1
2026-01-27 09:22:31 -05:00
Aidan MacDonald
2b09078b92 stm32h7: set 8-byte alignment on main and irq stack
Explicitly set 8-byte alignment as per the AAPCS, which
says the stack should be 8-byte aligned at a public ABI
boundary.

Change-Id: Ie60b664718119ea576e7c6b5efaac011eb907531
2026-01-27 13:31:12 +00:00
Solomon Peachy
e1d10c938a config: Targets must opt-in to bootloader USB storage support
ie by only using HAVE_BOOTLOADER_USB_MODE, instead of blanket-enabling
USB_ENABLE_STORAGE for numerous SoC families

Change-Id: Ief433a1d693876072779e714883438c0012ba2e0
2026-01-27 07:36:40 -05:00
Solomon Peachy
33678c6c3c s3c2440: Fix some compilation failures in the mini2440 bootloader
This whole platform has bitrotten, may be prudent to just nuke it.

Change-Id: Ia12e7ebc160484e57a74dd689d6095d22f3dbfd9
2026-01-27 07:11:32 -05:00
Solomon Peachy
b562c9d58f Fix red introduced in 33d0a3ef
Many bootloaders broke because they have only partial USB
implementations -- HAVE_USBSTACK but without HAVE_BOOTLOADER_USB_MODE...
and a pile of exceptions.

Those exceptions need to be cleaned up properly, but for now, get the
build going again by wrapping the new ack-tracking bits with the
USB_FULL_INIT define created by the above conditions.

Change-Id: I936d4989b8c8195ee30d53808f61104a4986942a
2026-01-26 22:56:47 -05:00
Solomon Peachy
89cf5b57e6 Fix yellow from 1951c17e0b on targets with USB_NONE
gui_usb_screen_run() is a do{} while(0) macro, resulting in an unused
variable warning in the "caller"

Change-Id: I4b4b00ef38decfb5cc9db0da3d81ad0c9a4207d1
2026-01-26 20:36:58 -05:00
mojyack
33d0a3efa3 usb: enter to exclusive disk mode only when required by usb config
currently, exclusive disk mode was enabled at the same time as the
usb insertion. when multiple usb configurations exist, this is not
appropriate.

manage it in the core and enable it only when necessary.

Change-Id: Iadbec05fad1d1319471233227ae0e72c12079295
2026-01-26 19:52:22 -05:00
mojyack
1951c17e0b pass event data to usb_acknowledge
add second argument to usb_acknowledge.
it can be used for more appropriate connection tracking that does not
rely on timeout in the future.

Change-Id: I8a44366b7c7a1f944524c4ba8ecd6d9673746a65
2026-01-26 19:47:09 -05:00
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
7868e45edb elf_loader: add elf_loadmem() to load file from memory
Change-Id: Ib68b0e8b610d45713a2d5480da015cc4295f2676
2026-01-25 19:51:07 -05:00
Aidan MacDonald
843322f898 elf_loader: add generic callback-based loader
Change-Id: I1dd972a585bc7c805e32c9665d13e248663ccc73
2026-01-25 19:50:12 -05:00
Aidan MacDonald
a610998ea4 firmware: add simple ELF loader for static binaries
This is a small & simple ELF loader which just copies
program segments from disk to memory. It only supports
static binaries right now.

Change-Id: I8944feb5b9dafcc5c56e12383aed25e2718ad7ea
2026-01-25 18:19:51 -05:00
Aidan MacDonald
21ba79d431 echoplayer: disable parts of system_init() for application
Most of system_init() should only be performed once after
reset, and is not safe to re-run when the bootloader jumps
to the application.

Change-Id: I4d2e804ce4884da13b9167ddcda860ef3b5ba7d0
2026-01-25 14:12:29 -05:00
Aidan MacDonald
f642d19c20 echoplayer: initial Echo R1 keymap
Change-Id: Id720378a55425070ef69ca002c2e954cc1e147cf
2026-01-25 17:26:44 +00:00
Solomon Peachy
ecb8014a06 FS#13766: Updated Vietnamese Translation (Chu Khanh Hanh)
Change-Id: I3cf9cf9814a549e49eecd7bed0e364c2b2b1439b
2026-01-25 08:59:10 -05:00
Aidan MacDonald
98990df08f stm32h7: update linker scripts for ELF boot
Use flash & AXI SRAM for the bootloader, ITCM/DTCM and
SDRAM for Rockbox. Hardly the most optimal use of SRAMs
but it's good enough to get started.

Fixes the Echo R1 app build, which wasn't fitting in
AXI SRAM.

Change-Id: I4f7e5f618d27b553e5ff8dec1d5c4c61ac9d8eb0
2026-01-25 08:48:44 -05:00
Aidan MacDonald
174b33cc07 stm32h7: rename startup code .init.text section to .init
Do this for compatibility with INIT_ATTR, which uses the
.init section.

Change-Id: I473c29e3d38e5d5a563c98fc910d725024072735
2026-01-25 08:47:44 -05:00
Aidan MacDonald
bd73e0dd42 stm32h7: do bss/data setup in crt0 for bootloader only
Change-Id: I67798a4370b01127364c40328549a6d3081545cf
2026-01-25 07:47:32 -05:00
Aidan MacDonald
e3bf9210ab echoplayer: disable boot data
The current bootdata mechanism won't work well for
ELF binaries so disable it.

Change-Id: If6721ef88a38af76711bbdc6b561529dc3b33557
2026-01-25 07:47:22 -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
Roman Artiukhin
58ace97a4e hiby: r1_patcher: embed hiby_player.sh
Make it a single-file, self-contained script.

Change-Id: Idb3e375f1f9774c9328288765c7d1c7c1e01e2d3
2026-01-24 20:20:01 -05:00
Roman Artiukhin
db8494d4e0 hiby: r1_patcher: quote path variables
Change-Id: I5d03b4ecec1847c404a2f2400b648469023942e2
2026-01-24 20:20:01 -05:00
Solomon Peachy
b056191e89 Translation updates:
* German (Wilfried Winkler)
 * Korean (Hoseok Seo)
 * Polish (Adam Rak)
 * Slovak (Matej Golian)
 * US English (Myself)

Change-Id: Ief4de3c8f6aa88aba6ffae9969d22763a1969743
2026-01-24 17:44:36 -05:00
Aidan MacDonald
721bfac475 echoplayer: don't wake LCD automatically in bootloader
Normally the bootloader won't enable the LCD, but we
still want to call lcd_init() at startup to keep the
code simple.

Change-Id: I866ecd7c81b6c5e6acdd57f5d7680400df3f54f4
2026-01-24 14:05:21 -05:00
Aidan MacDonald
1afa2ca50d echoplayer: implement LCD enable and shutdown
This also gets rid of the long startup delays which were
leftovers from debugging.

Change-Id: Iee9fec1fb210a006a1af53bf47535d7ba2ffa904
2026-01-24 14:02:57 -05:00
Aidan MacDonald
025d641d1f echoplayer: detect boot reason during system_init
Change-Id: I6fdc16e7476044b43e11d3f63d971bd8de860c58
2026-01-24 14:02:26 -05:00
Aidan MacDonald
86c975ee88 echoplayer: set cpu_power_on pin high as early as possible
Change-Id: I6b7343cc81973c4c0a14396b2ecd622fc1c65d30
2026-01-24 13:02:03 -05:00
Aidan MacDonald
319fdcc506 echoplayer: implement reboot using RTC_OUT pin
Change-Id: Ibeda362030c2885abe1366fb3256e925ea27538c
2026-01-24 13:01:56 -05:00
William Wilgus
6035b1fc1b [lua][BUGFIX] splash_scroller FS#13753, 13754 unicode + default font/fg/bg
FS#13753 - Rocklua error splash don't display part or full filename when
it is non-ASCII
FS#13754 - Rocklua error splash don't reset gui settings (bg, fg and font)

when using signed char unicode codepoints can show up as < '0'
code was looking to remove control chars < ' ' which also removed
unicode code points in the process

Change-Id: I48074a7854f2bee195ca554e1f86505fe5567db6
2026-01-24 09:19:19 -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
Aidan MacDonald
65b97917ca echoplayer: replace stm32 clock init with target specific init
Change-Id: Ib858f95b4cedba261ea669d3339ea1497e970982
2026-01-24 08:09:42 -05:00
Aidan MacDonald
eea0c128f4 echoplayer: move system_init() out of generic stm32 code
With only one target, it doesn't make sense to have a
common system_init() yet.

Change-Id: I0f6d37709d60bb309fb16ecb9b0870297a189cc4
2026-01-24 08:08:40 -05:00
Aidan MacDonald
386be9dfcc stm32h7: refactor and simplify clock helper functions
The clock helpers are only used for leaf clocks of single
peripherals, which don't benefit from reference counting.

Change-Id: Ica5685e7bc0fce621ae46f758f0ad0b1dcfb2789
2026-01-24 08:07:25 -05:00
Aidan MacDonald
9471cec2ab stm32h7: make cache initialization function public
Change-Id: I460887977f18bfb411d33b6d4efc24ac04cb4050
2026-01-24 08:04:34 -05:00
Aidan MacDonald
62332841cf stm32h7: refactor systick code
Make systick setup less hardcoded, and create a public API
for use by targets, in preparation for moving system_init()
into target-specific code.

Improve the implementation of udelay to make it more robust
against timer wraparound.

Change-Id: I21bb8821cfd1d7e4049fac6e6a4548d80a4276f7
2026-01-24 08:03:50 -05:00
Solomon Peachy
b76cb3bf62 xduoox3: A couple of minor cleanups in the bootloader
* When SHOW_LOGO is not defined, print the version at the
   same time as the logo would have been displayed
 * Don't re-init the display after every message in USB mode

Change-Id: Ida0f5643b1d57004877ec5c42fc14028f53b1c89
2026-01-24 07:55:56 -05:00