20210628 6.4.11
- Remove the "Blind Writes" option from scsi2sd-util. The firmware no longer
requires this option for improved write performance
+ - Fix firmware hang if there was no activity for a few minutes
20210508 6.4.4
- More bug fixes for firmware hanging during read/writes
\r
#include <string.h>\r
\r
-static const uint16_t FIRMWARE_VERSION = 0x064A;\r
+static const uint16_t FIRMWARE_VERSION = 0x064B;\r
\r
// Optional static config\r
extern uint8_t* __fixed_config;\r
\r
const char* Notice = "Copyright (C) 2020 Michael McMaster <michael@codesrc.com>";\r
uint32_t lastSDPoll;\r
+uint32_t lastSDKeepAlive;\r
\r
static int isUsbStarted;\r
\r
s2s_ledOff();\r
#endif\r
\r
- lastSDPoll = s2s_getTime_ms();\r
+ lastSDPoll = lastSDKeepAlive = s2s_getTime_ms();\r
}\r
\r
void mainLoop()\r
}\r
}\r
}\r
+ else if (lastSDKeepAlive > 10000) // 10 seconds\r
+ {\r
+ // 2021 boards fail if there's no commands sent in a while\r
+ sdKeepAlive();\r
+ lastSDKeepAlive = s2s_getTime_ms();\r
+ }\r
}\r
else if (usbBusy || ((scsiDev.phase >= 0) && (blockDev.state & DISK_PRESENT)))\r
{\r
// don't waste time scanning SD cards while we're doing disk IO\r
- lastSDPoll = s2s_getTime_ms();\r
+ lastSDPoll = lastSDKeepAlive = s2s_getTime_ms();\r
}\r
}\r
\r
s2s_delay_us(2);\r
}\r
\r
-#if 0\r
- if (scsiDev.status != GOOD && isDebugEnabled())\r
+//#if 0\r
+ if (scsiDev.status != GOOD)// && isDebugEnabled())\r
{\r
// We want to capture debug information for failure cases.\r
- s2s_delay_ms(64);\r
+ s2s_delay_ms(80);\r
}\r
-#endif\r
+//#endif\r
\r
\r
scsiEnterBusFree();\r
return HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_8) == 0;\r
}\r
\r
+void sdKeepAlive()\r
+{\r
+ /*HAL_SD_CardStateTypeDef cardState = */HAL_SD_GetCardState(&hsd);\r
+}\r
void sdReadDMA(uint32_t lba, uint32_t sectors, uint8_t* outputBuffer);
int sdReadDMAPoll(uint32_t remainingSectors);
void sdCompleteTransfer();
+void sdKeepAlive();
int sdIsBusy();