Skip to content

Commit

Permalink
Merge pull request #125 from BlueSCSI/eric/updates
Browse files Browse the repository at this point in the history
Smattering of updates
  • Loading branch information
erichelgeson authored Feb 22, 2024
2 parents 0443307 + e1ed361 commit a23708a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 6 deletions.
18 changes: 13 additions & 5 deletions lib/BlueSCSI_platform_RP2040/BlueSCSI_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,14 @@ static void watchdog_callback(unsigned alarm_num)
log("scsiDev.phase: ", (int)scsiDev.phase);
scsi_accel_log_state();

uint32_t *p = (uint32_t*)__get_PSP();
#ifdef __MBED__
uint32_t *p = (uint32_t*)__get_PSP();
#else
uint32_t *p = (uint32_t*)__get_MSP();
#endif
for (int i = 0; i < 8; i++)
{
if (p == &__StackTop) break; // End of stack
if (p == &__StackTop) break; // End of stack

log("STACK ", (uint32_t)p, ": ", p[0], " ", p[1], " ", p[2], " ", p[3]);
p += 4;
Expand All @@ -583,14 +587,18 @@ static void watchdog_callback(unsigned alarm_num)
if (g_watchdog_timeout <= 0)
{
log("--------------");
log("WATCHDOG TIMEOUT!");
log("WATCHDOG TIMEOUT, already attempted bus reset, rebooting");
log("Platform: ", g_platform_name);
log("FW Version: ", g_log_firmwareversion);
log("GPIO states: out ", sio_hw->gpio_out, " oe ", sio_hw->gpio_oe, " in ", sio_hw->gpio_in);
log("scsiDev.cdb: ", bytearray(scsiDev.cdb, 12));
log("scsiDev.phase: ", (int)scsiDev.phase);

uint32_t *p = (uint32_t*)__get_PSP();
#ifdef __MBED__
uint32_t *p = (uint32_t*)__get_PSP();
#else
uint32_t *p = (uint32_t*)__get_MSP();
#endif
for (int i = 0; i < 8; i++)
{
if (p == &__StackTop) break; // End of stack
Expand All @@ -607,7 +615,7 @@ static void watchdog_callback(unsigned alarm_num)
}
}

hardware_alarm_set_target(3, delayed_by_ms(get_absolute_time(), 1000));
hardware_alarm_set_target(alarm_num, delayed_by_ms(get_absolute_time(), 1000));
}

// This function can be used to periodically reset watchdog timer for crash handling.
Expand Down
1 change: 1 addition & 0 deletions lib/SCSI2SD/src/firmware/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ static void process_Command()
{
scsiDev.target->sense.code = ILLEGAL_REQUEST;
scsiDev.target->sense.asc = LOGICAL_UNIT_NOT_SUPPORTED;
transfer.lba = 0;
}
memset(scsiDev.data, 0, 256); // Max possible alloc length
scsiDev.data[0] = 0xF0;
Expand Down
15 changes: 15 additions & 0 deletions lib/SCSI2SD/src/firmware/vendor.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@ int scsiVendorCommand()
scsiDev.phase = DATA_OUT;
scsiDev.postDataOutHook = doWriteBuffer;
}
else if (command == 0xE0 &&
scsiDev.target->cfg->quirks == S2S_CFG_QUIRKS_XEBEC)
{
// RAM Diagnostic
// XEBEC S1410 controller
// http://bitsavers.informatik.uni-stuttgart.de/pdf/xebec/104524C_S1410Man_Aug83.pdf
// Stub, return success
}
else if (command == 0xE4 &&
scsiDev.target->cfg->quirks == S2S_CFG_QUIRKS_XEBEC)
{
// Drive Diagnostic
// XEBEC S1410 controller
// Stub, return success
}
else
{
commandHandled = 0;
Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ default_envs = BlueSCSI_Pico
; BlueSCSI RP2040 hardware platform, based on the Raspberry Pi foundation RP2040 microcontroller
[env:BlueSCSI_Pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
platform_packages = platformio/toolchain-gccarmnoneeabi@1.100301.220327
platform_packages = platformio/toolchain-gccarmnoneeabi@1.120301.0
framework-arduinopico@https://github.com/BlueSCSI/arduino-pico-internal.git#e139b9c7816602597f473b3231032cca5d71a48a
framework = arduino
board = rpipicow
Expand Down
2 changes: 2 additions & 0 deletions src/BlueSCSI_log_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ static const char *getCommandName(uint8_t cmd)
case 0xA8: return "Read12";
case 0xC0: return "OMTI-5204 DefineFlexibleDiskFormat";
case 0xC2: return "OMTI-5204 AssignDiskParameters";
case 0xE0: return "Xebec RAM Diagnostic";
case 0xE4: return "Xebec Drive Diagnostic";
case BLUESCSI_TOOLBOX_COUNT_FILES: return "BLUESCSI_TOOLBOX_COUNT_FILES";
case BLUESCSI_TOOLBOX_LIST_FILES: return "BLUESCSI_TOOLBOX_LIST_FILES";
case BLUESCSI_TOOLBOX_GET_FILE: return "BLUESCSI_TOOLBOX_GET_FILE";
Expand Down

0 comments on commit a23708a

Please sign in to comment.