This relies on a trick I was not aware of previously, which is
that transitive dependencies absorb the additive set of features
enabled within a crate.
see
https://doc.rust-lang.org/cargo/reference/features.html#feature-unification
for the full description. but basically by referring to the feature
required in "aes" despite not being used in the crate but pulled
in by aes-gcm-siv, i can ensure that the transitive dependency
is in fact used.
I think this was always there but previously I just didn't understand
it correctly or didn't use it right when I tried to deploy it, but
this time I think I got it right.
the fifo_basic() test case - if not allowed to run for a while -
can lead to some strange lockups in the system fifos. it's
an interesting question as to why the fifo's can't be "cleaned up"
in a sane fashion when it gets scrambled, but for now, the answer
is I think "don't do that".
this makes on the go debugging a bit easier.
the memory initialiazation also has to be moved earlier because
the static initialization of the bool that determines which
console mode to use has to be clean early on. It may even
need to move into the asm stub, but would prefer to avoid that
if I can.
turns out...the memory test was subtly smashing stack. It made
sense during early bring up to do this quick test but I should
have retired it sooner.
Keeping it around for a little bit longer because chips aren't
fully brought-up and I could see this being a useful stub in
case we find an outlier that actually has memory access problems.
The main benefit of this is we don't have to remember to call
the "abort" function post-amble in case of an error: you can
just return an error type.
I took a pass at trying to convert all the argument parsing
using "idiomatic" rust. In some cases, it's nice. But in
some cases it's pretty clunky and hard to follow. I think
the clunkiness is outweighed by never having to forget to
call the abort function, and one can avoid the whole...
map_err().and_then() madness by just using more traditional
if/else with returns. I think that's a fine choice to make.
there is either a code bug or a compiler issue that is causing
something on stack to be smashed that is causing trouble for
the code base as a whole. Or it could be improperly initialized
statics? unclear. this needs to be worked through.
however, a series of changes were made that make the code
work. The biggest tell is that the code generally works perfectly
when optimizations are off, but when optimizations are on some
shenanigans have to happen to convince the compiler to not split
constant values across the entire arc of the function. More
diagnostics to follow.