snikeguo opened a new issue, #16412:
URL: https://github.com/apache/nuttx/issues/16412

   ### Description
   
   Is the stm32_dmapreflight check necessary? I can still successfully mount 
the filesystem and read/write when CONFIG_ARCH_HAVE_SDIO_PREFLIGHT is set to 
'n'. However, setting it to 'y' results in a "dcache unaligned" error.
   ```
   #if defined(CONFIG_ARMV7M_DCACHE) && 
!defined(CONFIG_ARMV7M_DCACHE_WRITETHROUGH)
     /* buffer alignment is required for DMA transfers with dcache in buffered
      * mode (not write-through) because a) arch_invalidate_dcache could lose
      * buffered writes and b) arch_flush_dcache could corrupt adjacent memory
      * if the maddr and the mend+1, the next next address are not on
      * ARMV7M_DCACHE_LINESIZE boundaries.
      */
   
     if (buffer != priv->rxfifo &&
         (((uintptr_t)buffer & (ARMV7M_DCACHE_LINESIZE - 1)) != 0 ||
         ((uintptr_t)(buffer + buflen) & (ARMV7M_DCACHE_LINESIZE - 1)) != 0))
       {
         mcerr("dcache unaligned "
               "buffer:%p end:%p\n",
               buffer, buffer + buflen - 1);
         return -EFAULT;
       }
   #endif
   
     return 0;
   ```
   
   
![Image](https://github.com/user-attachments/assets/1acbf8ba-909a-4de5-9b05-67d568d81bb6)
   
   ### Verification
   
   - [x] I have verified before submitting the report.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to