Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DaWe_291306
Level 1
Level 1
5 sign-ins First question asked 5 replies posted

Exasperating problem arose after a a minor code change to a running development board - every time I started the debugger it immediately exits with the message " Encountered error (Target disconnected See output window for more information.)".

I've eventually tracked the issue down to this line of code in cyfitter_cfg() in cyfitter_cfg.c (after setting the debugger to not run to main).  As soon as this code executes the debugger exits:

CYCONFIGCPY((void CYFAR *)(CYREG_PRT1_DM0), (const void CYFAR *)(BS_IOPINS0_1_VAL), 8u);

I could understand why changing the port configuration would break the debugger - what I haven't been able to locate is what values are being copied over (BS_IOPINS0_1_VAL points into flash ECC and I can't find anywhere where/how they are being set).

I've rebuilt the project multiple times, changed the debugger type from JTAG to SWD back and forth, tried a new minProg3 all to no avail.

When the issue started I had made a minor code change to the implementation code- nothing related to the system code and the fitter was not changed, so I'm at a loss why this would suddenly start.

Note the debugging option currently is set to "SWD+SWV" in the system configuration. 

Clearly the chip thinks these pins are being used for GPIO but I can't find anyway to convince it otherwise, or even the setting that changes it.

Any help appreciated.

0 Likes
1 Solution
DaWe_291306
Level 1
Level 1
5 sign-ins First question asked 5 replies posted

So, replacing the processor didn't solve the issue - it started again yesterday.  I did finally manage to isolate the issue to toggling P1[2] (I use this pin as an output in the design).  It isn't only setting the value of the drive register which triggered the issue, but even toggling the electrical value on the pin causes the debugger disconnect.

I have external reset (XRES pin) disabled in the design.

I suspect that somehow the environment is incorrectly setting the value in the NV Latch register, causing P1[2] to be setup as XRES, and toggling the pin is causing a processor reset. 

It's not clear how to read these registers during debug or how I could check them in the hex file - toggling the value results in large changes in the output HEX.

I've modified the design to avoid the use of P1[2].

View solution in original post

0 Likes
5 Replies