Quellcode durchsuchen

Works on boot and the LED works also

The scsi_accel_target.cpp was clearing out a PIO instruction memory
that was causing the Wireless SPI pio state machine code to crash.

Removing that line conditionally fixed the issue. It can also
boot with both a disk image and a DaynaPORT device, but for some reason
the WiFi doesn't connect. So in its current state it is a network
device only.
Morio vor 2 Jahren
Ursprung
Commit
ae7ae636f6

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

@@ -567,9 +567,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_NETWORK
+#ifdef ZULUSCSI_DAYNAPORT
 		((cfg->deviceType == S2S_CFG_NETWORK && scsiNetworkCommand())) ||
-#endif // ZULUSCSI_NETWORK
+#endif // ZULUSCSI_DAYNAPORT
 		((cfg->deviceType == S2S_CFG_MO) && scsiMOCommand()))
 	{
 		// Already handled.

+ 3 - 7
lib/ZuluSCSI_platform_RP2040/ZuluSCSI_platform_gpio_Pico.h

@@ -71,13 +71,9 @@
 
 // Status LED pins
 #define LED_PIN      16
-#ifdef ZULUSCSI_DAYNAPORT // disable LEDs, workaround to boot correctly
-# define LED_ON()    (void)0
-# define LED_OFF()   (void)0
-#else
-# define LED_ON()    sio_hw->gpio_set = 1 << LED_PIN
-# define LED_OFF()   sio_hw->gpio_clr = 1 << LED_PIN
-#endif
+#define LED_ON()    sio_hw->gpio_set = 1 << LED_PIN
+#define LED_OFF()   sio_hw->gpio_clr = 1 << LED_PIN
+
 
 // SD card pins in SDIO mode
 #define SDIO_CLK 10

+ 13 - 1
lib/ZuluSCSI_platform_RP2040/ZuluSCSI_platform_network.cpp

@@ -84,7 +84,6 @@ int platform_network_init(char *mac)
 		memcpy(scsiDev.boardCfg.wifiMACAddress, mac, sizeof(scsiDev.boardCfg.wifiMACAddress));
 	}
 
-	cyw43_init(&cyw43_state);
 	// setting the MAC requires libpico to be compiled with CYW43_USE_OTP_MAC=0
 	memcpy(cyw43_state.mac, mac, sizeof(cyw43_state.mac));
 	cyw43_arch_enable_sta_mode();
@@ -127,7 +126,9 @@ bool platform_network_wifi_join(char *ssid, char *password)
 		ret = cyw43_arch_wifi_connect_async(ssid, password, CYW43_AUTH_WPA2_MIXED_PSK);
 	}
 	if (ret != 0)
+	{
 		logmsg_f("Wi-Fi connection failed: %d", ret);
+	}
 	
 	return (ret == 0);
 }
@@ -311,7 +312,18 @@ void cyw43_cb_tcpip_set_link_up(cyw43_t *self, int itf)
 	char *ssid = platform_network_wifi_ssid();
 
 	if (ssid)
+	{
 		logmsg_f("Successfully connected to Wi-Fi SSID \"%s\"", ssid);
+		// blink LED 3 times when connected
+		LED_OFF();
+		for (uint8_t i = 0; i < 3; i++)
+		{
+			delay(75);
+			LED_ON();
+			delay(75);
+			LED_OFF();
+		}
+	}
 }
 
 }

+ 4 - 2
lib/ZuluSCSI_platform_RP2040/scsi_accel_target.cpp

@@ -870,7 +870,7 @@ void scsi_accel_rp2040_init()
     g_scsi_dma_state = SCSIDMA_IDLE;
     scsidma_config_gpio();
     
-        if (g_channels_claimed) {
+    if (g_channels_claimed) {
         // Un-claim all SCSI state machines
         pio_sm_unclaim(SCSI_DMA_PIO, SCSI_PARITY_SM);
         pio_sm_unclaim(SCSI_DMA_PIO, SCSI_DATA_SM);
@@ -908,9 +908,11 @@ void scsi_accel_rp2040_init()
         g_channels_claimed = true;
     }
 
+#ifndef ZULUSCSI_NETWORK
     // Load PIO programs
     pio_clear_instruction_memory(SCSI_DMA_PIO);
-    
+#endif // ZULUSCSI_NETWORK
+
     // Parity lookup generator
     g_scsi_dma.pio_offset_parity = pio_add_program(SCSI_DMA_PIO, &scsi_parity_program);
     g_scsi_dma.pio_cfg_parity = scsi_parity_program_get_default_config(g_scsi_dma.pio_offset_parity);

+ 1 - 1
platformio.ini

@@ -130,7 +130,7 @@ platform_packages = platformio/toolchain-gccarmnoneeabi@1.100301.220327
 framework = arduino
 board = rpipicow
 board_build.core = earlephilhower
-debug_tool = picoprobe
+debug_tool = cmsis-dap
 lib_deps =
     SdFat=https://github.com/rabbitholecomputing/SdFat#2.2.0-gpt
     minIni