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

update instructions for use with rpi4 and 1.6 revision motherboard #6

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ PiPROM allows your Raspberry Pi to interface with I2C based xbox EEPROM chips. Y

### Getting Started
1. The first step in getting PiPROM running is to enable the I2C interface on your Raspberry Pi. Adafruit has a very nice [tutorial](https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c) on how to do this.
2. Once you have the I2C interface up and running on your Raspberry Pi it's time to get it connected to your xbox console. For xbox versions 1.0 - 1.5 it will require 3 wires to be soldered to the LPC port on your xbox motherboard, for version 1.6 it will require a few more connections that are a bit tricky.
2. Once you have the I2C interface up and running on your Raspberry Pi it's time to get it connected to your xbox console. For xbox versions 1.0 - 1.6 it will require 3 wires to be soldered to the LPC port on your xbox motherboard.

You will need to connect the two I2C pins on your Raspberry Pi to the I2C pins on your xbox/I2C chip, as well as a ground wire between the two. The ground wire is very important! It acts as a reference line for the Pi to tell when a GPIO is high or low. If your Pi doesn't have the same ground reference as your xbox your results may be sporatic. The wiring chart below outlines the connections you need to make to connect your Pi to an xbox console. The numbers refer to the RAW pin numbers on the Pi, and the LPC pins on an xbox motherboard. Note that the pins are the same on all versions of the Raspberry Pi (V1, B+, V2).
You will need to connect the two I2C pins on your Raspberry Pi to the I2C pins on your xbox/I2C chip, as well as a ground wire between the two. The ground wire is very important! It acts as a reference line for the Pi to tell when a GPIO is high or low. If your Pi doesn't have the same ground reference as your xbox your results may be sporatic. The wiring chart below outlines the connections you need to make to connect your Pi to an xbox console. The numbers refer to the RAW pin numbers on the Pi, and the LPC pins on an xbox motherboard. Note that the pins are the same on all versions of the Raspberry Pi (V1, B+, V2, V3, V4).

Pin | Pi | Xbox v1.0 - 1.5
Pin | Pi | Xbox v1.0 - 1.6
--- | --- | ---
SDA | 3 | 14
SCL | 5 | 13
Expand All @@ -25,12 +25,15 @@ GND | 6 | 2
sudo apt-get install python-smbus
sudo apt-get install i2c-tools
```
Once the tools are installed you will need to power up your xbox console or EEPROM chip, yes, the console needs to physically be turned on. Don't worry, as long as you're not doing anything on your console at the same time that PiPROM is reading/writing to the xbox EEPROM it won't harm anything. If your xbox console frags at boot, or throws a system error, you will only have ~3 minutes to work before it will auto power off. This will be plenty of time for PiPROM to read/write the EEPROM chip.
Once the tools are installed you will need to power up your xbox console or EEPROM chip, yes, the console needs to physically be turned on. Don't worry, as long as you're not doing anything on your console at the same time that PiPROM is reading/writing to the xbox EEPROM it won't harm anything. If your xbox console frags at boot, or throws a system error, you will only have ~3 minutes to work before it will auto power off. This will be plenty of time for PiPROM to read/write the EEPROM chip. Unless you are using a 1.6 version motherboard then the timing is extremely reduced.

From a command line on the Pi run `sudo i2cdetect -y 1` and you should see something similar to the following (output taken from my Pi connected to an xbox console):

![alt text](/images/i2c_xbox.png?raw=true)
Note: on a 1.6 console alot of this will not be available however enough to mess with the eeprom will be you will also only be able to mess with the console with a timing window of "you press power button and enter at basically the same time" give or take

![alt text](/images/i2c_xbox.png?raw=true)


The EEPROM on the xbox console is located at address 0x54, but PiPROM already knows this! If your Pi is connected to your xbox console and you don't see output from i2cdetect that looks like the image above then something is wrong. Check your wires, and make sure you have a ground wire between your Pi and xbox console.

If your Pi is connected directly to an I2C EEPROM chip you should only see one address listed in the output from i2cdetect. This is the I2C address you will later plug into PiPROM to override the default I2C address of the xbox EEPROM.
Expand All @@ -41,7 +44,7 @@ GND | 6 | 2
cd ./PiPROM
```

Next we will setup bcm2835, a C library for the broadcom processor the Raspberry Pi uses. It is what PiPROM is built on and you will need to it compile PiPROM. Run the following commands to download and install bcm2835 v1.42. If you run into trouble please refer to the [bcm2835 website](http://www.airspayce.com/mikem/bcm2835/index.html).
Next we will setup bcm2835, a C library for the broadcom processor the Raspberry Pi uses. It is what PiPROM is built on and you will need to it compile PiPROM. If you have a Raspberry Pi 4 please use the second set of instructions instead. Run the following commands to download and install bcm2835 v1.42. If you run into trouble please refer to the [bcm2835 website](http://www.airspayce.com/mikem/bcm2835/index.html).
```
Copy link
Owner

Choose a reason for hiding this comment

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

There doesn't need to be two separate instructions here, just update the link/folder name for the existing set so it is the same for all pi versions

wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.42.tar.gz
tar zxvf bcm2835-1.42.tar.gz
Expand All @@ -51,7 +54,18 @@ make
sudo make check
sudo make install
```


For Raspberry Pi 4
```
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.62.tar.gz
tar zxvf bcm2835-1.62.tar.gz
cd bcm2835-1.62
./configure
make
sudo make check
sudo make install
```

Next we are going to download the latest source for PiPROM and compile it. Run the following commands which will move you back into the PiPROM folder and download the latest source code for it.

I added my own line into this. Use mine until the original OP fixes/merges my changes.
Copy link
Owner

Choose a reason for hiding this comment

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

Since these changes have been merged in as part of your PR this part should be removed since it is no longer applicable

Expand All @@ -77,6 +91,8 @@ I added my own line into this. Use mine until the original OP fixes/merges my ch
v1 B+ | ```make p1b```
v2 B | ```make p2```
v3 B | ```make p3```
v4 | ```make p3```
=======
Copy link
Owner

@grimdoomer grimdoomer Feb 18, 2022

Choose a reason for hiding this comment

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

Remove line 95 since it shows up in the table cells.


If everything went smoothly you should see no compiler errors in the output. To check run the ```ls``` command, and there should be a file called "PiPROM.a" in the current folder. If PiPROM.a exists then you successfully compiled PiPROM, if it doesn't then I guess I messed up somewhere... You can send me an email and I can try to see where things went wrong for you.

Expand Down