Which programming device are you using to program PSoC. You can refer to the PSoC5LP programming spec available at this link:
Have you tried programming via PSoC Programmer(PP).If yes, please provide a screenshot of PP with error.
As mention I use an on board FTDI (FT232H). So in fact PSoC Programmer is of no help here as it doesn't support FTDI based programmer.
I read many time "Psoc5lp Device Programming Specification" and didn't find any clue about what's going on.
I have access to TC TAP and DAP TAP JTAG operation (EXTEST,IDCODE) so I have no issue with device configuration (4-wire jtag as in factory setting)
The only difference with factory device is I think that my code is running in it (which toggle a pin).
My issue is at step 3 of programmer guide where the read doesn't return IDCODE through debug port not jtag operation.
So my guess is that read/write from debug port are not done properly at step 2 because the cortex is now running code
The question is : What could I do with TC TAP to check that I can issue proper read and write with DAP TAP
Since the programming is working first time, can you check if you had changed the 'Debug Select' in your PSoC Creator project. This can cause issue while reprogramming.
Do you have Cypress programmer MiniProg3 ? You can give a try on reprogramming via MiniProg3 and eliminate similar issues.
# What could I do with TC TAP to check that I can issue proper read and write with DAP TAP
To use the DAP TAP, you need to put the TC TAP in Bypass.
39.4.1 JTAG Interface Implementation