Don't get its path unless we are about to generate it to avoid an
inaccurate list of generated files. Do this by keeping track of the path
in a variable instead of checking for the result on the filesystem.
This is somewhat strange and mixed in with the romfs file and
AP_Param.cpp, to disentangle later...
This will allow waf to avoid cleaning them and avoid unnecessary
regenerations.
Some slight changes to centralize the use of the output directory are
also performed.
The read buffer must be invalidated after a DMA read operation as
nothing guarantees an invalidation before the operation finishes
persists until after it's complete.
Quoth the ARM ARMv7M ARM (Architecture Reference Manual): "Entries for
addresses with a Normal Cacheable attribute can be allocated to an
enabled cache at any time, and so the cache invalidate operation cannot
ensure that the address is not present in an enabled cache."
Due to considerations surrounding how the buffer is actually used, we
end up needing an invalidate before and flush after the read op.
Not handling this correctly manifested as rampant dataflash corruption
using LittleFS on KakuteH7Mini (commit 33631df2) due to the driver not
seeing "busy" responses when polling the dataflash chip and having
written data be ignored. This scenario was, however, very fragile, and
everything worked correctly for some alignments of MCU code flash,
presumably creating different timing or cache influences.
It's not clear where else this could have caused an issue, the LittleFS
poll loop is perhaps unique in writing one byte then reading one byte.
Nevertheless, careful investigation with a debugger and logic analyzer,
along with understanding of the manuals, justify this as a proper fix
(and of course the corruption no longer manifests).
Fix to match line 570 of
`libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_resolver.py` which puts TX
first.
This swap has no consequence as `Shared_DMA` does not care about the
order of its arguments, but it's good to fix as it's incorrect and
confusing during debugging.
This is a no compiler-output change.
Read from the passed in variable instead of the global args object. By
default the variable is set to the args object's contents so there is no
change in behavior.
Note that much of this logic is fishy and/or wrong; that is preserved
and left to be fixed another day.
keeps these out of the main codebase which is nice, but also means we can catch these at configure-time rather than build time, which means CI will catch them