cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4

Anonymous
Not applicable

I made three PCB board for my custom design which use CY8C4247 as main CPU. But I entered into a dead loop error on a board, and the other two boards didn't have this problem. The three boards had the same firmware. With the oscilloscope, I found the "dead" board's  power supply vary from 2.45 to 3.2v which my typical power supply is 2.8v, and the "good" boards' power supply vary from 2.78 to 3.01v. Is the power supply the reason of "dead loop"? How can I debug this problem?

0 Likes
13 Replies
Bob_Marlowe
Expert II

There is an infinite loop which is called when a hardware error occurs. Bad address, writing to code, executing protected areas, oscillator start fails and a couple of other reasons, all depend on the project. Best would be, because you are obviously in prototype design phase, to use a kitprog or a miniprog3 to debug your board and check the call stack to see what the cause is.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks Bob! Can u show me some guides how can I use "the call stack"?

0 Likes
Anonymous
Not applicable

My output display as following,

   

Error 'SWD error NACK' received while attempting to read memory 0xE000EDF0-0xE000EDF4
Error 'SWD error NACK' received while attempting to read all registers
Error: dbg.M0051: The connection to the device has been lost.

0 Likes
Bob_Marlowe
Expert II

Is your program designed for SWD Debugging? cydwr-file->System->Debug Select?

   

Assuming you have triple-checked your soldering and not forgotten the needed caps for the power lines...

   

Consider posting your schematics and project here, 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.

   

or

   

Create a support case (top of this page-> Design Support) Cypress will keep those information confidential.

   

 

   

Bob

0 Likes
Anonymous
Not applicable
        Yes, my program designed for SWD Debugging. Can u tell me all the reasons of entering into the infinite loop, so that I can check my design one by one.   
0 Likes
Anonymous
Not applicable

Hi, Bob. My "Call Stack" 's log as following

   

Level  Function

   

0         IntDefaultHandler()

   

1         <signal handler called>()

   

2        ClockSetup()

   

3        GetEvent()

   

4        GetSystemStatus()

   

5        main()

   

I found "ClockSetup()" appear almost every "Call Stack". Why "ClockSetup()" appear? I don't call this application.

0 Likes
Bob_Marlowe
Expert II

To keep this discussion shorter,  can you 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. Some info about clock generation (Xtal?) can help. Call stack looks like a required clock does not start.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi, Bob. Attachment is my project,  thanks very much for reviewing!

0 Likes
Bob_Marlowe
Expert II

You use a BLE chip, but as for now you do not use the radio. I would suggest that your problem might have to do with the 24MHz crystal. Since you do not use it, try to remove it from the high-speed clock definitions (only) and see if something changes.

   

 

   

Bob

0 Likes
Anonymous
Not applicable
        Do u mean that I should disable the "ECO" clock in lable "High Frequency Clocks" ?   
0 Likes
Bob_Marlowe
Expert II

Yep!

   

 

   

Bob

0 Likes
Bob_Marlowe
Expert II

Some additional info:

   

Is Pin P2[3] unconnected (floating) and not connected to GND or Vcc

   

You get an undefined "abs" because you did not #include stdlib.h which will reveal two other errors.

   

OpAmp property should be set to "Internal only"

   

 

   

Bob

0 Likes
Anonymous
Not applicable
        Thanks Bob! P2[3] is used as OpAmp's Output pin and I configed the OpAmp gain through it. So I set OpAmp as "Output to Pin"   
0 Likes