PSoC 1 Capsense fails when adding more code to the ROM but Code not being called.

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

cross mob
Tim
Level 2
Level 2
First solution authored 10 replies posted 10 sign-ins

Using CY8C20234 PSoC 1 Capsense as a capacitance meter.  It works just fine except when I added more code then the meter reading which is the IDAC reading gets a large disturbance which wrecks the measurement.  The running code is exactly the same when its working compared to the non working one that just has more code in the ROM, but it's not being called.  Maybe the signals in the PSoC are routed differently or maybe a ElectroMagnetic Disturbance.   Is there a netlist file that can be observed to check signal routing?  Any ideas what the problem might be or how to debug this?

0 Likes
1 Solution
Tim
Level 2
Level 2
First solution authored 10 replies posted 10 sign-ins

When your code starts to get towards 100% memory consumption remove any unnecessary code in your project.  Beware in the small memory model that the stack pointer starts at the end of used memory on the first page probably called page 0.  So even if code isn't being called memory is allocated and the stack grows smaller.  The large memory model puts the stack on page 1 which is much safer.  This consumes more Rom (Flash) but leaves the stack alone.  The tool behaves fine when memory is not over allocated.  Make sure to use code compression there doesn't seem to be any issues with that either.

View solution in original post

0 Likes
6 Replies
SampathS_11
Moderator
Moderator
Moderator
250 sign-ins 250 solutions authored 5 questions asked

Hello @Tim,

I suspect PSoC may be resetting under normal operation, when you have the extra code which is not called. It would be good if you can attach your project/s here for review.

Best regards,

Sampath 

0 Likes

I'm only able to share code privately still at the moment.  I will be rechecking for reset but so far that doesn't seem to be the issue and am wondering why you are saying that?  It does appear that the tool might be broken.  I use PSoC designer 5.4 and also moved the project to 5.1 with the same bad result.  Its possible that the BSS segment or a Data segment is overflowing?  The ROM has also overflowed yet the tool still produces the ROM file.  See the attached screen shot.  I think this more or less proves the tool is malfunctioning?

0 Likes
SampathS_11
Moderator
Moderator
Moderator
250 sign-ins 250 solutions authored 5 questions asked

Hello @Tim ,

I understand your explanation. In short, the error is caused because Designer creates a hex file, even if the project overflows flash capacity. Kindly let me see how best I can address this issue. I have a constraint that maintenance on PSoC Designer has been halted before five years. It might take a long time before I can respond to you, and I request you to kindly bear with me.

Best regards,

Sampath

0 Likes
Tim
Level 2
Level 2
First solution authored 10 replies posted 10 sign-ins

I might be starting to get to the bottom of this failure.  I simply might have ran out of  Flash (docs call it ROM) and ram at the same time.   And as a result of that it stressed out the tool causing me to go down some wrong paths in debugging the issue.  I also got a new error message today as a matter of fact that is attached here.  By the time you will be able to do anything with the tool I will be off on some other project.  My plan of attack is just to eliminate all unnecessary code from the project which will take a couple of days and expect success.  In the mean time if you have any errata documentation on the tool that you can post here that would be great.  It doesn't sound like it would be reasonable or practical to make changes to any of the old PSoC 1 tools now but I just need to learn to work around the issues with it.  

0 Likes
SampathS_11
Moderator
Moderator
Moderator
250 sign-ins 250 solutions authored 5 questions asked

Hello @Tim ,

You might try Code Compression. Details are available in Code Compressor.

Best regards,

Sampath

0 Likes
Tim
Level 2
Level 2
First solution authored 10 replies posted 10 sign-ins

When your code starts to get towards 100% memory consumption remove any unnecessary code in your project.  Beware in the small memory model that the stack pointer starts at the end of used memory on the first page probably called page 0.  So even if code isn't being called memory is allocated and the stack grows smaller.  The large memory model puts the stack on page 1 which is much safer.  This consumes more Rom (Flash) but leaves the stack alone.  The tool behaves fine when memory is not over allocated.  Make sure to use code compression there doesn't seem to be any issues with that either.

0 Likes