cancel
Showing results for 
Search instead for 
Did you mean: 

Store Codes in the Flash Memory in the STM32

AE104
Senior

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,

15 REPLIES 15
AE104
Senior

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​ 

AE104
Senior

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)));

Piranha
Chief II

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.

TDK
Guru

"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.

If you feel a post has answered your question, please click "Accept as Solution".
AE104
Senior

@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.

AE104
Senior

@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.

0693W00000LyF3vQAF.png