2019-07-28 11:20 PM
We are using STM32F722VET6 MCU in one of our project.
Memory defined are in linker as below:
RAM : 256KB
ROM : 512KB
Stack : 4KB
We have configured below peripherals and developed an application code using user defined functions. Which is working as expected.
• UART1, UART2
• SPI1, SPI2, SPI3
• GPIO`s
But when we define few more functions and call them then the application behaves abnormally, below are our observations.
• We are able to compile & download the code (using ST-LINK) but when we execute the code it malfunctions.
• Most of the global variables defined with some constant values shows the garbage/null characters in debug mode
We have created a sample code using STM32CubeMX and integrated our application code in it. But unfortunately, this also gives the same problem.
Please find attached screenshots of Flash & RAM consumed by our application and Linker file for Stack, heap, RAM & Flash memory assignment.
2019-07-29 01:02 AM
First things I would check and shutdown to become stable...
can you check the power rails ? or is it a nucleo board ?
can you check the VCap pins?
is Boot0 held low or floating ?
turn off the Cache
increase the heap
set debug to -o0 and set a break point in the hardfault.
when it becomes unstable pause and check your hardware registers.
Usually a run away buffer pointer is the cause, and crap is being written into registers..
2019-07-29 01:07 AM
Assuming it is a software problem you'll need to put your developer pants on and debug the situation.
Instrument the code so you can determine the flow and interactions in the code and evolve your understanding of the issue beyond "not working".