Problems writing to Flash or to the Flash latch buffer

Discussions around product based on ARM Cortex M7 core.

Moderator: nferre

Posts: 1
Joined: Tue Mar 01, 2016 12:46 pm

Problems writing to Flash or to the Flash latch buffer

Tue Mar 01, 2016 2:30 pm


I tried to write my own flash programming routine. Basically I copied the example 'FLASH_PROGRAM_EXAMPLE'. However I always get a hard fault exception at the point where I write the data to the latch buffer. If one want to look at the corresponding line it is in flash_efc.c line 655 and simply says in a loop:
*p_aligned_dest++ = gs_ul_page_buffer[ul_idx];

I checked in disassembly mode and saw that copying the data from gs_ul_page_buffer to one of the registers works fine. It hard fault occurs at the moment that the data is written from the register to p_aligned_dest. This variable points to the flash address I want to program afterwards.

Unlocking and erasing the corresponding sector works fine. Also the above mentioned example works fine. So I guess it is not hardware problem.

Any idea?

Best Regards

Return to “SAM Cortex-M7 MCU”

Who is online

Users browsing this forum: No registered users and 1 guest