Announcements

Equip yourself to optimize PSoc4 MCUs for Evs at the EV Webinar. Click here to register.

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

PSoC™ 4 Forum Discussions

OmAb_4672891
Level 2
Level 2
10 replies posted 5 replies posted 10 questions asked

Hello,

I am attempting to make my own boards to use the CY8C4147AZI-S465 chips for CAN purposes. we have 2 identical boards. One of them will consistently load all code find. The other will enter the IntDefaultHandler randomly (It will sometimes go into main and sometimes get stuck there) Is there any solid way of troubleshooting this? We realize it maybe either hardware or software related but We have no idea of how to confirm which.

0 Likes
1 Solution

Hi OmAb_4672891​,

I understand the confusion now. I believe you are using PSoC Creator 4.3 and I was testing with PSoC Creator 4.2

After discussions with the internal team it is concluded that, we have removed support for "Trim with IMO" option in PSoC Creator 4.3 due to accuracy related issues . Sorry for the inconvenience.

So, in your case, we recommend you to continue using ECO for high accuracy clock.

We also have a code example to showcase how to start the ECO in PSoC 4100 S plus device correctly. In this example, the device is started with IMO and then switched to ECO in run time. You can try the same to prevent the start up code from failing.

File > Code example >  Using_ECO_PLL_Low_Level_APIs.

Please ensure you have followed these steps correctly to configure ECO and let us know the results.

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post

11 Replies
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

>>"One of them will consistently load all code find."

--> Can you please elaborate more on this?

>>"The other will enter the IntDefaultHandler randomly (It will sometimes go into main and sometimes get stuck there) Is there any solid way of troubleshooting this?"

--> Please run a simple LED Blinky program on your board to test whether hardware is working fine. If not, please check the board schematic with our PSoC 4100S development kit.

https://www.cypress.com/documentation/development-kitsboards/cy8ckit-041-41xx-psoc-4100s-capsense-pi...

--> Then you can run code examples of CAN from cypress on your board to check whether there is any CAN specific issue with your board.

https://www.cypress.com/documentation/code-examples/ce97311-psoc-4-m-can-simplex-communication-capse...

--> Once the above two steps are successful, you can check the firmware flow of your project compated with the code examples.

--> If still you are not able to find the issue, you can attach your project (simple version which reproduces the issue) for us to test.

Thanks

Ganesh

0 Likes
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi OmAb_4672891​,

Additionally, run a debug session and check out the call stack window. It will help us identify from where the control failed and entered the IntDefaultHandler. Please attach your project for further debugging.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

Hello, Thank you for your swift response. I am almost certain it is not my code as we have 2 boards that will enver go into intDefaultHandler ever. pastedImage_0.png

Running a debug session a few times, I noticed a few different call stacks. The above on is one of them, there is another which has an interrupt fault during the function CySysClkWriteImoFreq(24u);

0 Likes

It seems this if statement is being called if (errno == ENOMEM){

}

0 Likes

Hi OmAb_4672891

From your call stack, it looks like the function hasn't reached main(). This could be a hardware issue (example: improper clock configuration/Wdt/  other schematic issue). Could you please attach your schematic for a quick review? Also, please attach your project file so that we can debug the issue at our end.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

Dear Bragadeesh, unfortuantely I do not have the schematics as they non disclosed and for that I apologize. My next question is this. I have a cy8c4147azi-s465 semi conductor. I am attempting to make a network of these chips via CAN. To do this we installed an ECO on our pcb's and that has been giving us problem. I have looked at a differnet project that uses CAN and was able to get it to work however our ECO is not working correctly. Is there a way, within the cy8c4147azi-s465 to use the internal clock to enable CAN? it says i must use the WCO to trim the IMO down to acceptable accuracy but there is no option to do this in the clock configuration.

Thank you again for your swift replies.

0 Likes

Hi OmAb_4672891​,

CAN protocol requires clock accuracy of +/-0.5 % to operate at speed greater than 125 kbps.

PSoC 4100 S plus device has an IMO which has a  accuracy of +/- 2 % making it unsuitable for CAN speed greater than 125 kpbs.

You have the following options to achieve this accuracy for higher CAN speeds:

1. Use an external crystal oscillator (ECO) to source the HFCLK. Make sure the ECO is configured correctly.

2. Use a WCO (external to PSoC), trim the IMO.

You should be able to find the trim with WCO option in the clock configurator. Make sure you have enabled WCO in the Low frequency tab of the clock configurator.

pastedImage_2.png

I'm attaching the snapchot of the external clock connection to PSoC 4 from the CY8CKIT-149 that has CY8C4147AZI-S475 in it.

pastedImage_3.png

Reference schematic:

https://www.cypress.com/file/443821/download

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

Hello,

I was wondering how to do that. I would enable the WCO in the LFCLk tab but i don't get that option to trim the imo accuracy with the WCO. is there a way to enable it?

0 Likes

Hi OmAb_4672891​,

I understand the confusion now. I believe you are using PSoC Creator 4.3 and I was testing with PSoC Creator 4.2

After discussions with the internal team it is concluded that, we have removed support for "Trim with IMO" option in PSoC Creator 4.3 due to accuracy related issues . Sorry for the inconvenience.

So, in your case, we recommend you to continue using ECO for high accuracy clock.

We also have a code example to showcase how to start the ECO in PSoC 4100 S plus device correctly. In this example, the device is started with IMO and then switched to ECO in run time. You can try the same to prevent the start up code from failing.

File > Code example >  Using_ECO_PLL_Low_Level_APIs.

Please ensure you have followed these steps correctly to configure ECO and let us know the results.

Regards,

Bragadeesh

Regards,
Bragadeesh

Thanks again!

0 Likes

The issue was not caused by that but that was also very helpful to see. The issue was because we did not have a capacitor between ground and the SWD pins I believe. Once we implemented these in our PCB's we stopped seeing the issue as much.

0 Likes