Hi McLuhan,
If you need 8 PWMs, then you can't use the TPM directly, as the TPM just contains two module, each module 2 channels.
But you can use the timer associated with the GPIO.
Use timer to generate 25ms, then when time is reached, toggle your 8 ports GPIO to realize the 50% PWM wave. When you want to get set 4 ports up and 4 ports down , just 4 set low, 4 set high.
About the code, you can refer to the SDK code, TPM timer, and the GPIO output code:
SDK_2.3.1_FRDM-KL03Z\boards\frdmkl03z\driver_examples\tpm\timer
SDK_2.3.1_FRDM-KL03Z\boards\frdmkl03z\driver_examples\gpio\led_output
Not PWM, as the TPM related PWM channel is not enough number for your usage, you can use the timer, when time is reached, the interrupt happens, then add the GPIO toggle code.
Wish it helps you!
Best Regards,
kerry