Hi,
I am new to Keil and I am implementing some crypto algorithms on a platform using ARM cortex M23. The platform has 3KB RAM and 30KB ROM.
When I debug, if the plain text size is small (2048bytes), everything is fine. But if I increase the size of plain text to 3072 or 4096, the encryption will be skipped and I cannot see the result.
I added breakpoint right before and after the encryption function call but it doesn't stop. It goes back to the beginning of the whole program directly after I click "step over" before function call.
It seems like the text is too large to be encrypted correctly, maybe there is an overflow? But the builder did not report any error, the RO/RW size does not exceed 30KB/3KB either.
I saw many people suggest to lower the optimization level of Keil, but I am always at -O0, why this still happens?
Thanks in advance.
Thanks for the reply!
I found out where is the problem:
There is hardware watchdog, which will reset the system in 180 ms if it is not served. When I encrypt larger text, it will take more time to process. If the execution time exceeds 180 ms, the system will be reset and I will see it goes back to the beginning of my program. If I disable it, everything is fine.
I will accept your reply and close this topic. Yet, our discussion about stack analysis is very helpful to me because I need to measure the memory usage, and stack consumption would be a good choice.
Thanks again for the discussion!