carlk3 / no-OS-FatFS-SD-SPI-RPi-Pico

A FAT filesystem with SPI driver for SD card on Raspberry Pi Pico
Apache License 2.0
284 stars 48 forks source link

SDIO code linked even if not used. #95

Open FreddyVRetro opened 3 weeks ago

FreddyVRetro commented 3 weeks ago

Hi,

Thanks a lot for your code, Not sure if you are aware but it is in the PicoMEM :)

The PicoMEM use the SD in SPI and I just saw that "sdio_irq_handler" is linked and take 0x1d8 bytes in RAM (that is huge :( )

I could remove it simply as I don't use the code as submodule, as I needed to merge the code with USB Ker read/Write.

carlk3 commented 3 weeks ago

...

Thanks a lot for your code, Not sure if you are aware but it is in the PicoMEM :)

I'm sorry, but what is PicoMEM?

The PicoMEM use the SD in SPI and I just saw that "sdio_irq_handler" is linked and take 0x1d8 bytes in RAM (that is huge :( )

472 bytes is huge? 0.17% of the 264kB of SRAM on a Pico, or 0.09% of the 520kB of SRAM on Pico 2? ...

FreddyVRetro commented 3 weeks ago

Ok :) Your name is on it :)

PM114_Close

It is a Pi Pico board emulating lot of things for ISA PC.

I removed the SDIO compilation from the makefile and removed the driver init code. Maybe I can reduce the sd definition variable as well.

https://github.com/FreddyVRetro/ISA-PicoMEM

https://www.youtube.com/watch?v=RACp9P-KUVE

carlk3 commented 3 weeks ago

Make sure you are compiling with -ffunction-sections, -fdata-sections, (and maybe -Os) and linking with --gc-sections.

FreddyVRetro commented 2 weeks ago

Hi,

Yes, 412 Bytes for a unused code is huge. It really seems you did not check what the PicoMEM is doing :) With this, I can add 4 Audio buffers for example.

I removed the SDIO code by removing the call to SDIO init in the initialisation code.