This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DMA doesn't work in Keil, but it works in Atmel Studio

Hello to all,
I' using Keil MDK ARM IDE to work on a a project with an ATSAML21E18B connected to a shift register. I want to use DMA to send data through SCLK and MOSI pins. To configure my project i used the AtmelStart online platform.
I connected the SPI pins to a digital signal analyzer and I program/debugg it with the Segger J-Link.
The test program I'm working on is simple:
1- init the hardware
2- fill an array with fixed value
3- send it using DMA
4- a callback function blinks a LED when DMA has finished the data sending
5- loop 2,3,4 forever

Everything seems correct, instead it doesn't work: using Keil ARM 5.29 my code compiles (compilation without optimizations) then runs, it seems to set up all hardware devices correctly, but when my code calls the "spi_m_dma_transfer(...)" function (line 65) nothing flows out from SPI pins, and the DMA callback is never called.
I couldn't understand where the problem was until I tried to compile the exact same project with AtmelStudio: it worked!
I setted up a Keil project in the same folder with the AtmelStudio project: compiling with keil does not work, compiling with AtmelStudio works.

After two week of sleepless nights I can't understand how the same code could work differently using two IDEs and I don't know which test can still be done.
I attach here the project (Keil and AtmelStudio project) and I hope some of you can help me.
Thanks!

0