gotnull

Tag

stm32

26 posts tagged with "stm32".

9 min Rusty Nail Reading a Game Boy cartridge through a GBFlash The console's USB host port meets a cartridge reader that pretends to be a CH340 serial chip. By the end of the day the firmware read and validated a real cartridge header. 8 min Rusty Nail Speculative execution against the SNES sound chip The SNES core was losing four million cycles a frame waiting on a sound chip on another board. Predicting the answer lifted Super Mario World from 35 to about 50 fps. 8 min Rusty Nail A flight recorder for firmware Building a recorder that captures a good run and a bad run of the same firmware workload so a tool can find the first difference that matters. 8 min Rusty Nail Proving where the SNES bottleneck was Days optimising the HDMI coprocessor because every symptom said it was holding the SNES back. The measurements pointed at the wire instead. 9 min Rusty Nail Profiling the SNES core on the H7 The from-scratch SNES core matches the reference emulator to the cycle. Five optimisations measured on hardware, and a profiler that says the problem is memory. Workbench 1.3 desktop: title bar reading Workbench release, 363960 free memory, with the RAM DISK and Workbench1.3 disk icons on the blue desktop 7 min Rusty Nail The emulated Amiga boots Workbench 1.3 The Amiga core on the STM32H753 boots a real Workbench 1.3 floppy to the desktop, and what it took to get the floppy controller right. 9 min Rusty Nail Kickstart 1.3 runs under budget on the STM32H753 First hardware numbers for the Amiga core: a real Kickstart 1.3 ROM executing deterministically at a p99 of 2.51M cycles per PAL frame, against a gate of 3.35M. 10 min Rusty Nail Planning USB floppy support Four transport dialects from 1998 and a FAT12 layer nobody ships, which is why the first firmware milestone is just reading descriptors. 6 min Rusty Nail The console's second shell Two days building the console's second shell, including a crash hunt that ended eight kilobytes from the stack floor. 10 min Rusty Nail Cattle Crisis from 9 fps to 58 One day of hardware A/B tests on the H753. The biggest single win was a compiler flag I should have set weeks ago. 8 min Rusty Nail Game Boy first light Two days from a feasibility study to DMG code on the TV, with the console's SPI video wire carrying two frame geometries at once. The crash pipeline end to end, with real timestamps from the defmt log 14 min Rusty Nail A crash reporter for a bare-metal console Giving the console a crash reporter that survives the reset and emails me, and the ways an STM32H7 loses data across a warm reset. 8 min Rusty Nail A 9 by 9 demoscene square in the launcher header The launcher's blinking sparkle became a 9 by 9 pixel demoscene with seventeen tiny effects dealt from a shuffled deck. 8 min Rusty Nail Why the speakers started clicking The morning after deleting the old Lua core, everything played and then the speakers started clicking. A command trace found three lines of channel semantics and a missing crossfade. 6 min Rusty Nail The fixed-point Lua core becomes the default Stage 9 of the runtime migration, ending the night at 59 fps on jumper wires after a one-byte regression that cost 19 carts. 8 min Rusty Nail An evening of unrelated fixes Three unrelated fixes from one evening. The biggest was a cartridge that finally keeps its saves; the strangest was an iterator that duplicated the player. 6 min Rusty Nail z8lua lands behind a flag The new Lua core measured against the old one on identical silicon, with a licensed PICO-8 as the oracle and a per-cart compatibility matrix. Mean Lua time per cart frame, split into update and draw, against the 60fps and 30fps budgets 7 min Rusty Nail A runtime baseline before the Lua swap A permanent benchmark and input tapes recorded from real play, so the new Lua VM has numbers to beat before it lands. 6 min Rusty Nail Reading the framebuffer out of RAM The standalone build sends nothing back to a host, so before I could redesign the boot splash I had to work out how to screenshot a screen my Mac cannot see. 6 min Rusty Nail Planning a flash cartridge for the console Picking a W25Q flash chip for a physical PICO-8 cartridge and mapping how the firmware would read it. Nothing is built yet. 8 min Rusty Nail The HDMI board I bought before reading the datasheet I bought a 50-pin RGB888-to-HDMI board, then counted the pins. The Nucleo never had 24 to give, so the fix is probably a second microcontroller whose whole job is HDMI. 6 min Rusty Nail A divide per pixel Profiling the PICO-8 runtime found a stretched-sprite blit doing an integer divide on every pixel, on a chip with no fast divide. 6 min Rusty Nail Moving the SPI panel to DMA The SPI blit was a blocking row-by-row write that stalled the console for about 13 ms every frame. DMA fixed it and the data cache nearly broke it. 6 min Rusty Nail The SPI panel and me I had a working HDMI path at 12:48am. The next morning I picked up the tiny SPI screen instead and spent nine hours reinventing flicker. 6 min Rusty Nail The SPI panel, from a blank screen to 25 MHz Getting the desktop off the USB stream and onto a real LCD, then climbing from 1 MHz to 25 MHz without losing the audio. The PCM5102A I2S DAC breakout, front and back - line-out jack and solder-jumper pads on the purple board, with the SCK/BCK/DIN/LCK/GND/VIN header along the bottom edge 5 min Rusty Nail Getting sound out of it Wiring an I2S DAC to the console over SAI and DMA, and why the audio stayed silent for most of a day.