2023-11-15 01:08 AM
Hi, may have some reference on writing flash into STM32C0 using STM32CubeIDE? I tried to write program just to eraser flash and it enter the function HardFault_Handler(). Here are my codes:
2023-11-15 01:20 AM
I noticed that STM32C0x will enter HardFault_Handler after the myFlash_init() function. May I know how to it cause and how to avoid?
2023-11-15 01:36 AM
Hello @Hollis_K ,
Are you executing your code from Flash or Ram ?
Also, there is an example available on the STM32Cube_FW_C0_V1.1.0 library called "FLASH_EraseProgram" (https://github.com/STMicroelectronics/STM32CubeC0/tree/main/Projects/NUCLEO-C031C6/Examples/FLASH/FLASH_EraseProgram). You can try it and see if it is working (it should).
Best regards,
Simon
2023-11-16 12:53 AM
Hello @Simon.T ,
I am trying to execute my code in flash.
Thanks for the information, i will try the example and understand the algorithm. If there are any issue, will inform here again, Thank you.