Fixes for FMC interface corruption v6.4.8
authorMichael McMaster <michael@codesrc.com>
Fri, 21 May 2021 08:17:01 +0000 (18:17 +1000)
committerMichael McMaster <michael@codesrc.com>
Fri, 21 May 2021 08:17:01 +0000 (18:17 +1000)
STM32CubeMX/2021/Src/fmc.c
src/firmware/config.c
src/firmware/scsiPhy.c

index cc23ebee33d01a4a9983bcf0050b4dff4598b5c8..06cab2625c991b92e1c071c81fc2bcb881280c28 100644 (file)
@@ -56,7 +56,7 @@ void MX_FMC_Init(void)
   /* Timing */
 
   // 1 clock to read the address, + 1 for synchroniser skew
-  Timing.AddressSetupTime = 4;
+  Timing.AddressSetupTime = 5;
   Timing.AddressHoldTime = 2;
 
   // Writes to device:
@@ -67,12 +67,12 @@ void MX_FMC_Init(void)
   // Reads from device:
   //   3 for syncroniser
   //   1 to write back to fsmc bus.
-  Timing.DataSetupTime = 8;
+  Timing.DataSetupTime = 9;
 
   // Allow a clock for us to release signals
   // Need to avoid both devices acting as outputs
   // on the multiplexed lines at the same time.
-  Timing.BusTurnAroundDuration = 2;
+  Timing.BusTurnAroundDuration = 3;
 
   Timing.CLKDivision = 16; // Ignored for async
   Timing.DataLatency = 17; // Ignored for async
index 81de8b61e5409437746f6f3d05b179c96b350f1e..091eaf7f465390b801d9f7f36ce2a459e6494d82 100755 (executable)
@@ -36,7 +36,7 @@
 \r
 #include <string.h>\r
 \r
-static const uint16_t FIRMWARE_VERSION = 0x0647;\r
+static const uint16_t FIRMWARE_VERSION = 0x0648;\r
 \r
 // Optional static config\r
 extern uint8_t* __fixed_config;\r
index a883dd5a2c89d578ece62961bf62a897fb7324cf..df1ebc308cb3d34fe9aeea8471371899f1d68d5c 100755 (executable)
@@ -122,12 +122,12 @@ scsiReadByte(void)
 \r
        // Ready immediately. setDataCount resets fifos\r
 \r
-       __disable_irq();\r
+       //__disable_irq();\r
        while (!scsiPhyComplete() && likely(!scsiDev.resetFlag))\r
        {\r
-               __WFI(); // Wait for interrupt\r
+               //__WFI(); // Wait for interrupt\r
        }\r
-       __enable_irq();\r
+       //__enable_irq();\r
 \r
        uint8_t val = scsiPhyRx();\r
        // TODO scsiDev.parityError = scsiDev.parityError || SCSI_Parity_Error_Read();\r
@@ -347,12 +347,12 @@ scsiWriteByte(uint8_t value)
        scsiSetDataCount(1);\r
        scsiPhyTx(value);\r
 \r
-       __disable_irq();\r
+       //__disable_irq();\r
        while (!scsiPhyComplete() && likely(!scsiDev.resetFlag))\r
        {\r
-               __WFI();\r
+               //__WFI();\r
        }\r
-       __enable_irq();\r
+       //__enable_irq();\r
 }\r
 \r
 void\r