Support for the ESP32S3
Go to file
Sean Cross 1166c4ce41 initial commit
Signed-off-by: Sean Cross <sean@xobs.io>
2023-07-24 12:00:46 +08:00
peripherals initial commit 2023-07-24 12:00:46 +08:00
.gitattributes initial commit 2023-07-24 12:00:46 +08:00
.gitignore initial commit 2023-07-24 12:00:46 +08:00
badge.repl initial commit 2023-07-24 12:00:46 +08:00
badge.resc initial commit 2023-07-24 12:00:46 +08:00
esp32s3-drom.bin initial commit 2023-07-24 12:00:46 +08:00
esp32s3-efuses.bin initial commit 2023-07-24 12:00:46 +08:00
esp32s3-irom.bin initial commit 2023-07-24 12:00:46 +08:00
esp32s3-rtc-rom.bin initial commit 2023-07-24 12:00:46 +08:00
esp32s3-rtccntrl.bin initial commit 2023-07-24 12:00:46 +08:00
esp32s3.svd initial commit 2023-07-24 12:00:46 +08:00
partition-table.bin initial commit 2023-07-24 12:00:46 +08:00
peripherals.csproj.template initial commit 2023-07-24 12:00:46 +08:00
README.md initial commit 2023-07-24 12:00:46 +08:00
svd-to-renode.py initial commit 2023-07-24 12:00:46 +08:00

Platonic RISC-V Device

Platonic is an ideal system useful for developing an operating system. It does not represent any sort of real hardware, though differences between platforms is minimal.

Usage

For emulation, you will need to install Renode (use the nightly to get SPI.NORFlash peripheral support). Then, run renode on xous-release.resc. For example:

renode emulation/xous-resc.repl

Editing Renode Peripherals

Renode supports adding peripherals written in C#. For example, many Betrusted peripherals have models created under the peripherals/ directory.

Since there is no external compiler, it can be difficult to know if your code is correct. In fact, if you're unfamiliar with C# or the Renode codebase, editing unfamiliar C# code can be a slow exercise in frustration.

Fortunately, Visual Studio Code is free and has excellent C# tooling. All you need to do is point it at your Renode installation, load the C# plugin, and open a .cs file.

  1. Copy peripherals.csproj.template to peripherals.csproj
  2. Open peripherals.csproj and point <RenodePath> to your Renode installation directory. On ubuntu, this may be /opt/renode/bin/.
  3. Install C# for VSCode
  4. You can refer to core Renode peripherals as examples of what C# code looks like.

Debugging with GDB

When running Renode, you can attach a GDB instance. It runs on port 3333. Simply run tar ext :3333 in gdb to attach.

#!/bin/bash
if [ -z "$1" ]
  then
    echo "eg: flash.sh application.bin"
    exit
fi

set -x
export FIRMWARE_PATH=$(dirname "$1")
dd if=/dev/zero bs=1M count=4 of=./flash.bin
dd if="$FIRMWARE_PATH/bootloader/bootloader.bin" bs=1 count=$(stat -c%s "$FIRMWARE_PATH/bootloader/bootloader.bin") seek=$((16#1000)) conv=notrunc of=./flash.bin
dd if="$FIRMWARE_PATH/partition_table/partition-table.bin" bs=1 count=$(stat -c%s "$FIRMWARE_PATH/partition_table/partition-table.bin") seek=$((16#8000)) conv=notrunc of=./flash.bin
dd if=$1 bs=1 count=$(stat -c%s "$1") seek=$((16#10000)) conv=notrunc of=./flash.bin