You may find some useful clues in the OpenLog Artemis firmware. Link below.
While I was testing that part of the code, I wrote this note:
//With v2.1 of the core, very bad things happen if the IOMs are disabled.
//We must leave them enabled: https://github.com/sparkfun/Arduino_Apollo3/issues/412