ATSAME70 Flash write isuue

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

I have the following problem. I need to store data into the user signature area of the flash memory. I'm using the flash_write_user_signature function from AFS 3.31.0. But the program hangs in the mentioned function, particularly in this line :

*p_dest++ = gs_ul_page_buffer[ul_idx];

It just throws to the dummy handler and hangs there.

I also was trying to use the ordinary flash write but it hangs even at the unlocking stage.

 

I don't know how to explain such behavior because the FLASH_PROGRAM_EXAMPLE provided by Atmel Studio works perfectly even if I add the user signature read/write functions.

 

Maybe there is some conflicting periphery in my code or something else, I can't manage.

 

Kind regards,

Sergey

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's most likely ending up in the dummy handler from a hard fault, probably from accessing a bad memory location.  

Are you using the "Flash - SAM Flash Service API" ASF module in your project?

I don't recall any specific config settings needed to use it, other than running the flash_init() function with the appropriate access mode and wait states for your chip (I'm using a different SAM chip).  

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

little hint from the datasheet (atmel-11296 sam e70 19-jan-16) page 146 section 21.4.3.8 ... note on the end of the page: "Note that during the sequence, the software cannot be fetched from the Flash."

Last Edited: Tue. Jan 16, 2018 - 03:55 PM