> This noise doesnt exists in my desktop PC. Any comments? Could it be related to the USB ports?
Ground potential differences / shifts ?
And, desktop PC use to have metal casings that reduce EMI radiation.
> However, when I switch to my laptop once again, it acts as the "weird signal".
But to be clear, I see this as a mere symptom. The cause is in your firmware, I believe. Since I have neither the full code nor the hardware, I can only give pointers. (And since I am not a NXP employee, I can't spend hours on analysis).
But from browsing through your code, it seems the PWM settings are coming from the host, via serial interface. And here, individual USB host settings for the serial adapter like package size and mode do influence the UART timing. But still, I suspect the cause is in your firmware code.
I would not set the PWM cycle in a "hard" fashion in a loop, but store it and only apply in the PWM cycle interrupt. You would need to check the reference manual how the timer unit reacts upon changing settings mid-cycle.
And second, I would avoid using floating point both for calculations and for printf/scanf() calls, especially on a M0. You could do the calculation perfectly fine with integer.
And I would check what this "Chip_UART_IRQRBHandler()" is doing.