Reading Flash Memory Contents

I am working on a research project that requires us to read bits from the flash memory of the PixHawk controller(we are using mRo Pixhawk Flight Controller). We want to compare memory contents before and after deployment to ensure that the device memory hasn’t changed. Is there any library(or resource) in Python/Java/C/C++ that can help me read flash contents from PixHawk serially?

I am looking for something equivalent to the AVR library for Arduino. Please help

TIA