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

M7 data cache and Peripheral DMAs

I am using an Atmel/Microchip ATSAME70 Cortex M7 processor and was working on getting Ethernet GMAC driver working. The GMAC uses an internal DMA engine to transfer packets to SRAM.  I noticed that I was getting some HRESP errors with the DMA transferring data and the peripheral driver was not working.  I disabled the data cache and the driver works. 

The code polls the SRAM locations to see if a DMA has completed so I tried leaving data cache on and invalidating the cache before reading the SRAM but that did not fix problem. I was wondering if anyone knew of any problems using the data cache and DMAs in peripherals like this? 

Note every time I contact Microchip about such problems they inform me that they never test/run code with caching enabled, so they never see any problems. 

Thanks

Trampas

Parents
  • Yea, I keep hoping one will take the time to do good datasheets/drivers.  I spent days debugging the GMAC on the SAME70 only to find out the CMSIS pack provided my Microchip had the register addresses wrong, hence could not get drivers to work.  To add insult to injury they told me that the bug had been reported already, and of course they had not fixed the 2 year old bug. 

    The issue I am finding with SoCs is that most bugs are caused because of the poor datasheet and drivers, that is the example drivers do not check and handle all errors situations and are full of bugs.  Then the  datasheets are often wrong, for example Atmel datasheet for one processor indicates the internal pull ups can be used when pins are connected to peripherals, which is incorrect.  So most of my time is spent writing drivers and deciphering datasheets.  So once I learn a processor I try to stick with it for a few years.  

    My caching issue with the GMAC was also the write cache, specifically when sending a packet you write data to SRAM and then kick off DMA, so I had to flush the cache before kicking off the DMA.  

    I am debating if the best way to handle DMA memory caching is to make a non-cached section of SRAM using linker sections or if it is faster/better to flush the cache.  I assume that the non-cached SRAM might be faster than constantly flushing and invalidating the cache, as you invalidate more memory than just the DMA memory space. 

Reply
  • Yea, I keep hoping one will take the time to do good datasheets/drivers.  I spent days debugging the GMAC on the SAME70 only to find out the CMSIS pack provided my Microchip had the register addresses wrong, hence could not get drivers to work.  To add insult to injury they told me that the bug had been reported already, and of course they had not fixed the 2 year old bug. 

    The issue I am finding with SoCs is that most bugs are caused because of the poor datasheet and drivers, that is the example drivers do not check and handle all errors situations and are full of bugs.  Then the  datasheets are often wrong, for example Atmel datasheet for one processor indicates the internal pull ups can be used when pins are connected to peripherals, which is incorrect.  So most of my time is spent writing drivers and deciphering datasheets.  So once I learn a processor I try to stick with it for a few years.  

    My caching issue with the GMAC was also the write cache, specifically when sending a packet you write data to SRAM and then kick off DMA, so I had to flush the cache before kicking off the DMA.  

    I am debating if the best way to handle DMA memory caching is to make a non-cached section of SRAM using linker sections or if it is faster/better to flush the cache.  I assume that the non-cached SRAM might be faster than constantly flushing and invalidating the cache, as you invalidate more memory than just the DMA memory space. 

Children