rms measured from STM32F407 is varying slow after changing input
Running rms calculates the value of all samples from the time the rms block was reset. So if you remove the input the STM32F407 should immediately start sending zeros, but the rms value calculated is the average of those zeros plus all the previous readings.   

If you want the rms value to change in milliseconds then you need to reset the rms block after some milliseconds. To get an accurate measurement of mains voltage the block period should be a multiple of one AC cycle. One way to do this might be to detect zero crossings and use this signal to reset the rms block.