M
Martin Brown
Guest
On 23/02/2023 03:15, Sylvia Else wrote:
Today CPU time is cheap and most embedded controllers are way faster
than they need to be to do the job (this was not always true).
Checks and asserts can help in debugging code but if any of them have
side effects then it can make for unwelcome interesting behaviour when
the final optimised version is created.
The standard trick is to develop it with all the range checking on and
some form of postmortem call stack dump if it ever crashes and then
disable all the checking in production code but leave the post mortem
stack traceback and keep a copy of the map file and production code.
That way with a bit of luck you can identify and eliminate any in field
failures reliably. This presupposes you have a way to communicate with
the embedded firmware and do a soft reset to regain control.
Unlike hardware which wears out with time software should become more
reliable with accumulated runtime in different environments.
--
Martin Brown
On 23-Feb-23 6:05 am, John Larkin wrote:
https://en.wikipedia.org/wiki/Timeline_of_programming_languages
Now I\'m told that we should be coding hard embedded products in C++ or
Rust.
But can you afford the memory and time overheads inherent in run-time
range checks of things like array accesses?
Today CPU time is cheap and most embedded controllers are way faster
than they need to be to do the job (this was not always true).
Checks and asserts can help in debugging code but if any of them have
side effects then it can make for unwelcome interesting behaviour when
the final optimised version is created.
The standard trick is to develop it with all the range checking on and
some form of postmortem call stack dump if it ever crashes and then
disable all the checking in production code but leave the post mortem
stack traceback and keep a copy of the map file and production code.
That way with a bit of luck you can identify and eliminate any in field
failures reliably. This presupposes you have a way to communicate with
the embedded firmware and do a soft reset to regain control.
Unlike hardware which wears out with time software should become more
reliable with accumulated runtime in different environments.
--
Martin Brown