SAME70 QSPI XIP Quad SPI External Flash Memory SMM Write Problem

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

Hi all,

 

I am trying to write to a flash memory (S25FL064L) via QSPI, I have enabled SMM (serial memory mode) in the QSPI module. I use XIP (execute-in-place) example from Atmel Start.

 

I can read from it just fine, but when I try to write, my logic analyser shows that the SAME70 is appending at least 3 bytes per byte to the buffer, e.g. if I write 0x30, it will output 0x30, 0x20, 0xFF, 0xFF.

I tried to change the pointer type from uint8_t to uint32_t, it just made the matter worse.

 

The library access the flash memory via location 0x80000000 (SMM). Seems like this block from hpl_qspi.c is causing problem (dst is 0x80000000):

/**
 * \brief Memory copy function.
 *
 * \param dst  Pointer to destination buffer.
 * \param src  Pointer to source buffer.
 * \param count  Bytes to be copied.
 */
static void _qspi_memcpy(uint8_t *dst, uint8_t *src, uint32_t count)
{
	while (count--) {
		*dst++ = *src++;
	}
}

 

I have read an appnote: https://www.microchip.com/wwwApp...

 

It did mention about strongly ordered memory, but, I am not sure how to enable it using the APIs from Atmel Start.

 

Any ideas?

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

The problem can be seen in the following logic analyser capture:

 

QSPI Issue