Actually, it’s not a feature of erase function, but rather how flash erase works
There’s a separate register for floating point exceptions and it should be much easier to notice when this sort of thing happens. I’m not sure that it’s supposed to lead to a bus fault.
As for data alignment, I’ve done it like this in the past: size = (size + (alignment - 1)) & -alignment;
. It looks like you’d have to align bufferTime to 32 to get data size aligned to 4k when you multiply it by 48000