I have an ARM Cortex-M0+ MCU (SAML21) that doesn't have a memory management unit or external memory interface, but I would like to use an existing library (libavif + libaom) to manipulate data that doesn't fit in the internal SRAM. In this case, a single uncompressed image frame won't fit in 40kB.
If I were to implement an image compression library myself given these constraints, I would store the image data in a large external RAM chip and access its contents over SPI while compressing the image.
Instead of spending weeks rewriting libaom to access memory through some kind of spi_ram_write
/spi_ram_read
functions, is there any kind of secret flags/tricks I can use with arm-none-eabi-gcc
to get it to replace memory accesses in certain sections of code with function calls (address and data as arguments) like this? This would obviously be incredibly slow, but that's fine for my application.
This is fundamentally the same as this question but I would like to know if it's possible to do in software rather than using linker options and the non-existent MMU.