May 17, 2019
02:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 17, 2019
02:16 AM
Hello,
I am using Cypress PSoC 5LP CY8C5888LT*-LP097 with PSOC 4.2
Flash used: 46204 of 262144 bytes (17.6%).
SRAM used: 60465 of 65536 bytes (92.3%). Stack: 2048 bytes. Heap: 2048 bytes.
When I enable speed optimization I get the following exception during runtime
I tried to Increase the Heap to 4K or 6 K but it dosn't help
How to overcome this problem?
Hossam Alzomor
Solved! Go to Solution.
Labels
1 Solution
May 20, 2019
04:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 20, 2019
04:17 AM
Hossam Alzomor,
Nothing looks obvious however check your code for the following:
- uint8 *rxdata points to an array of at least two bytes. If you only have a variable with one byte the line dumping the incoming SPI data into rxdata[1] will overwrite unknown data. This unknown data could be stack or other RAM with pointer information.
- You have a while statement that loops until at least one byte is available in the SPIM_1 Rx buffer. You might want to change the statement to: while(SPIM_1_GetRxBufferSize() <2); Since the next three statements are assuming that at least two bytes are being read from the SPI, you might want to make sure at least two bytes have been received. Your code only assumes one byte is available.
Hope this helps.
Len
Len
"Engineering is an Art. The Art of Compromise."
"Engineering is an Art. The Art of Compromise."
5 Replies