SAME51 NVMCTRL AQW

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,
trying to program NV memory in Bank B using the Automatic Write With Quad Word Granularity (AQW) fails.

Procedure is:

CTRLA = 0xC2E0;     // write mode is AQW, cachedisable AHB1, AHB0 = disabled

INTFLAG |= 0x0076; // Clear all interrupt flags indicating errors during writing

while(READY == false)  ;  // Wait for ready flag

ADDR = 0x00040000;    // Write adress register

while(READY == false)  ;  // Wait for ready flag

(*(volatile uint32_t  *) 0x00040000) = 0x00000001;

while(READY == false)  ;  // Wait for ready flag

(*(volatile uint32_t  *) 0x00040004) = 0x00000002;

while(READY == false)  ;  // Wait for ready flag

(*(volatile uint32_t  *) 0x00040008) = 0x00000003;

while(READY == false)  ;  // Wait for ready flag

(*(volatile uint32_t  *) 0x0004000C) = 0x00000004;

while(READY == false)  ;  // Wait for ready flag

CTRLB = 0xA515;

 

When executing directly the procedure fails, when debugging with single step the procedure is successful.

Without polling the ready flag every time the procedure fails anyway.

 

Did anyone try this feature and has a sugesstion for a correction?

 

Many thanks

 

Best regards

Bernhard

 

BS