I've been practicing using SAME70-Xplained with I2C and SPI and got something working with those. Next in my "To Learn" list is QSPI in SPI mode.
As you can guess by the fact this post is here, it didn't go so simply as I expected. I can't get any signal out from QSPI. I had same kinds of problems with learning SPI, which ended up being a missing check on enabling clock. I think the problem might be again some missing configs/definitions, which enables a critical part of QSPI.
I found it clearer to work with ASF wizard, getting my hands immediately to the code with documentation in the comments.
int main (void)
/* Initializing system clock, hardware, clock for QSPI */
/* Get the default config for QSPI(don't know any better yet) */
struct qspi_config_t qspi_conf;
/* Set QSPI speed to 10MHz and init with default configs + this 10MHz speed */
qspi_conf.baudrate = 10000000;
status_code_t status = qspi_initialize(QSPI, &qspi_conf);
if (status != STATUS_OK)
while (1); // If init fails, the program hangs here
/* Some dummy data for testing */
uint16_t data = 0xFF00;
uint16_t ndata = ~data;
/* Write data and flash led to show this loop is running */
qspi_write(QSPI, &data, 1);
qspi_write(QSPI, &ndata, 1);
/* Enable ICache and DCache */
/* Enable QSPI */
#endif /* CONF_BOARD_H */
The rest of the files are unmodified from what the ASF wizard provided.
I also tried the Atmel Start driver example without any modifications, but no QSPI pins (PA11-14) gave any signal, which I could see in my scope.
Is there anything obvious I've missed? For example, do I need to make some additional definitions for the clock in conf_clock.h? I've been trying to google a "Hello world!"- like example for QSPI, but I can't seem to find any easy enough for total beginner.
I got something out by testing SPI NOR Flash middleware from Atmel START, once again pointing towards my test program missing some configurations/initializations. I think I'll eventually get the workings of the QSPI driver by reading the SPI NOR Flash middleware code. If someone experienced enough still ends up bumping into this, I'd still appreciate an explanation on which definitions and functions I'll need to make in order to start writing stuff into QSPI channel.