2022-04-15 12:10 PM
Hello,
I am using stm32f767 as a microprocessor. After power off, the codes are deleted from the microprocessor. But when I checked with the STlink Utility, I saw that the codes are stored in the Flash memory. Is the reason of non operative processor after power off related with some parts of the code not stroing flash memory properly or hardware issue?
Thank you,
2022-04-16 11:09 AM
After a quick research, I found this link, https://electronics.stackexchange.com/questions/446048/stm32f4-discovery-board-only-works-in-debug-mode
Then I check the system tick timer, its preemption priority is 15. So this may cause the problem? @TDK
2022-04-16 11:37 AM
By the way, how the equation should define ideally and enable FPU? @TDK
Edit: I fixed with
double AmpModFreqCalculation = 0;
AmpModFreqCalculation = round((1000000.0 / (ModulationFreq * 128.0)));
2022-04-16 11:44 AM
For hardware and C language there is no such a thing as "no value". If the variable is uninitialized, it could also be zero. Division by zero is typically unacceptable and should be avoided.
2022-04-16 01:11 PM
"Not working" and "working" are not sufficient explanations. You haven't provided much to work with. Clearly there's a bug somewhere in your program, but you haven't illustrated where it may be. Without insight, we're just guessing.
Don't guess at what the problem may be, debug your code systematically, set breakpoints, find out which functions are failing, output info to UART you can use to debug, etc.
2022-04-18 10:15 AM
@TDK I placed multiple breakpoints at certain points (UART receive, the signal generation, and UART Transmit) on the code. In debug session, the code successfully passed from all breakpoints, and I didn't get any error messages like before. But the interesting thing is that I couldn't get the signal correctly. On the other hand, after flashing the code, I get the correct signals on my interface while the debugger was connected to the PCB.
2022-04-18 11:03 AM
@TDK One more thing is that while I was check the memory details, I saw that the variables declarations were appeared in the RAM section. I guess that this is the reason to not working the system after powered off. So how can I declare the variables to store in the flash memory?
Edit: I saw the DAC_A_Write and DAC_B_Write in the FLASH .data section. But the DACA_Buf is still not in the FLASH memory part.