by anonli · 4mo ago · 0 comments
The 1KB of SRAM is admittedly very tight (even WCH's 10-cent RISC-V parts usually give you 2KB), so you are strictly in bare-metal, carefully-managing-your-stack territory.
Plenty of DIY projects used ATtiny2313 with V-USB. That's a pure software USB implementation bit banging the IO pins (not a USB stack on top of hardware USB support)+ your application logic squeezed into 2K of flash + 128 bytes of ram.
Chips like this are great for digital glue logic. Read a sensor, read a button press, blink some LEDs with simple state machine or control loop.
Anything to save a few bucks on a 6264 SRAM component :-)
C support is basically universal these days, very few chips require you to program in only assembly anymore.
(had to disable debug symbols, though)
Why should that be any harder than C?
I was extremely surprised by how much functionality is packed into "core", and runs without an OS when using freestanding rust. Even stuff that requires an allocator can run provided you provide your own heap!
A cool example of this was implementing fmt::Write for a memory mapped uart console thing. Then implementing a kprintln! macro that supports all of the formatting machinery that you are use to. This worked without even a heap available.