Browse Source

Fix SDIO buffer alignment (#21396)

ldursw 4 years ago
parent
commit
d172c71376
No account linked to committer's email address
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      Marlin/src/feature/binary_stream.h

+ 6
- 1
Marlin/src/feature/binary_stream.h View File

39
 
39
 
40
 #if ENABLED(BINARY_STREAM_COMPRESSION)
40
 #if ENABLED(BINARY_STREAM_COMPRESSION)
41
   static heatshrink_decoder hsd;
41
   static heatshrink_decoder hsd;
42
-  static uint8_t decode_buffer[512] = {};
42
+  #ifdef BOTH(ARDUINO_ARCH_STM32F1, SDIO_SUPPORT)
43
+    // STM32 requires a word-aligned buffer for SD card transfers via DMA
44
+    static __attribute__((aligned(sizeof(size_t)))) uint8_t decode_buffer[512] = {};
45
+  #else
46
+    static uint8_t decode_buffer[512] = {};
47
+  #endif
43
 #endif
48
 #endif
44
 
49
 
45
 class SDFileTransferProtocol  {
50
 class SDFileTransferProtocol  {

Loading…
Cancel
Save