Other than running an OS, how do MCU developers protect against inadvertent resource overlapping? For example if I call some library and have it use some ADC or TIMER on my board, but somewhere else, try to use that ADC (or the pin previously assigned to that ADC) or TIMER for some other purpose, there seems to be nothing to prevent that and it could lead to mind numbing debug sessions.
In an OS this is usually implemented (for this very reason) through ideas like "handles" that represent "ownership" of some resources, so I suppose without an OS on the MCU there's not a lot of protection.
It seems that code I write for an MCU has unrestrained freedom to manipulate any aspect of the hardware it likes, no policing of any kind, yes that means there are no costs slowing me down but also no protection against human error or subtle bugs, possibly bugs that can be easily be found during normal tests.
Of course I'm assuming here that an MCU OS does typically provide such features, I might be wrong of course...
Thoughts?
In an OS this is usually implemented (for this very reason) through ideas like "handles" that represent "ownership" of some resources, so I suppose without an OS on the MCU there's not a lot of protection.
It seems that code I write for an MCU has unrestrained freedom to manipulate any aspect of the hardware it likes, no policing of any kind, yes that means there are no costs slowing me down but also no protection against human error or subtle bugs, possibly bugs that can be easily be found during normal tests.
Of course I'm assuming here that an MCU OS does typically provide such features, I might be wrong of course...
Thoughts?
Last edited: