It is working now.
The problem was that Cpu.c calls TPM_DRV_PwmStart(tpmTmr1_IDX, &tpmTmr1_ChnConfig0, 0U); and I was calling it again in main.c
When debugging, by default execution stops in main.c at PE_low_level_init();. Apparently if there is enough time between calls to PM_DRV_PwmStart(tpmTmr1_IDX, &tpmTmr1_ChnConfig0, 0U); there is "no problem". So when executing from flash with no debugger, the 2 calls happen very quickly and the TPM doesn't work. Removing the call from main.c solves the problem.