Skip to content

Commit

Permalink
Fix SDIO buffer alignment (MarlinFirmware#21396)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldursw authored Mar 24, 2021
1 parent fd8207d commit d172c71
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Marlin/src/feature/binary_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ inline int bs_read_serial(const serial_index_t index) {

#if ENABLED(BINARY_STREAM_COMPRESSION)
static heatshrink_decoder hsd;
static uint8_t decode_buffer[512] = {};
#ifdef BOTH(ARDUINO_ARCH_STM32F1, SDIO_SUPPORT)
// STM32 requires a word-aligned buffer for SD card transfers via DMA
static __attribute__((aligned(sizeof(size_t)))) uint8_t decode_buffer[512] = {};
#else
static uint8_t decode_buffer[512] = {};
#endif
#endif

class SDFileTransferProtocol {
Expand Down

0 comments on commit d172c71

Please sign in to comment.