Shouldn't DMA_HandleTypeDef State be volatile?
Current structure is:typedef struct __DMA_HandleTypeDef { ... HAL_DMA_StateTypeDef State; /*!< DMA transfer state */ ... } DMA_HandleTypeDef;Interrupts can change the State value, but it's not volatile, so the co...