Hi, I am using an ARM Cortex M7 processor (ATSAME70Q21 with the SAME70 Xplained kit) and having some issue getting the SPI working as a master. The code is below.
When I run it, I get trap into the Dummy_Handler that is for the unused interrupt. When the program run the spi_master_setup(), the spi_set_transfer_delay() seems to generate that unused interrupt when writing to the CSR register and force the program into a while loop in the Dummy_handler.
I am using the Atmel demo code for the SAME70 Xplained and just added the code to initialize the SPI as a master.
ioport_set_pin_level( PIO_PD25B_SPI0_NPCS1, 0 );
spi_master_setup_device(SPI0, &SPI_ADC1, SPI_MODE_3, BAUDRATE, SAME70_XPLAINED);
spi_read_packet(SPI0, Rx_Data, Rx_Length);
//Turn off ADC chip select
ioport_set_pin_level( PIO_PD25B_SPI0_NPCS1, 1 );