Selaa lähdekoodia

Set network frames to 25 and SCSI2SD buffer to 4x

Was able to set the network frames to 24 and reduce the SCSI2SD buffer
from 8x to 4x. This gave enough SRAM to reenable USB serial logging
and add back the prefetch buffer to 2048 bytes.

Sometimes the download stops when creating a new file with data
already in Netscape 2.0 download buffer. It seem to happen
only on the first download, but more testing around this issue
is needed.
Morio 2 vuotta sitten
vanhempi
sitoutus
4bca52142c

+ 2 - 2
lib/SCSI2SD/src/firmware/scsi.c

@@ -564,9 +564,9 @@ static void process_Command()
 	// write commands. Will fall-through to generic disk handling.
 	else if (((cfg->deviceType == S2S_CFG_OPTICAL) && scsiCDRomCommand()) ||
 		((cfg->deviceType == S2S_CFG_SEQUENTIAL) && scsiTapeCommand()) ||
-#ifdef ZULUSCSI_DAYNAPORT
+#ifdef ZULUSCSI_NETWORK
 		((cfg->deviceType == S2S_CFG_NETWORK && scsiNetworkCommand())) ||
-#endif // ZULUSCSI_DAYNAPORT
+#endif // ZULUSCSI_NETWORK
 		((cfg->deviceType == S2S_CFG_MO) && scsiMOCommand()))
 	{
 		// Already handled.

+ 5 - 5
lib/ZuluSCSI_platform_RP2040/ZuluSCSI_platform.cpp

@@ -42,7 +42,7 @@
 #endif // __MBED__
 
 #ifndef __MBED__
-#ifndef ZULUSCSI_DAYNAPORT
+#ifndef PIO_FRAMEWORK_ARDUINO_NO_USB
 # include <SerialUSB.h>
 # include <class/cdc/cdc_device.h>
 #endif
@@ -367,9 +367,9 @@ void platform_late_init()
         gpio_conf(SCSI_IN_RST,    GPIO_FUNC_SIO, true, false, false, true, false);
 
 #ifndef __MBED__
-#ifndef ZULUSCSI_DAYNAPORT
+# ifndef PIO_FRAMEWORK_ARDUINO_NO_USB
     Serial.begin();
-#endif
+# endif
 #endif // __MBED__
 
 #ifdef ENABLE_AUDIO_OUTPUT
@@ -505,7 +505,7 @@ static void usb_log_poll()
 {
     static uint32_t logpos = 0;
 #ifndef __MBED__
-# ifndef ZULUSCSI_DAYNAPORT
+# ifndef PIO_FRAMEWORK_ARDUINO_NO_USB
     if (Serial.availableForWrite())
     {
         // Retrieve pointer to log start and determine number of bytes available.
@@ -522,7 +522,7 @@ static void usb_log_poll()
         actual = Serial.write(data, len);
         logpos -= available - actual;
     }
-# endif
+# endif // PIO_FRAMEWORK_ARDUINO_NO_USB
 #else
     if (_SerialUSB.ready())
     {

+ 10 - 8
platformio.ini

@@ -144,11 +144,12 @@ debug_tool = cmsis-dap
 debug_build_flags =
     -O2 -ggdb -g3
     ; The values can be adjusted down to get a debug build to fit to SRAM
-    -DLOGBUFSIZE=2048
-    -DPREFETCH_BUFFER_SIZE=1024
+    ;-DLOGBUFSIZE=2048
+    ;-DPREFETCH_BUFFER_SIZE=1024
+    ;-DSCSI2SD_BUFFER_SIZE=32768
     ; This controls the depth of 2 x NETWORK_PACKET_MAX_SIZE (1520 bytes)
     ; For example a queue size of 10 would be 10 x 2 x 1520 = 30400 bytes
-    -DNETWORK_PACKET_QUEUE_SIZE=12
+    -DNETWORK_PACKET_QUEUE_SIZE=20
 lib_deps =
     SdFat=https://github.com/rabbitholecomputing/SdFat#2.2.0-gpt
     minIni
@@ -167,19 +168,20 @@ build_flags =
     -DZULUSCSI_NETWORK
     -DZULUSCSI_DAYNAPORT
 ; These take a large portion of the SRAM and can be adjusted
-; USB has been disabled to free of more SRAM. The next two comments can be ignored
 ; It is important to leave enough free space for USB serial to work
-;   Around 7220 bytes seems to be enough.
+;   Around 4096 bytes seems to be enough.
     -DLOGBUFSIZE=2048
-    -DPREFETCH_BUFFER_SIZE=0
+    -DPREFETCH_BUFFER_SIZE=2048
+    -DSCSI2SD_BUFFER_SIZE=32768
     ; This controls the depth of 2 x NETWORK_PACKET_MAX_SIZE (1520 bytes)
     ; For example a queue size of 10 would be 10 x 2 x 1520 = 30400 bytes
-    -DNETWORK_PACKET_QUEUE_SIZE=20
+    -DNETWORK_PACKET_QUEUE_SIZE=25
 ; build flags mirroring the framework-arduinopico#v3.6.0-DaynaPORT static library build
     -DPICO_CYW43_ARCH_POLL=1
 	-DCYW43_LWIP=0
 	-DCYW43_USE_OTP_MAC=0
-    -DPIO_FRAMEWORK_ARDUINO_NO_USB
+;  More SRAM can be freed by disabling USB serial logging
+;    -DPIO_FRAMEWORK_ARDUINO_NO_USB
 
 ; Variant of RP2040 platform, based on Raspberry Pico board and a carrier PCB
 ; Differs in pinout from ZuluSCSI_RP2040 platform, but shares most of the code.