[update] factorize flash writing code. use core_id to identify.