Here is some info and the source code.

18-pin Flash Card Pin | Name | Description |
| 18 | GND | Ground (+Presence detect) |
| 17 | R/-B | Ready/-Busy (Open-drain) |
| 16 | -RE | Read Enable |
| 15 | -CE | Card Enable |
| 14 | CLE | Command Latch Enable |
| 13 | ALE | Address Latch Enable |
| 12 | -WE | Write Enable |
| 11 | -WP | Write Protect |
| 10 | GND | Ground |
| 9 | D0 | Data0 |
| 8 | D1 | Data1 |
| 7 | D2 | Data2 |
| 6 | D3 | Data3 |
| 5 | D4 | Data4 |
| 4 | D5 | Data5 |
| 3 | D6 | Data6 |
| 2 | D7 | Data7 |
| 1 | Vcc | Power |
Here is the source:
/*
* Card_tools for raw access XD/Smartmedia cards using Olympus MAUSB-10
* author: warpjavier
* email: warpjavier@hotmail.com
* date: 27 May 2007
* platform: linux + windows
*
*/
#ifndef CARD_TOOLS_H_INCLUDED
#define CARD_TOOLS_H_INCLUDED
#include <usb.h>
/* the device's vendor and product id for Olympus MAUSB-10*/
#define MY_VID 0x07B4
#define MY_PID 0x010A
/* the device's endpoints */
#define EP_IN 0x82
#define EP_OUT 0x03
#define PBA_LO(pba) ((pba & 0xF) << 5)
#define PBA_HI(pba) (pba >> 3)
#define BUF_SIZE 576 //576 instead of 528 as the device return 48 extra bytes
/*
* Bulk command identity (byte 0)
*/
#define CARD_TOOLS_BULK_CMD 0x40
/*
* Bulk opcodes (byte 1)
*/
#define CARD_TOOLS_BULK_READ_BLOCK 0x94
#define CARD_TOOLS_BULK_ERASE_BLOCK 0xa3
#define CARD_TOOLS_BULK_WRITE_BLOCK 0xb4
#define CARD_TOOLS_BULK_RESET_MEDIA 0xe0
/*
* Port to operate on (byte 8)
*/
#define CARD_TOOLS_PORT_XD 0x00
#define CARD_TOOLS_PORT_SM 0x01
/*
* Error Codes
*/
#define CARD_TOOLS_OK 0x00
#define CARD_TOOLS_ERROR 0x01
/*
* Functions
*/
usb_dev_handle *open_dev(void);
int reset_media(void);
int dump_card(char *filename);
int write_to_card(char *filename);
int erase_card();
int read_block(unsigned short block);
int erase_block(unsigned short block);
int write_block(unsigned short block);
#endif // CARD_TOOLS_H_INCLUDED
/*
* Card_tools for raw access XD/Smartmedia cards using Olympus MAUSB-10
* author: warpjavier
* email: warpjavier@hotmail.com
* date: 27 May 2007
* platform: linux + windows
*
*/
#include <stdio.h>
#include "card_tools.h"
//Some Globals
usb_dev_handle *dev = NULL; // the device handle
char buffer[BUF_SIZE*32];
int port = CARD_TOOLS_PORT_XD; //you can change it if you use Smartmedia cards
usb_dev_handle *open_dev(void)
{
struct usb_bus *bus;
struct usb_device *dev;
for (bus = usb_get_busses(); bus; bus = bus->next)
{
for (dev = bus->devices; dev; dev = dev->next)
{
if (dev->descriptor.idVendor == MY_VID
&& dev->descriptor.idProduct == MY_PID)
{
return usb_open(dev);
}
}
}
return NULL;
}
/*
* Resets the media status
*/
int reset_media(void)
{
unsigned char command[9];
memset(command, 0, 9);
command[0] = CARD_TOOLS_BULK_CMD;
command[1] = CARD_TOOLS_BULK_RESET_MEDIA;
command[8] = port;
if (usb_bulk_write(dev, EP_OUT, command, 9, 5000) != 9)
{
printf("Error: cannot reset media\n");
return CARD_TOOLS_ERROR;
}
return CARD_TOOLS_OK;
}
int main(int argc, char *argv[])
{
int option,status;
char* filename;
if (argc < 2) {
printf("Card Tools 0.1 - by warpjavier\n");
printf("Usage: %s [OPTION] filename\n", argv[0]);
printf("Options are as follows:\n");
printf("-d - Dump card\n");
printf("-w - Write to card\n");
printf("-e - Erase card\n");
exit(0);
}
if((option = getopt(argc, argv, "d:w:e"))==-1)
return 0;
switch (option)
{
case 'd':
if(argv[2] == NULL)
{
printf("Please, specify a filename\n");
status = CARD_TOOLS_ERROR;
break;
}
filename = argv[2];
if(init_all()!=CARD_TOOLS_OK)
return 0;
printf("Dump card contents to %s file\n", filename);
status = dump_card(filename);
break;
case 'w':
if(argv[2] == NULL)
{
printf("Please, specify a filename\n");
status = CARD_TOOLS_ERROR;
break;
}
filename = argv[2];
if(init_all()!=CARD_TOOLS_OK)
return 0;
printf("Write to card contents from %s file\n", filename);
printf("The card must be empty before write\n");
status = write_to_card(filename);
break;
case 'e':
if(init_all()!=CARD_TOOLS_OK)
return 0;
printf("Erase card contents\n");
printf("Do you want to erase the card? (y/n)");
if (getchar() == 'y')
{
status = erase_card();
}
else
{
printf("Operation Cancelled\n");
status = CARD_TOOLS_ERROR;
}
break;
default:
status = CARD_TOOLS_ERROR;
}
usb_release_interface(dev, 0);
usb_close(dev);
if(status != CARD_TOOLS_OK)
{
printf("Error!");
return 0;
}
printf("Operation Succefully Complete");
return 0;
}
int init_all()
{
usb_init(); // initialize the library
usb_find_busses(); // find all busses
usb_find_devices(); // find all connected devices
if (!(dev = open_dev()))
{
printf("Error: device not found!\n");
return CARD_TOOLS_ERROR;
}
if (usb_set_configuration(dev, 1) < 0)
{
printf("Error: setting config 1 failed\n");
usb_close(dev);
return CARD_TOOLS_ERROR;
}
if (usb_claim_interface(dev, 0) < 0)
{
printf("Error: claiming interface 0 failed\n");
usb_close(dev);
return CARD_TOOLS_ERROR;
}
if(reset_media() != CARD_TOOLS_OK)
{
usb_close(dev);
return CARD_TOOLS_ERROR;
}
return CARD_TOOLS_OK;
}
int dump_card(char *filename)
{
FILE *fd;
if((fd = fopen(filename,"w+b"))==NULL)
{
printf("Error creating %s\n",filename);
return CARD_TOOLS_ERROR;
}
unsigned short block;
for (block=0;block<1024;block++)
{
if(read_block(block)!=CARD_TOOLS_OK)
{
fclose(fd);
return CARD_TOOLS_ERROR;
}
fwrite(buffer,528*32,1,fd);
}
fclose(fd);
return CARD_TOOLS_OK;
}
int write_to_card(char *filename)
{
FILE *fd;
if((fd = fopen(filename,"r+b"))==NULL)
{
printf("Error opening file %s\n",filename);
return CARD_TOOLS_ERROR;
}
unsigned short block,x;
char tmp[528]; //528 is the page size plus the 16 extra bytes
for (block=0;block<1024;block++)
{
// Add 48 extra bytes to each page
for (x=0;x<32;x++)
{
fread(tmp,528,1,fd);
memcpy(buffer+(x*576),tmp,528);
}
if(write_block(block)!=CARD_TOOLS_OK)
{
fclose(fd);
return CARD_TOOLS_ERROR;
}
}
fclose(fd);
return CARD_TOOLS_OK;
}
int erase_card()
{
unsigned short block;
for (block=0;block<1024;block++)
{
if(erase_block(block)!=CARD_TOOLS_OK)
return CARD_TOOLS_ERROR;
}
return CARD_TOOLS_OK;
}
int read_block(unsigned short block)
{
int p;
unsigned char command[9];
command[0] = CARD_TOOLS_BULK_CMD;
command[1] = CARD_TOOLS_BULK_READ_BLOCK;
command[2] = PBA_HI(block);
command[3] = 0x00; //Zone is always 0 for 16Mb cards
command[4] = 0x00;
command[5] = PBA_LO(block);
command[6] = 0x20; //We read 32 pages at a time as is the block size.
command[7] = 0x00;
command[8] = port;
if (usb_bulk_write(dev, EP_OUT, command, 9, 5000) != 9)
{
printf("Error sending Read Block command\n");
return CARD_TOOLS_ERROR;
}
if (usb_bulk_read(dev, EP_IN, buffer, (BUF_SIZE*32), 5000) != (BUF_SIZE*32))
{
printf("Error reading Block\n");
return CARD_TOOLS_ERROR;
}
else
{
printf("Reading block %d\n",block);
//remove the extra 48 bytes
for(p=0;p<32;p++)
{
int dest_offset = p * 528;
int src_offset = p * (512 + 64);
memmove(buffer + dest_offset, buffer + src_offset, 528);
}
}
return CARD_TOOLS_OK;
}
int erase_block(unsigned short block)
{
unsigned char stat_buf[2];
unsigned char command[9];
command[0] = CARD_TOOLS_BULK_CMD;
command[1] = CARD_TOOLS_BULK_ERASE_BLOCK;
command[2] = PBA_HI(block);
command[3] = 0x00; //Zone is always 0 for 16Mb cards
command[4] = 0x00;
command[5] = PBA_LO(block);
command[6] = 0x02;
command[7] = 0x00;
command[8] = port;
if (usb_bulk_write(dev, EP_OUT, command, 9, 5000) != 9)
{
printf("Error sending Erase command\n");
return CARD_TOOLS_ERROR;
}
if (usb_bulk_read(dev, EP_IN, stat_buf, 2, 5000)!=2)
{
printf("error: Erasing Block\n");
}
else
{
printf("Erasing Block %d\n",block);
}
return CARD_TOOLS_OK;
}
int write_block(unsigned short block)
{
unsigned char command[9];
command[0] = CARD_TOOLS_BULK_CMD;
command[1] = CARD_TOOLS_BULK_WRITE_BLOCK;
command[2] = PBA_HI(block);
command[3] = 0x00; //Zone is always 0 for 16Mb cards
command[4] = 0x00;
command[5] = PBA_LO(block);
command[6] = 0x20; //We write 32 pages at a time as is the block size.
command[7] = 0x00;
command[8] = port;
if (usb_bulk_write(dev, EP_OUT, command, 9, 5000) != 9)
{
printf("Error sending Write Block command\n");
return CARD_TOOLS_ERROR;
}
if (usb_bulk_read(dev, 0x01, buffer, (BUF_SIZE*32), 5000) != (BUF_SIZE*32))
{
printf("Error Writing Block\n");
return CARD_TOOLS_ERROR;
}
else
{
printf("Writing block %d\n",block);
}
return CARD_TOOLS_OK;
}
The code is not optimized and is not perfect, its just an example of how to communicate to the device. I do not guarantee that this code will work for you. I'm not responsible for any damage caused to your device/console. Use at your own risk
You need libusb for win32
http://libusb-win32.sourceforge.net/ to compile it for windows platform.
For linux users, you will have to unload usb-storage module using modprobe. If not, the program wont work as the device is busy.
Sources:
- AlaudaProject
http://alauda.sourceforge.net/wikka.php?wakka=HomePage- This forum
- libusb for win32
http://libusb-win32.sourceforge.net/- pinouts.ru
http://pinouts.ru- google
warpjavier