Tock: Unused chip drivers still take up RAM

Created on 1 Oct 2017  路  4Comments  路  Source: tock/tock

I was looking through RAM use on Signpost today, and wanted to mark this down while I was thinking about it. It's not a blocking problem in any way, but seems like undesirable behavior.

On Signpost (the Audio Module specifically) the USB client driver for the SAM4L takes up 288 Bytes of RAM even though it isn't in use and isn't included in the board's main.rs file. The RAM is spent on the USBC struct (allocated as pub static mut here).

My guess as to why it's taking space at all is because it's included in the chip.rs and mod.rs files in order to connect it to the interrupt handlers. This feels generally undesirable.

Most helpful comment

@alevy is there any issue with me trying my hand at this ticket?

All 4 comments

My guess as to why it's taking space at all is because it's included in the chip.rs and mod.rs files in order to connect it to the interrupt handlers. This feels generally undesirable.

It's indeed exactly that. I have changes (long overdue for master) I'm getting ready to make into a PR that change how we handle interrupts (as discussed on the mailing list previously), which will get us part of the way there (removing the ISRs array), but will not fix the issue in chip.rs's handle_interrup dispatch code.

This seems like a job for some sort of macro, but i'm not totally sure how to do it.

@alevy is there any issue with me trying my hand at this ticket?

@enzuru of course not!

This is addressed by the design in #2069, but needs to be applied to every board/chip combo before this can be closed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ppannuto picture ppannuto  路  8Comments

alistair23 picture alistair23  路  8Comments

gendx picture gendx  路  6Comments

bcantrill picture bcantrill  路  9Comments

bradjc picture bradjc  路  3Comments