My plan is to at least get something working before planning the best course of action.
I'm not afraid to brick the Omega as it has the recovery mode - I did indeed screw up the device yesterday messing around with this stuff (so it certainly is dangerous), but recovery mode saved my bacon.
Because of how dangerous these calls are, it could be that it's best to play it safe and wrap them in minimal OS mode switches - haven't settled on this. My plan is to make an open-source library that people can use with their GBA game development to access the Omega's file-system. After a formal library is created, then I am thinking about adding the support for the Omega's file-system in a popular open-source GBA emulator, which would absolutely help out GBA ROM developers.
EDIT: To answer your actual question (sorry I was rambling there) this code is just to initialise the file system and print out if it worked out not. 100% of the code is running in IWRAM, just to make sure it's not an issue with ROM execution, but if it does switch from ROM execution it absolutely needs to return to it.
FRESULT res = f_mount( &FileSystem, "", 1 );
u32 IWRAM_CODE Read_SD_sectors(u32 address,u16 count,u8* SDbuffer)
SetRompage(0x8000);//change to OS mode
SetRompage(0x200);//return to game mode on PSRAM
//SetRompage(0x00);//return to game mode on NOR first slot address