Architecture and settings optimization procedure of a TES frequency domain multiplexed readout firmware