Update Shared Memory Application authored by sfrana's avatar sfrana
TODO
\ No newline at end of file
The shared memory application is a combination of work from TIMADA's git repository and our own adjustments in order to communicate bytes between the core running FreeRTOs and the cores running Linux. This type of configuration is also known as AMP (Asymmetric Multi-Processing). There are many examples online for communication in AMP systems. However, Raspberry Pi models developed before the RPI4 lack a GIC (General Interrupt Controller); thus, many of the libraries for this do not work with our desired hardware.
To build the shared memory application, first follow the steps for compiling a bare-metal application.
1. To set up the hardware a TTL cable will need to be connected to the Pi so that UART can be used to connect to the u-boot console and type commands to the Pi. Raspberry Pi pinout diagrams are readily available online. The following pin connections should be made for this example;
GPIO 14: TTL TX cable (white).
GPIO 15: TTL RX cable (green).
Ground: TTL ground cable (black).
GPIO 17: LED high connection.
Ground: LED ground connection.
2. Once these pins have been connected, open the “uboot-compiler” folder in the repository and open a terminal. It is imperative that this terminal remains open for the remainder of this process. Enter the following command: ‘PATH=`pwd`/install-lnx/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf/bin:$PATH’
3. Remove the SD card from the Pi and attach it to a microSD card reader, then insert it into the development PC
4. Using the terminal from Step 2, run the following commands to cross-compile the baremetal application:
Figure 12: Terminal commands for cross-compilation
5. Eject the SD card from the development PC and insert it into the Raspberry Pi.
6. Connect the TTL cable to a computer with puTTY installed, and check the device manager to see which COM port the TTL cable is connected to. Replacing “COM3” with the correct COM port, enter the settings into the puTTY menu as shown in the figure below.
Figure 12: FlyPi TTL settings
7. Power on the Raspberry Pi, and press any key when the ‘Hit any key to stop autboot’ message appears. Now the u-boot console will be displayed in the puTTY terminal.
8. Enter the commands below into the u-boot console.
Figure 13: U-boot commands
Figure 14: U-boot command output
9. running these commands, the LED will turn on. Enter the following commands to then boot Ubuntu Linux on the Pi.
Figure 14: U-boot linux commands
10. After this, Linux will boot. The LED should remain on after Linux finishes, proving that the bare metal application is still operating after Linux has booted.
WORK IN PROGRESS