93 Commits

Author SHA1 Message Date
Eric Helgeson
ec3f5133b8 Release/Reserve Commands 2022-06-01 22:32:01 -05:00
Eric Helgeson
2338d8f153 Merge pull request #117 from erichelgeson/eric/reordercmds
Move read/write command earlier, few kb/sec faster read/write
2022-05-30 16:16:33 +00:00
Eric Helgeson
b16dc558dc Add a few more noops 2022-05-30 11:13:06 -05:00
Eric Helgeson
a5c6edadc3 Move read/write command earlier, few kb/sec faster read/write 2022-05-30 11:13:06 -05:00
Eric Helgeson
79d5b12110 Merge pull request #116 from erichelgeson/eric/noopCmds
Add cmds that are ok to respond GOOD and not do anything.
2022-05-30 14:50:33 +00:00
Eric Helgeson
d6fb46d387 Add cmds that are ok to respond GOOD and not do anything. 2022-05-26 10:01:03 -05:00
Eric Helgeson
c2c3397b72 Merge pull request #114 from erichelgeson/eric/newCmds
Four new commands & some Sense
2022-05-25 02:38:02 +00:00
Eric Helgeson
906b8be9aa Implement Send Diagnostic 2022-05-24 16:49:23 -05:00
Eric Helgeson
3c258451fa Add SCSI_SENSE_MODE_FLEXABLE_GEOMETRY 2022-05-24 13:38:21 -05:00
Eric Helgeson
7cdddf7371 Fix header handling in scsi buffer 2022-05-24 13:37:17 -05:00
Eric Helgeson
20cb5d8552 Prepend the header to the buffer data 2022-05-23 17:13:09 -05:00
Eric Helgeson
5c0724703b Fix build for USB 2022-05-22 12:53:57 -05:00
Eric Helgeson
61ae8a59db Add constants for SCSI mode page codes 2022-05-21 17:32:07 -05:00
Eric Helgeson
19cc9ad169 Implement 3 commands:
SCSI Read Buffer (Thanks @marcelv-3!)
SCSI Write Buffer (Thanks @marcelv-3!)
ReZero Unit
2022-05-21 15:51:42 -05:00
Eric Helgeson
14321e3ba6 Merge pull request #113 from erichelgeson/eric/minorFixes2
Minor fixes
2022-05-21 15:51:33 -05:00
Eric Helgeson
b0799bc327 Remove tabs 2022-05-21 13:21:21 -05:00
Eric Helgeson
2127b14863 Fix default env name 2022-05-21 13:20:53 -05:00
Eric Helgeson
3ef2474ae8 Merge pull request #112 from erichelgeson/eric/versions
Build and tag all versions, collect & rename bin fines
2022-05-21 09:30:58 -05:00
Eric Helgeson
9d1b58cdb6 Merge pull request #111 from erichelgeson/eric/fewMinorFixes
Few minor fixes
2022-05-21 09:30:31 -05:00
Eric Helgeson
1f03996977 Build and tag all versions, collect & rename bin fines 2022-05-20 20:47:11 -05:00
Eric Helgeson
73fc0ed2bf Fix issue where log file would close when logging was enabled.
Thanks @marcelv-3
https://github.com/erichelgeson/BlueSCSI/discussions/103#discussioncomment-2779471
2022-05-20 19:36:06 -05:00
Eric Helgeson
94a22bb45e Add sd card volume format to log.txt 2022-05-20 19:34:19 -05:00
Eric Helgeson
c8d47218b1 Remove the usage of String, saves quite a bit of flash 2022-05-20 19:34:19 -05:00
Eric Helgeson
853956e441 Merge pull request #110 from erichelgeson/eric/APM32F103C8-support
Add support for the APM32F103C8T6 chip, a clone of the STM32F103
2022-05-20 19:34:01 -05:00
Eric Helgeson
69e69cad3a add support for the APM32F103C8T6 chip, a clone of the STM32F103 2022-05-18 19:43:56 -05:00
Eric Helgeson
bbd91936fb Fix typo 2022-04-24 14:41:09 -05:00
Eric Helgeson
c04027c8ca Merge pull request #97 from erichelgeson/eric/minor_cleanup
Implement Test Unit Ready & minor cleanup
2022-04-23 16:12:57 -05:00
Eric Helgeson
b898d9684f Remove comment 2022-04-23 16:09:44 -05:00
Eric Helgeson
38904285d4 Make the STM32F103C8 the default env 2022-04-23 16:08:30 -05:00
Eric Helgeson
8a27bcc585 Remove unused settings as we always use the OPTIMISEd ones 2022-04-23 16:08:30 -05:00
Eric Helgeson
c5447a4098 Add back LUN filename parsing 2022-04-23 16:08:30 -05:00
Eric Helgeson
408e155a63 Implement Test Unit Ready command 2022-04-23 16:08:30 -05:00
Eric Helgeson
f7799fb225 Replace magic numbers with constants - thanks Jokker 2022-04-23 16:08:30 -05:00
Eric Helgeson
845954edeb Remove unused SCSI_SELECT - upstream has moved to a different approch to
support PC98/etc
2022-04-23 16:08:30 -05:00
Eric Helgeson
7b7f19413c Merge pull request #98 from mactcp/main
Support for image files larger than 4GB
2022-04-22 07:48:52 -05:00
Glenn Anderson
961ae0b8b7 Support for images larger than 4GB 2022-04-19 10:14:23 -07:00
Eric Helgeson
aa751dc3b8 Merge pull request #92 from erichelgeson/XCVR
Code for Transceiver Hardware
2022-04-18 21:19:08 -05:00
androda
fff520959e Merge branch 'main' into XCVR 2022-04-18 16:57:57 -06:00
androda
2f08b9fa73 Swap to #ifdef 2022-04-18 16:57:19 -06:00
Eric Helgeson
24e1612fc7 Add build env for xcvr 2022-04-17 16:39:59 -05:00
Eric Helgeson
a566c9bbb0 Merge pull request #94 from mactcp/Write-speed-tune
Write speed tuning
2022-04-17 14:51:46 -05:00
Eric Helgeson
9a4e3dc886 Merge pull request #96 from erichelgeson/eric/moveAssembly
Point assembly to wiki
2022-04-17 11:04:10 -05:00
Eric Helgeson
27c424d2f9 Update assembly.md 2022-04-17 11:01:44 -05:00
androda
3158391c86 Merge branch 'main' into XCVR 2022-04-15 06:29:02 -06:00
androda
ceb6da764b Boot tested
Tested to boot beige G3 and Q700, both with XCVR mode on and off on appropriate hardware
2022-04-15 06:14:59 -06:00
androda
b4b0ce711f Cleaning up changes 2022-04-15 05:34:47 -06:00
androda
77698d0a68 Disable by default
Since this is new hardware, disable it by default
2022-04-15 05:21:44 -06:00
androda
d593c0817c Seems to boot 2022-04-14 06:44:19 -06:00
Glenn Anderson
adca34aeb8 Write speed tuning 2022-04-13 16:47:48 -07:00
Eric Helgeson
693ab2a5c0 Merge pull request #88 from mactcp/Bus-settle-delay-cleanup
Cleanup of SCSI phase change code, and adjustment of bus settle delays.
2022-04-13 08:28:02 -05:00
androda
4d3ee87c56 Work in progress 2022-04-12 06:22:28 -06:00
Glenn Anderson
ba1b3df680 Cleanup of SCSI phase change code, and adjustment of bus settle delays. 2022-04-08 11:10:07 -07:00
Eric Helgeson
22eb2c8d3e Back to snapshot 2022-04-07 16:29:06 -05:00
Eric Helgeson
9290adb1d6 v1.1-20220404 2022-04-05 08:22:36 -05:00
Eric Helgeson
fc38371717 v1.1-BETA-20220330 2022-04-03 20:16:03 -05:00
Eric Helgeson
08f25847f2 Merge pull request #85 from erichelgeson/eric/init_blk1
init blk1
2022-04-03 19:59:13 -05:00
Eric Helgeson
e468bd6fef init blk1
Thanks to @moof via discord
2022-04-03 14:53:37 -05:00
Eric Helgeson
004eea5ace Merge pull request #82 from erichelgeson/eric/rmLidoImgs
Delete MacHD.zip
2022-04-02 08:08:32 -05:00
Eric Helgeson
833cfd9384 Delete MacHD.zip
LIDO is slow, don't offer them for download!
2022-04-02 08:06:50 -05:00
Eric Helgeson
3b17788cc6 Merge pull request #81 from mactcp/main
Remove obsolete initialization of sector data overrun byte.
2022-03-31 20:35:00 -05:00
Glenn Anderson
de35be0dc2 Remove obsolete initialization of sector data overrun byte. 2022-03-31 14:18:35 -07:00
Eric Helgeson
30eccd413e Merge pull request #80 from mactcp/AppleHDSCSetup
Correct == to = for verify with bytchk of 3
2022-03-31 13:10:48 -05:00
Glenn Anderson
5c357b578c Correct == to = for verify with bytchk of 3 2022-03-31 09:23:30 -07:00
Eric Helgeson
46fd192ede Merge pull request #78 from mactcp/AppleHDSCSetup
Code reordering for bus settle delays
2022-03-30 11:17:17 -05:00
Glenn Anderson
79835832d1 Reorder bus phase change and file.seek() so that file.seek() acts as a bus settle delay. 2022-03-28 15:01:40 -07:00
Eric Helgeson
08a57174eb Merge pull request #73 from erichelgeson/eric/ImageSelect
Image set selection
2022-03-27 14:53:35 -05:00
Eric Helgeson
8db8000db3 Image set selection 2022-03-26 09:02:11 -05:00
Eric Helgeson
13b8de7bfd Merge pull request #69 from erichelgeson/eric/spiSpeed
Try clock speeds from 50 -> 32mhz for SD communication
2022-03-26 08:28:43 -05:00
Eric Helgeson
9732e90537 Merge pull request #71 from mactcp/AppleHDSCSetup
Apple HD SC Setup support
2022-03-25 08:23:39 -05:00
Glenn Anderson
7f68d9f808 Support for VERIFY (10).
Support for MODE SELECT as a no-op.
Range checking on block commands.
Sense key and additional sense for no image file.
2022-03-24 17:22:04 -07:00
Glenn Anderson
e42291e82f Support Apple mode sense page 0x30.
Support for mode sense page control 01b (changeable values).
Change SYNCHRONIZE CACHE (10) to be a no-op rather than an error.
2022-03-24 16:51:35 -07:00
Eric Helgeson
f904486ad9 Merge pull request #70 from erichelgeson/eric/pin_toolchain
Explicitly pinning toolchain to 1.9031.200702 and updating to latest coordinates.
2022-03-24 09:02:12 -05:00
Eric Helgeson
44ce53de04 Explicitly pinning toolchain to 1.9031.200702 and updating to latest
coordinates.

Unpinned seemed to just grab the latest cached version.
2022-03-24 08:58:41 -05:00
Eric Helgeson
551faf72b2 Try clock speeds from 50 -> 32mhz for SD communication
Helps compatibility with SD and different STM32 chips.
Add warning if under 40mhz - testing showed 40-50mhz gave almost no change in speed

Thanks @marcelv-3 via https://github.com/erichelgeson/BlueSCSI/discussions/58
2022-03-23 21:08:04 -05:00
Eric Helgeson
32219ce18b Merge pull request #67 from mactcp/main
Switch to latest toolchain
2022-03-21 13:42:25 -05:00
Glenn Anderson
c9dbfec6be Change readDataLoop alignment to 16 2022-03-19 13:04:24 -07:00
Glenn Anderson
e0653d6647 Switch to latest toolchain.
Tune the timing for the readDataLoop with the latest toolchain.
2022-03-19 12:04:57 -07:00
Eric Helgeson
7eb1c0d250 Merge pull request #64 from mactcp/main
Optimize handling of reset interrupt.
2022-03-19 07:51:43 -05:00
Glenn Anderson
dd87235fc0 Pin down alignment for writeDataLoop and readDataLoop, and perform some additional timing adjustment. 2022-03-18 15:51:22 -07:00
Glenn Anderson
b797793340 Read timing adjustment, now getting 1216 KB/sec on LC III+.
First pass at write speed optimization, now getting 825 KB/sec on LC III+.
Whitespace cleanup.
2022-03-17 18:08:00 -07:00
Glenn Anderson
45f61a8346 Separate out writeDataLoop. Adjust the timing, and incorporate the loop overhead in to one of the desired delays. 2022-03-17 16:36:39 -07:00
Glenn Anderson
1f6410fdc2 Move the db_bsrr table to RAM for faster performance. 2022-03-16 13:21:10 -07:00
Glenn Anderson
d6ffe45554 Remove redundant set of BSY output when switching to inactive. 2022-03-15 10:04:49 -07:00
Glenn Anderson
3ed8ef0154 GPIO mode tweaks. Mode 1 is actually 10MHz PUSH/PULL, OD is mode 7. For DB PU/PD input, set the resistors to PU. Set REQ to match DB output mode. 2022-03-15 10:04:49 -07:00
Glenn Anderson
ab30ff262e Add explicit "bx lr" to longjmpFromInterrupt. 2022-03-15 09:59:05 -07:00
Glenn Anderson
bc65933625 Optimize handling of reset interrupt. 2022-03-14 12:43:57 -07:00
Eric Helgeson
5f5053ba08 Merge pull request #63 from mactcp/main
CLZ optimization
2022-03-13 16:58:13 -05:00
Glenn Anderson
072c50a7f9 CLZ optimization 2022-03-05 15:45:47 -08:00
Eric Helgeson
57bf98de06 Update build-your-own.adoc 2022-01-24 15:24:04 -06:00
Eric Helgeson
f0239fc986 Initial 3D files for 1.1 mounts 2022-01-21 09:32:16 -06:00
Eric Helgeson
c819d9b09b Minor white space fixes. Snapshot to VERSION 2022-01-09 10:53:27 -06:00
Pacjunk
d0290a8cca Fix indenting 2022-01-07 19:11:40 +11:00
Pacjunk
9ca197f260 Various fixes for VAXstation 2022-01-07 18:21:13 +11:00
21 changed files with 1267 additions and 674 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
.DS_Store
.vscode/
workspace.code-workspace
dist/

View File

@@ -1,7 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

View File

Before

Width:  |  Height:  |  Size: 3.1 MiB

After

Width:  |  Height:  |  Size: 3.1 MiB

14
3D-Files/1.0/README.md Normal file
View File

@@ -0,0 +1,14 @@
# Mounts
## `BlueSCSI-1.0-b_V2.stl` - Current
* Added more support on the side holes
* Adjusted so 50pin headers dont hit standoff
## `BlueSCSI-1.0-b.stl`
An internal mount for the BlueSCSI 1.0-b. Provides side and bottom mounts.
# License
BlueSCSI 3D files © 2021 by Eric Helgeson is licensed under Attribution-NonCommercial 4.0 International

Binary file not shown.

Binary file not shown.

Binary file not shown.

15
3D-Files/1.1/README.md Normal file
View File

@@ -0,0 +1,15 @@
# Mounts
## Desktop
Provides mouting holes for the BlueSCSI along with side and bottom holes for common mounting in computers.
Please pre-tap any screw holes before mounting.
## DB-25 External
Print with supports for front overhangs. Tight fit to hold everything together.
# License
BlueSCSI 3D files © 2021 by Eric Helgeson is licensed under Attribution-NonCommercial 4.0 International

View File

@@ -63,7 +63,7 @@ https://github.com/erichelgeson/BlueSCSI/wiki/Troubleshooting
#### 1.1-a Desktop
* Binky! There are now resistors and pin outs for Power and Activity LED's
* Blinky! There are now resistors and pin outs for Power and Activity LED's
* Resistor nets flipped all the same way
* 50 pin allows for right angle connector
* SD Card facing out the back - gives some better options for mounting and access

13
build.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e
set -x
DATE=$(date +%Y%m%d)
VERSION="v1.1-$DATE"
mkdir -p dist
for f in $(ls .pio/build/*/firmware.bin); do
NAME="BlueSCSI-$VERSION-$(echo $f | cut -d\/ -f3).bin"
cp $f dist/$NAME
done

Binary file not shown.

View File

@@ -1,66 +1,5 @@
# Assembly
## Before you start
Instructions have moved to the wiki
Read through all instructions before starting.
## Videos
The community has created a few assembly videos:
* [Stephen Arsenault - BlueSCSI Kit Assembly](https://www.youtube.com/watch?v=G6lwCfLQwd8) 2:52
* [Joe's Computer Museum - A New Challenger - BlueSCSI - #MARCHintosh Review](https://www.youtube.com/watch?v=d_8VVmvvlNI) 26:52
* [Geeky Bit - Tutorial - BlueSCSI Assembly](https://www.youtube.com/watch?v=-nF9FYFgVHM) 20:35
## Building
1. Solder on the surface mount SD Card holder. Use the [Drag Solder](https://youtu.be/Z_KL4fWOMug) technique.
- Once on, check continuity of all connections. Fixing this after the BluePill is on will be difficult.
- Ensure the SD card fits and you dont have too much solder on the sides or contacts
2. Solder the diodes to the **bottom** of the board. Be sure they are flush as possible to the bottom.
![Diode Orientation](images/diodes.png)
3. Solder the header pins on to the BluePill. Then BluePill pill to the BlueSCSI PCB.
- Correct orientation is having the USB connector of the BluePill should be over the SD Card holder.
- **NOTE**: Consider adding headers to the board if you would like to have the BluePill removable.
4. Solder on the resistor nets. Pin one is marked on the board and the resistors.
- 220 RNETS (`RN1` & `RN3`) are closest to the BluePill
- **NOTE** PIN one on each - they are opposite of eachtoher. See photo.
- 330 RNETS (`RN2` & `RN4`) are furthest from the BluePill
- **NOTE** PIN one on each - they are opposite of eachtoher. See photo.
![Orientation RNETs and BluePill](images/orientation.png)
5. Solder on the Termination Jumpers & place the jumpers on to enable Termiation
6. Solder the 50 Pin headers on.
1. Note Pin 1 and Box header on the silk screen.
7. Optional - Solder on the berg connector. Only needed if your machine does not supply enough power via the SCSI bus.
8. Optional - Solder on the debug headers near the SD card. Only nessissarry if re-programming.
### Fully Assembled
![Fully Assembled](images/assembled.png)
### Version 1.0-b & 1.0-c BOM
#### Mouser Cart
https://www.mouser.com/ProjectManager/ProjectDetail.aspx?AccessID=c5cc83feff
#### Parts
STM32F103C8T6 (U1) aka BluePill board. Beware of fake/scams. Look for reviews. Amazon, ebay, etc.
* 2x 330 (RN2, RN4) Resistor nets https://www.mouser.com/ProductDetail/652-4610X-1LF-330
* 2x 220 (RN1, RN3) Resistor nets https://www.mouser.com/ProductDetail/652-4610X-1LF-220
* 2x Diodes https://www.mouser.com/ProductDetail/583-1N5818-T
* SD Card Holder (J1) https://www.mouser.com/ProductDetail/538-104031-0811
* Headers https://www.mouser.com/ProductDetail/872-920-0011-01
* 50 PIN SCSI header https://www.mouser.com/ProductDetail/517-30350-6002/
- May substitute with 2 rows of headers from above.
- **Note on Right angle connectors** - it appears Right angle headers are notched differently then the pin out. Be sure to note PIN 1/red stripe on the cable match up.
### Optional
Floppy/Berg Power header https://www.mouser.com/ProductDetail/571-1718254
- Required if your machine does not supply power via TERM POWER. For example a Mac Plus or Mac with a Analog/PSU board that has not been recapped.
https://github.com/erichelgeson/BlueSCSI/wiki/Assembly

View File

@@ -13,19 +13,19 @@ Updated for 1.0-c.
Grab the latest Gerbers. Gerber files tell the PCB manufactuer how to create the BlueSCSI boards.
https://github.com/erichelgeson/BlueSCSI/tree/main/hw/gerbers
https://github.com/erichelgeson/BlueSCSI/tree/main/hw/
Order the boards from https://jlcpcb.com/ or your manufactuer of choice.
### Components
#### Version 1.0-b & 1.0-c BOM
#### Version 1.0-c, 1.1-a BOM
https://www.mouser.com/ProjectManager/ProjectDetail.aspx?AccessID=c5cc83feff
### BluePill
Beware of fakes and buy from a place where returns are easy. Ensure the photo in the listing shows a chip that says STM32 on it.
Buy from a place where returns are easy. Ensure the photo in the listing shows a chip that says STM32 on it.
https://www.amazon.com/s?k=stm32f103c8t6

View File

@@ -1,27 +1,15 @@
; PlatformIO Project Configuration File https://docs.platformio.org/page/projectconf.html
[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
board_build.mcu = stm32f103c8t6
board_build.core = maple
[platformio]
default_envs = STM32F1
[env]
framework = arduino
lib_deps =
greiman/SdFat @ ^2.0.6
upload_protocol = stlink
; Different gcc versions produce much different binaries in terms of speed.
; 1.40804.0 ; 985kb/sec
; 1.60301.0 ; 1012kb/sec ***
; 1.70201.0 ; 926kb/sec
; 1.80301.0 ; 935kb/sec
; 1.80201.181220 ; 921kb/sec
; 1.90201.191206 ; 912kb/sec
; 1.90301.200702 ; default - 955kb/sec
platform_packages = toolchain-gccarmnoneeabi@1.60301.0
build_unflags =
-Os
-DARDUINO_ARCH_STM32F1
platform_packages = platformio/toolchain-gccarmnoneeabi@1.90301.200702
build_flags =
-w
-DARDUINO_GENERIC_STM32F103C
@@ -30,9 +18,78 @@ build_flags =
-DARDUINO_ARCH_STM32
-DDEBUG_LEVEL=DEBUG_NONE
-O2
-D BUILD_TAGS="\"\""
build_unflags =
-Os
-DARDUINO_ARCH_STM32F1
upload_flags = -c set CPUTAPID 0
; Work around for clones.
; https://community.platformio.org/t/cannot-upload-to-stm32-bluepill-board-over-stlink-v2/3492/25
[env:STM32F1]
platform = ststm32
board = genericSTM32F103C8
board_build.mcu = stm32f103c8t6
board_build.core = maple
[env:STM32F1-XCVR]
extends = env:STM32F1
build_flags = ${env.build_flags}
-DXCVR
-D BUILD_TAGS="\"-XCVR\""
[env:STM32F1-USB-128MHz]
# Max overclock for STM32
# Can use for APM32F1 as well.
extends = env:STM32F1-USB
board_build.f_cpu = 128000000L
build_flags = ${env.build_flags}
-D BUILD_TAGS="\"-USB-128MHz\""
[env:STM32F1-USB-96MHz]
# Slight overclock for STM32
# Use for APM32F1's - it's default clock is 96MHz and runs unstable at 72MHz(STM32F1's default)
extends = env:STM32F1-USB
# Explicilty define the multiplier as maple only handles a few cases.
build_flags = ${env.build_flags}
-D BUILD_TAGS="\"-USB-96MHz\""
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
-D USBCON
-D USBD_VID=0x0483
-D USB_MANUFACTURER="Unknown"
-D USB_PRODUCT="\"BLUEPILL_F103C8\""
-D HAL_PCD_MODULE_ENABLED
-DBOARD_RCC_PLLMUL=RCC_PLLMUL_12 #96000000L
# TODO: Find out why USB build flags get trampled when extending an extended env.
[env:STM32F1-USB]
platform = ststm32
board = genericSTM32F103C8
board_build.mcu = stm32f103c8t6
board_build.core = maple
board_build.f_cpu = 128000000L
framework = arduino
lib_deps =
greiman/SdFat @ ^2.0.6
upload_protocol = dfu
; Different gcc versions produce much different binaries in terms of speed.
platform_packages = platformio/toolchain-gccarmnoneeabi@1.90301.200702
build_flags =
-D BUILD_TAGS="\"-USB\""
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
-D USBCON
-D USBD_VID=0x0483
-D USB_MANUFACTURER="Unknown"
-D USB_PRODUCT="\"BLUEPILL_F103C8\""
-D HAL_PCD_MODULE_ENABLED
-w
-DARDUINO_GENERIC_STM32F103C
-DARDUINO_LIB_DISCOVERY_PHASE
-DARDUINO=10813
-DARDUINO_ARCH_STM32
-DDEBUG_LEVEL=DEBUG_NONE
-O2
build_unflags =
-Os
-DARDUINO_ARCH_STM32F1
upload_flags = -c set CPUTAPID 0
; [env:debug]

File diff suppressed because it is too large Load Diff

84
src/scsi_cmds.h Normal file
View File

@@ -0,0 +1,84 @@
#ifndef __SCSI_CMDS_H__
#define __SCSI_CMDS_H__
// defines for SCSI commands
#define SCSI_TEST_UNIT_READY 0
#define SCSI_REZERO_UNIT 0x1
#define SCSI_REQUEST_SENSE 0x3
#define SCSI_FORMAT_UNIT4 0x4
#define SCSI_FORMAT_UNIT6 0x6
#define SCSI_REASSIGN_BLOCKS 0x7
#define SCSI_READ6 0x8
#define SCSI_WRITE6 0xA
#define SCSI_SEEK6 0xB
#define SCSI_INQUIRY 0x12
#define SCSI_MODE_SELECT6 0x15
#define SCSI_RESERVE 0x16
#define SCSI_RELEASE 0x17
#define SCSI_COPY 0x18
#define SCSI_MODE_SENSE6 0x1A
#define SCSI_START_STOP_UNIT 0x1B
#define SCSI_RECV_DIAG_RESULTS 0x1C
#define SCSI_SEND_DIAG 0x1D
#define SCSI_PREVENT_ALLOW_REMOVAL 0x1E
#define SCSI_READ_CAPACITY 0x25
#define SCSI_READ10 0x28
#define SCSI_WRITE10 0x2A
#define SCSI_SEEK10 0x2B
#define SCSI_WRITE_AND_VERIFY 0x2E
#define SCSI_VERIFY10 0x2F
#define SCSI_SEARCH_DATA_HIGH 0x30
#define SCSI_SEARCH_DATA_EQUAL 0x31
#define SCSI_SEARCH_DATA_LOW 0x32
#define SCSI_SET_LIMITS 0x33
#define SCSI_PREFETCH 0x34
#define SCSI_SYNCHRONIZE_CACHE 0x35
#define SCSI_LOCK_UNLOCK_CACHE 0x36
#define SCSI_READ_DEFECT_DATA 0x37
#define SCSI_COMPARE 0x39
#define SCSI_COPY_AND_VERIFY 0x3A
#define SCSI_WRITE_BUFFER 0x3B
#define SCSI_READ_BUFFER 0x3C
#define SCSI_READ_LONG 0x3E
#define SCSI_WRITE_LONG 0x3F
#define SCSI_CHANGE_DEFINITION 0x40
#define SCSI_WRITE_SAME 0x41
#define SCSI_LOG_SELECT 0x4C
#define SCSI_LOG_SENSE 0x4D
#define SCSI_MODE_SELECT10 0x55
#define SCSI_MODE_SENSE10 0x5A
#define SCSI_READ12 0xA8
#define SCSI_VERIFY12 0xAF
#define SCSI_TOC_LENGTH 20 // length for default CDROM TOC
// SCSI CDROM commands
#define SCSI_AUDIO_SCAN1 0xBA
#define SCSI_AUDIO_SCAN2 0xCD
#define SCSI_PAUSE_RESUME 0x4B
#define SCSI_PLAY_AUDIO10 0x45
#define SCSI_PLAY_AUDIO12 0xA5
#define SCSI_PLAY_AUDIO_MSF 0x47
#define SCSI_PLAY_AUDIO_TRACK_IDX 0x48
#define SCSI_PLAY_TRACK_RELATIVE10 0x49
#define SCSI_PLAY_TRACK_RELATIVE12 0xA9
#define SCSI_READ_CD 0xBE
#define SCSI_READ_CD_DD 0xD8
#define SCSI_READ_CD_MSF 0xB9
#define SCSI_READ_CDDA_MSF 0xD9
#define SCSI_READ_CDXA 0xDB
#define SCSI_READ_ALL_SUBCODE 0xDF
#define SCSI_READ_HEADER 0x44
#define SCSI_READ_SUBCHANNEL 0x42
#define SCSI_READ_TOC 0x43
#define SCSI_READ_DISC_INFORMATION 0x51
#define SCSI_READ_DVD_STRUCTURE 0xAD
#define SCSI_SET_CDROM_SPEED1 0xBB
#define SCSI_SET_CDROM_SPEED2 0xDA
#define SCSI_STOP_PLAY_SCAN 0x4E
#define SCSI_READ_CDP 0xE4
#define SCSI_READ_DRIVE_STATUS 0xE0
#define SCSI_WRITE_CDP 0xE3
#endif // __SCSI_CMDS_H__

9
src/scsi_mode.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef __SCSI_MODE_H__
#define __SCSI_MODE_H__
#define MODE_COMBINED_HEADER_DATA 0x00
#define MODE_NOT_SUPPORTED 0x01
#define MODE_DATA 0x02
#define MODE_DESCRIPTOR 0x03
#endif

46
src/scsi_sense.h Normal file
View File

@@ -0,0 +1,46 @@
#ifndef __SCSI_SENSE_H__
#define __SCSI_SENSE_H__
#define SCSI_SENSE_NO_SENSE 0
#define SCSI_SENSE_RECOVERED_ERROR 0x1
#define SCSI_SENSE_NOT_READY 0x2
#define SCSI_SENSE_MEDUIM_ERROR 0x3
#define SCSI_SENSE_HARDWARE_ERROR 0x4
#define SCSI_SENSE_ILLEGAL_REQUEST 0x5
#define SCSI_SENSE_UNIT_ATTENTION 0x6
#define SCSI_SENSE_DATA_PROTECT 0x7
#define SCSI_SENSE_BLANK_CHECK 0x8
#define SCSI_SENSE_VENDOR_SPECIFIC 0x9
#define SCSI_SENSE_COPY_ABORTED 0xa
#define SCSI_SENSE_ABORTED_COMMAND 0xb
#define SCSI_SENSE_EQUAL 0xc
#define SCSI_SENSE_VOLUME_OVERFLOW 0xd
#define SCSI_SENSE_MISCOMPARE 0xe
#define SCSI_SENSE_RESERVED 0xf
#define SCSI_ASC_INVALID_OPERATION_CODE 0x2000
#define SCSI_ASC_LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE 0x2100
#define SCSI_ASC_INVALID_FIELD_IN_CDB 0x2400
#define SCSI_ASC_LOGICAL_UNIT_NOT_SUPPORTED 0x2500
#define SCSI_ASC_INVALID_FIELD_PARAMETER_LIST 0x2600
#define SCSI_ASC_WRITE_PROTECTED 0x2700
#define SCSI_ASC_CANNOT_READ_MEDIUM_UNKNOWN_FORMAT 0x3001
#define SCSI_ASC_CANNOT_READ_MEDIUM_INCOMPATIBLE_FORMAT 0x3002
#define SCSI_ASC_MEDIUM_NOT_PRESENT 0x3A00
#define SCSI_ASC_LUN_NOT_READY_MANUAL_INTERVENTION_REQUIRED 0x0403
// SCSI mode page codes
#define SCSI_SENSE_MODE_VENDOR 0x00
#define SCSI_SENSE_MODE_READ_WRITE_ERROR_RECOVERY 0x01
#define SCSI_SENSE_MODE_DISCONNECT_RECONNECT 0x02
#define SCSI_SENSE_MODE_FORMAT_DEVICE 0x03
#define SCSI_SENSE_MODE_DISK_GEOMETRY 0x04
#define SCSI_SENSE_MODE_FLEXABLE_GEOMETRY 0x05
#define SCSI_SENSE_MODE_VENDOR_APPLE 0x30
#define SCSI_SENSE_MODE_ALL 0x3F
#endif

14
src/scsi_status.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef __SCSI_STATUS_H__
#define __SCSI_STATUS_H__
#define SCSI_STATUS_GOOD 0
#define SCSI_STATUS_CHECK_CONDITION 0x2
#define SCSI_STATUS_CONDITION_MET 0x4
#define SCSI_STATUS_BUSY 0x8
#define SCSI_STATUS_INTERMEDIATE 0x16
#define SCSI_STATUS_INTERMEDIATE_CONDITION_MET 0x20
#define SCSI_STATUS_RESERVATION_CONFLICT 0x24
#define SCSI_STATUS_COMMAND_TERMINATED 0x34
#define SCSI_STATUS_QUEUE_FULL 0x40
#endif