cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

New Contributor II

Hi,

We have CYBLE-224110-00 (PSOC 4).

We have a serious issue with our project.

We are working with the fixed stack bootloader project.

We reached a situation that when we add just one more static variable to the bootloadable code (doesn't matter which file/function/name), then things begin to fall apart when the bootloadable is running. The program manages to run but at various and consistent cases we can cause it to crash. If we remove the static variable then everything works fine in the same scenarios.

It's as if there is a memory issue of some kind.

We tried to increase/decrease heap and stack sizes in the code (based on what's written here: How to change Stack/Heap sizes of FIXED STACK BOOTLOADER project?

but changing them in either direction does not change the situation. Just to clarify, before we even attempted to change the heap and the stack, PSOC Creator indicated that our RAM utilization is at 93% and ROM utilization is at 99.3%.

We are basically stuck without the ability to understand what is the problem and how to fix it.

Any help would be appreciated.

Thanks,

David

0 Likes
Reply
1 Solution
New Contributor II

I managed to find the source of the problem.

The problem was due to a stack overflow during run time upon activation of a certain function.

We identified the route cause of the overflow - a large array was defined within the function --> so we simply reduced its size and it resolved our problem.

We identified the stack overflow using the code examples provided by Cypress as part of a "test package" they provided here:

https://www.cypress.com/documentation/application-notes/an89056-psoc-4-iec-60730-class-b-and-iec-615...

I recommend to use this test package and integrate it into ANY cypress code since this is a fantastic way to perform sanity/stability tests to your system.

View solution in original post

0 Likes
Reply
2 Replies
Moderator
Moderator

The resource utilization seems to be on the higher side and it appears that the project is running out of space.

What is the compiler optimization level set? Please ensure to set Removed Unused Function as False.

Also, provide us more insights on the project getting crashed. Try the “Attach to running target” option to understand where the bootloadable project is getting stuck.

0 Likes
Reply
New Contributor II

I managed to find the source of the problem.

The problem was due to a stack overflow during run time upon activation of a certain function.

We identified the route cause of the overflow - a large array was defined within the function --> so we simply reduced its size and it resolved our problem.

We identified the stack overflow using the code examples provided by Cypress as part of a "test package" they provided here:

https://www.cypress.com/documentation/application-notes/an89056-psoc-4-iec-60730-class-b-and-iec-615...

I recommend to use this test package and integrate it into ANY cypress code since this is a fantastic way to perform sanity/stability tests to your system.

View solution in original post

0 Likes
Reply