Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Present images as USB storage on RP2 platform #501

Merged
merged 4 commits into from
Jan 23, 2025
Merged

Present images as USB storage on RP2 platform #501

merged 4 commits into from
Jan 23, 2025

Conversation

ZigZagJoe
Copy link
Collaborator

@ZigZagJoe ZigZagJoe commented Jan 22, 2025

Adds the ini configuration option USBMassStoragePresentImages.

If set, MSC will present all configured eligible images as LUNs. If no images are available, it will fall back to presenting the SD card as storage. Eligibility is defined by if the image can be expected to contain a partition table or not; we can't put an optical device as a removable drive.

NOTE: This will fail to compile as currently presented. This is due to the platform MSC needing to pull in ZuluSCSI_disk.h in order to understand the image_config_t structure. ZuluSCSI_disk.h tries to pull in CUEParser.h but fails to compile as PlatformIO does not seem to pull in libraries while compiling the platform specific code.
Not sure of the best way to resolve this.

UI could be improved: A method to switch between presenting SD card and images at runtime would be useful. Otherwise, it is not possible to switch back to card reader mode if you set the .ini setting using USB in the first place.

ZuluSCSI V1.x (GD32) platform uCs are not currently supported. It would be possible to do so, however the libraries provided by gigadevice would need to be restructured in order to track capacity/block size/eject status on a per-LUN basis rather than global.

@ZigZagJoe ZigZagJoe requested a review from morio January 22, 2025 17:55
@ZigZagJoe ZigZagJoe self-assigned this Jan 22, 2025
`lib/ZuluSCSI_platform_RP2MCU` was not compiling because of a dependency
issue. The lib_ldf_mode could be changed to chain+, but this avoids
needing to do that which would have add extra compile time.
@morio
Copy link
Collaborator

morio commented Jan 23, 2025

@ZigZagJoe try merging this into your branch and see if it works.
https://github.com/ZuluSCSI/ZuluSCSI-firmware/tree/msc-images-lib-json
Cheers!

Create library.json with CUEParser dependency
@ZigZagJoe
Copy link
Collaborator Author

@ZigZagJoe try merging this into your branch and see if it works. https://github.com/ZuluSCSI/ZuluSCSI-firmware/tree/msc-images-lib-json Cheers!

Perfect, that sorted the compile issue out. Thanks! This is properly be ready for review then.

Copy link
Collaborator

@morio morio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, surprised how little code was needed.
Thanks Joe!

@aperezbios aperezbios merged commit 7994b34 into main Jan 23, 2025
2 checks passed
@aperezbios aperezbios deleted the msc-images branch January 23, 2025 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants