I don't assume anything. Why is it matter, at the end of the day, input array must have the right word I type in (at least from a certain point in time).
Whats wrong with the code that it prints for input "A5" , this:
By declaring the variable bytes inside loop(), it comes into existence each time loop() runs, and is initialised to 0 each time.
If you want the variable to keep its value between each run of loop(), make it static:
static int bytes = 0;
Also, you probably should only print the input string when it changes (i.e. when you add a new character to it). So try moving the print statement inside the while loop.
So if I take the bytes out, how do I know when to initialise it again to zero ? If you can't really know when you got your data ? Do I need to set an end sign inside my data protocol ?
(it used to work with a 16Mhz just like that, but now with a 48Mhz I guess its faster)
What you have posted should work, with the caveat that you may get spurious newlines depending on how the incoming serial content is chunked. Realistically, if you are using the serial monitor then you will almost certainly get one chunk per line of input and I would expect his to work just fine.
So perhaps you should post your entire sketch like the sticky post says to. See snippets-r-us.com. See if you can produce a minimal sketch that reproduces the problem.