Disclaimer: I do not work for Sony, despite the disturbing percentage of my shirts, jackets, and bookbags that are PlayStation dev-related. I do, however, have many friends that work at Sony, some of which I hope will call off the corporate lawyers. JayStation is in no way associated with Sony or PlayStation, and any stupid things I say represent only my own ineptitude and silliness.
First of all you are going to need a Raspberry Pi 3. While you probably don’t need the exact same hardware I have, be aware things do change between revisions. For example when the Raspberry Pi 2 went from revision v1.1 to v1.2, the CPU was quietly switched from a 32-bit Cortex-A7 with BCM2836 to a 64-bit Cortex-A53 with BCM2837. Just to be safe, I’d recommend you stick to an RPI3 revision v1.2, which is what I am currently testing on. I got mine from adafruit here.
The only other hardware you’ll need aside from that is a MicroSD card, a MicroSD card writer, a USB to GPIO cable, a mini-USB to USB cable (or an actual power adapter) to power the thing, and an HDMI cable. You can probably get away with whatever you have lying about the house, but this is the cable I am using. Note that this is just what is required for initial basic setup. Down the road, other things will be needed for the JouleShock controller, JTAG debugging, and various other odds and sods.
Step 0: Syncing And Software Environment Setup
While you wait for the post to deliver all that, you might as well get your software environment set up. Many of the temporary programs I am using for dev are in my JayStation public repo, so syncing that is a good place to get started. I suggest installing either TortoiseHG Workbench or SourceTree as a client, and syncing my public JayStation2 repo. Once you have that synced, take a look at the directory structure. Some of the more useful bits include
- kernel_loader: sits on the SD card and receives OS updates over UART
- tools: serial terminal, and some various drivers for things
- test_harness: tests for various things that will eventually live in the OS
- help: premade SD card directory, and images of various program setups
- videocore_compilers: JSSL and GOAL, in-progress shader compilers
You will need a few other things like Visual Studio 2015 Community Edition, the “latest” Yagarto ARM assembler, and some kind of make utility like what would come with Cygwin or MinGW (update: MinGW’s make seems to not work with my makefiles, as it wants the slashes to go in the opposite direction). Once those are installed, you should be able to open up jaystation2/test_harness/project/JayStationTestHarness/JayStationTestHarness.sln and rebuild the solution with no errors. Now would also be a good time to install the driver for your serial adaptor. If you bought the same one I did, the driver can be found under jaystation2/tools/silicon_labs_cp210x/
Step 1: SD Card Setup and First Boot
Go ahead and pop your MicroSD card into the writer and plug that into your computer. If the existing filesystem is FAT32, all you will need is to copy the contents of jaystation2/help/SD_card_fs_with_kernel_loader_RPI3/ to the SD card root directory. This includes files
- start.elf: GPU firmware
- bootcode.bin: programs GPU firmware and starts the GPU
- fixup.dat: controls how unified memory is split between CPU and GPU
- config.txt: options to load my bootloader at address 0
- kernel7.img: this is my custom JayStation bootloader
Then eject the mounted SD card, pop it in your Pi, and you are ready to rock. Connect the HDMI cable from your Pi to your monitor and connect USB serial cable as shown in the image below, with black going to ground pin 6, white going to tx pin 8, and green going to rx pin 10.
Plug the USB end into your USB port, but don’t connect the power cable quite yet or you will miss the boot message. Launch the serial terminal at jaystation2/tools/terminal/Terminal.exe and configure the following settings. COM port = <whatever your device expects, usually 3>, baud = 115,200, data bits = 8, parity = none, stop bits = 1, handshaking = none, and clear the custom BR field.
Press the connect button to connect, and finally connect the power cable to the Pi. If all went right, you should be greeted with a loader welcome message and a colorful pattern on your monitor.
Step 2: Loading a Sample OS Kernel
With the loader standing by, click on the Send File button in the terminal app and select jaystation2/test_harness/kernel7.JUP, the JayStation Update file you previously built when rebuilding the JayStationTestHarness.sln Visual Studio solution in step 0. Your terminal program will show a “progress bar” while various sections load, followed by all kinds of crazy hardware test related spam. If you look at your monitor, you will see a test triangle textured with the legendary Cort “Danger” Stratton’s face.
Welcome to JayStation dev.