• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ArduPilot / ardupilot / 15090389039

17 May 2025 02:43AM UTC coverage: 60.241% (+0.2%) from 60.044%
15090389039

push

github

tpwrules
AP_HAL_ChibiOS: correctly verify flash on H7

Previously, the routine only read the data back from the data cache,
which was guaranteed correct as the cache would be allocated by the test
before programming then filled with the correct data during programming.

Invalidate the data cache area containing the just-programmed data to
ensure that it is actually read back from the flash memory and the
verification does something.

This is not trivial to check, but it can be done. To an unprogrammed
(all 1s) 256-bit flash word, program the byte sequence
`CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC1CCCCCCCC`
followed by (and without erasing) the sequence
`CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0CCCCCCCC`. This
will cause the flash memory (on the tested H743 revision at least) to
read `CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDCCCCCCCCCCCCCCCCCCCCCCCC0CCCCCCCC`
(and signal a one bit ECC error) and the verification check to fail.

Before this patch, the above sequence would always claim programming
success despire the read data not matching the programmed data.

Also clean up the pre-flash check for already flashed data. It should
not need a cache clear before the check as the flash normally operates
coherently with the data cache.

108487 of 180089 relevant lines covered (60.24%)

11227544.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.14
/libraries/AP_BattMonitor/AP_BattMonitor_Backend.cpp


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc