No Option to Debug in (Inherited) PSoC 4 Project

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

cross mob
jvavra_UICO
Level 4
Level 4
25 replies posted 25 sign-ins 10 replies posted

Inherited a legacy PSoC 4 project and am trying to get up to speed on the family and PSoC Creator. After building the project, under the "Debug" menu, the options for Debug, Debug without Programming, etc. are greyed out. If I try to "Select Debug Target", the box is empty. I compared this with a sample project from the PSoC 4 Pioneer kit (which debugs fine), and can't seem to figure out if there's a setting or something I'm missing. 

Anyone have any suggestions?  

0 Likes
7 Replies
BiBi_1928986
Level 7
Level 7
First comment on blog 500 replies posted 250 replies posted

Hello.

Under Debug menu, try Attach To Running Target.  Just a guess.

What are you using to program PSoC4?  Miniprog or Kitprog from KIT-042?

Does the project use a bootloader?

0 Likes
jvavra_UICO
Level 4
Level 4
25 replies posted 25 sign-ins 10 replies posted

Thanks for the reply. Unfortunately, when I bring up "Attach to Running Target", there also are no targets listed under "Attached Targets". I used the Miniprog to program the PSoC4. The project does use a bootloader, but I'm definitely running the application code. 

0 Likes

A-ha!  A bootloader is used.

Okay, so to use debugging when a bootloader is present, it's not straight forward.  You need to bypass the bootloader to get to the bootloadable.  Read section 7.3 of AN73854.  You have a couple of options here.
PSoC™ Creator - Introduction to bootloaders (infineon.com)

0 Likes

Thanks for pointing me to this. According to this doc, I need to convert my bootloadable project to a normal project. However, when I go to Project>Build Settings, under the "Code Generation" tab, I don't have an option for "Application Type". Any ideas? 

My settings:

nobbyv_0-1674058592569.png

 

Needed settings:

nobbyv_1-1674058662008.png

 

 

0 Likes

Looks like that doc was mostly written before Creator 3.2.  From Creator 3.2 (GCC) and up, the Build Settings menu looks just like you've shown.  The project type is automatically detected as being "bootloadable" or "normal " when you add or delete the bootloadable component from the schematic.  The second screen shot of PSoC3 using Keil is a different story and I know nothing about Keil.

So, simply delete the bootloadable component, re-build, program PSoC FLASH, and you'll have a "normal" project.

BTW, are you sure the bootloadable is running?  You should have been able to "Attach to Running Target".  This is very strange.  When I do this, I use Tools, Bootloader Host, program the device and then go back to Debug menu, Attach to Running Target.  Something is still not right with your setup.  Hmmmm.... more thinking.

0 Likes

I eliminated the bootloadable component and corrected the few errors that this generated. However, when I go to "Program", the "Select Debug Traget" box is empty. Any ideas? 

0 Likes

I usually see that when my Miniprog is not able to find the target PSoC.  Maybe it's not able to catch it on reset?  In those cases I usually power through the Miniprog rather than external power if possible and that gives me better luck.

As an aside related to an above post,  when I go to debug a project w/ a bootloader, I usually disable the Bootloader component in the application and wrap up any calls to the bootloader API in something like this:

 

#ifdef CY_BOOTLOADABLE_Bootloadable_H
Bootloadable_Load();
#endif

 

Essentially looking for the bootloader API header to confirm if the component is enabled to avoid compiler complaints that the Bootloadable_Load() function doesn't exist (since it doesn't generate the API when the component is not enabled).  Makes it slightly easier to quickly switch between debuggable and non-debuggable by only disabling the Booloader component and rebuilding.