BUG? - Cannot place breakpoints in PSoC Creator 4.1

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I have found that under certain peculiar circumstances I cannot set a breakpoint in PSoC creator 4.1. I am using a PSoC 4200 - this may not be relevant. The IDE says ...

   

Programming started for device: 'PSoC 4200 CY8C4245AX*-483'.
Device ID Check
Erasing...
Programming of Flash Starting...
Protecting...
Verify Checksum...
Finished Programming
Device 'PSoC 4200 CY8C4245AX*-483' was successfully programmed at 07/05/2017 17:27:52.
Warning: Cannot set breakpoint: 'C:\PSoC Projects\Workspace1\BreakpointTest.cydsn\File1.c:16'.  Encountered error (No line 16 in C:\PSoC Projects\Workspace1\BreakpointTest.cydsn\File1.c).
Continuing target program
The target program has stopped at: file: main.c line: 18 function: main address: 0x00000162
Continuing target program
The target program has stopped at: file: File1.c line: 15 function: tryToDebugFunction address: 0x0000016A
Continuing target program
The target program has stopped at: file: File1.c line: 16 function: tryToDebugFunction address: 0x0000016E
Continuing target program
The target program has stopped at: file: File1.c line: 17 function: tryToDebugFunction address: 0x00000174
Continuing target program
The target program has stopped at: file: File1.c line: 18 function: tryToDebugFunction address: 0x0000017A

   

Warning: Cannot set breakpoint: 'C:\PSoC Projects\Workspace1\BreakpointTest.cydsn\File1.c:16'.  Encountered error (No line 16 in C:\PSoC Projects\Workspace1\BreakpointTest.cydsn\File1.c).
Warning: Cannot set breakpoint: 'C:\PSoC Projects\Workspace1\BreakpointTest.cydsn\File1.c:16'.  Encountered error (No line 16 in C:\PSoC Projects\Workspace1\BreakpointTest.cydsn\File1.c).

   

This shows that I can single step through line 16 of File1.c but it refuses to set a breakpoint for me. I can set a breakpoint in the disassembly window by address, rather than line number. I can also set normal breakpoints in main.c.

   

After much head banging it appears that this peculiarity seems related to the inclusion of a file referencing C varargs functionality, as provided by stdarg.h even if this functionality is not called.

   

I include an offending project, stripped down to its bare essentials.

   

Can anybody help?

   

Roger.

1 Solution
markgsaunders
Employee
Employee
50 sign-ins 10 solutions authored 5 solutions authored

The breakpoint defect is fixed in PSoC Creator 4.1 Update 1. This is now available on the web or through your update manager. Sorry for the pain we caused - we failed to spot a change in the GNU C compiler that broke instruction breakpoints in our debugger.

View solution in original post

0 Likes
20 Replies
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I made a few changes to have your project looking similar to my standards. Main reason seems to be the "external" in your prototype definitions. Even the keyword external in "pico_printf.h" hindered the breakpoint. The .h file for the File1.c was missing. I changed the device to a PSoC4-M which just was at hand...

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I agree, your project for some reason allows breakpoints. I left out the File1.h as I added an external declaration to main.c in my original and I wanted to kieep it simple.

   

I have modified the your project changes slightly to include a call to the varargs function while removing all "external" keywords.

   

I believe these are implicit, in any case: linkage is either external or static,the default being external unless specified in declarations.

   

The new modified project is still not working. Thanks for your efforts though!

   

I enclose the new version. I know the method of calling the varargs function is not as it would be in practice.(va_start, va_end macros required).

   

The larger project from which this was taken does it all correctly and the pattern has worked fine in earlier versions of PSoC creator. I suspect it's something to do with the GCC toolchain.

   

Regards

   

Roger.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Try changing  in Project -> Build settings -> Arm -> Compiler options -> Optimization to "none".

   

 

   

Bob

LiSi_1648326
Level 1
Level 1
First like received First like given

I have the same issue.

   

PSoC Creator 4.1 cannot set the breakpoint, but with the same code PSoC Creator 4.0 - can.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum.

   

Can you please post your complete project so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Having a similar problem. Am able to step through the file line by line, including stepping through the lines that I am trying to set the breakpoint on, but any attempt to set a breakpoint on a line in a file results in "Warning: Cannot set breakpoint: <file path>. Encountered error (No line xxx in <file path>).

   

I am able to set the breakpoints fine by function name for the functions in the file, btw.

0 Likes
Anonymous
Not applicable

The Same problem also for me. Everything was fine in version 4.0

0 Likes
Anonymous
Not applicable

Same problem here.  It was working great in 4.1, now suddenly it's not.  I've cleaned, wiped all non-essential files and started over from a minimal archive and I can't even set a breakpoint in main().  And yet, the debugger will stop at the beginning of main(), and single-step works fine.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Confirmed

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Same problem for me. I Updated to 4.1 and did a clean compile. Breakpoints don't work anymore. I'm back on 4.0 now and wait for a solution.

   

What I see, is that I can set a breakpoint while in edit mode, but as soon as I start debug mode (F5), then the breakpoint changes to another type of breakpoint. See attached images.

0 Likes
Anonymous
Not applicable

Same for me.  I can set breakpoints in main.c, but not in other .c source code files.

0 Likes
wcc3
Level 4
Level 4
10 likes received 10 replies posted 5 replies posted

Same problem.  I've counseled by colleagues to postpone upgrading to PSoC Creator 4.1 until this is fixed.

0 Likes
Anonymous
Not applicable

Is there a straightforward way to revert projects to PSoC Creator 4.0? I cannot open the projects any longer with the older version.  When I try to swap out with the old project file from before I upgraded, I get a bunch of nasty internal errors when trying to build, for example:

   

 

   

Elaborating Design...
Elaboration client 'CyDesigner.Device.FitLib.DesignWideResources.Interrupts.CyInterruptModel, cyfitlib, Version=4.0.0.432, Culture=neutral, PublicKeyToken=null.CyInterruptModel' failed with exception System.InvalidCastException: Unable to cast object of type 'CyDesigner.Common.Base.CyDictionary`2[System.String,CyDesigner.Common.Db.DeviceDb.Catalog.CyResourceEntry]' to type 'System.String'.
   at CyDesigner.Device.FitLib.DesignWideResources.CyResourceModel.ExtractPriorityOutOfRangeRangeErrors(CyStsMsgNoticeSet set, CyPriorityInfo info, IEnumerable`1 instIds, CyDictionary`2 storedData, CyLookupInstDelegate getInstFromId, ICyResourceModel agent, ICyResourceModelMgr dwrMgr, CyDictionary`2 errorMapping)
   at CyDesigner.Device.FitLib.DesignWideResources.Interrupts.CyInterruptModel.UpdateErrors()
   at CyDesigner.Device.FitLib.DesignWideResources.CyResourceModel.PublishErrors()
   at CyDesigner.Device.FitLib.DesignWideResources.CyResourceModel.Run(CyElabInfo eInfo)
   at CyDesigner.Common.Db.CyS3Db.CyBGElaborator._runClient(CyElabInfo eInfo, ICyBGElabClient client)

0 Likes

I do not think this is related to the breakpoint issue in PSoC Creator 4.1. It is hard to tell but this looks more like a corrupt project file. I am not sure how that could have happened but PSoC Creator 4.1 will automatically save a copy of the project (see the backup folder) when opening projects saved in older releases. I would verify that the backup project opens in 4.0 and try opening it again in 4.1. for safety - make your own backups too! If this still fails, please archive the project and forward it to me.

0 Likes
markgsaunders
Employee
Employee
50 sign-ins 10 solutions authored 5 solutions authored

The breakpoint defect is fixed in PSoC Creator 4.1 Update 1. This is now available on the web or through your update manager. Sorry for the pain we caused - we failed to spot a change in the GNU C compiler that broke instruction breakpoints in our debugger.

0 Likes
Anonymous
Not applicable

I downloaded Update 1 of psocofand it did not fix the problem in Psoc creator 4.1

0 Likes

"psocofand" ??

What exactly is your problem? Which Creator version are you using, which OS?

Can you please post your complete project or a shortened version that shows the error so that we all can have a look at all of your settings. To do so, use

Creator->File->Create Workspace Bundle (minimal)

and attach the resulting file.

Bob

0 Likes
Anonymous
Not applicable

Sorry Bob,

My problem is in debugger mode

I can set breakpoints in main.c, but not in other .c source code files. (are disabled)

0 Likes

Which Creator version are you using, which OS?

Can you please post your complete project or a shortened version that shows the error so that we all can have a look at all of your settings. To do so, use

Creator->File->Create Workspace Bundle (minimal)

and attach the resulting file.

Bob

0 Likes
Anonymous
Not applicable

Psoc creator 4.1 with the Update 1

0 Likes