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

Clean dir #397

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# Update submodules
git submodule update --init --recursive -j (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors
# Install the tools
.\install.ps1
.\scripts\install.ps1
- run:
name: Clone Swadge Repo and write a version file
shell: powershell.exe
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
$CheckFile = Test-Path -Path $file
if (!($CheckFile)) {exit 1 }
# zip everything up and move it to where circleci expects
zip << pipeline.parameters.firmware-artifact >> -j build\bootloader\bootloader.bin build\partition_table\partition-table.bin build\swadge-esp32.bin build\storage.bin build\dfu.bin version.txt .\pyFlashGui\pyFlashGui.py
zip << pipeline.parameters.firmware-artifact >> -j build\bootloader\bootloader.bin build\partition_table\partition-table.bin build\swadge-esp32.bin build\storage.bin build\dfu.bin version.txt .\tools\pyFlashGui\pyFlashGui.py
# Move the zips to where circleci expects it so that it gets uploaded as an artifact
cp << pipeline.parameters.firmware-artifact >> C:\Users\circleci\project\
- store_artifacts:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ git submodule update --init --recursive
Next, you'll want to run the following PowerShell from the repository script to download, install, and update msys2 in one shot. Feel free to replace `C:\` with a different path if you want. Note that there may be a more up-to-date installer than the one used in this script.

```powershell
.\setup-msys2.ps1
.\scripts\setup-msys2.ps1
```

> Alternatively, install msys2 with [their installer](https://www.msys2.org/). Once you have an msys2 shell, the command to install required packages for building from an msys2 terminal after installing msys2 is:
Expand All @@ -123,7 +123,7 @@ When it's all set up, it should look something like this:
To set up the ESP32 toolchain, you can run the following powershell script from the repository. It will install the IDF in `~/esp/esp-idf` and the tools in `~/.espressif`. I don't recommend changing those paths.

```powershell
.\setup-esp-idf.ps1
.\scripts\setup-esp-idf.ps1
```

Note that `export.ps1`, which is called in that script, does not make any permanent changes and it must be run each time you open a new terminal for a build.
Expand All @@ -149,10 +149,10 @@ cd ~/esp/esp-idf
git submodule update --init --recursive

# Install tools
./install.sh
./scripts/install.sh

# Export paths and variables
./export.sh
./scripts/export.sh
```

To set up the emulator build environment, you'll need to install the following packages. If your system uses the `apt` package manager, use this command:
Expand Down Expand Up @@ -693,7 +693,7 @@ Set-ExecutionPolicy -Scope CurrentUser Unrestricted
To update the ESP32 toolchain, you can run the following powershell script from the repository. It will only work if you have installed the IDF in `~/esp/esp-idf` and the tools in `~/.espressif`.

```powershell
.\update-esp-idf.ps1
.\scripts\update-esp-idf.ps1
```

## Linux
Expand All @@ -703,7 +703,7 @@ To update the ESP32 toolchain, you can run the following powershell script from
To update the ESP32 build environment, you can run the following bash script from the repository. It will only work if you have installed the IDF in `~/esp/esp-idf` and the tools in `~/.espressif`.

```bash
./update-esp-idf.sh
./scripts/update-esp-idf.sh
```

# Troubleshooting
Expand Down
2 changes: 2 additions & 0 deletions burn-dbg.ps1 → scripts/burn-dbg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ $ErrorActionPreference = "Stop"
taskkill.exe /IM "putty.exe" /F

# exit when any command fails, then build
cd $PSScriptRoot
cd ..
idf.py -p COM8 -b 2000000 build flash
cmd.exe /C "START /B putty.exe -serial COM8 -sercfg 115200"

Expand Down
2 changes: 2 additions & 0 deletions clean.bat → scripts/clean.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cd "%~dp0"
cd ..
make -f emu.mk clean
idf.py clean fullclean
rmdir /s /q build
Expand Down
2 changes: 2 additions & 0 deletions emu.bat → scripts/emu.bat
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
cd "%~dp0"
cd ..
make -f emu.mk && swadge_emulator.exe
File renamed without changes.
2 changes: 2 additions & 0 deletions flash.bat → scripts/flash.bat
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
cd "%~dp0"
cd ..
idf.py -p %SWADGE_COM_PORT% -b 2000000 build flash monitor
File renamed without changes.
4 changes: 2 additions & 2 deletions setup-esp-idf.ps1 → scripts/setup-esp-idf.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Make an esp folder only if it does not yet exist, and move into it regardless
$Filename="~/esp"
if (-not(test-path $Filename)){mkdir $FileName}
$FileName="~/esp"
if (-not(test-path $FileName)){mkdir $FileName}
cd ~/esp

# Clone the IDF and move into it
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions swadge-bros-kiosk.ps1 → scripts/swadge-bros-kiosk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

while($true)
{
cd $PSScriptRoot
cd ..
.\swadge_emulator.exe --start-mode "Swadge Bros" --lock --fullscreen
if(0 -eq $LASTEXITCODE)
{
Expand Down
11 changes: 9 additions & 2 deletions update-esp-idf.ps1 → scripts/update-esp-idf.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@
#Remove-Item -force

# Only delete esp-idf\ in ~\esp\
Remove-Item ~\esp\esp-idf\ -Force -Recurse
$FileName = "~\esp\esp-idf\"
if (Test-Path $FileName) {
Remove-Item $FileName -Force -Recurse
}

# Delete ~\.espressif\ and everything in it
Remove-Item ~\.espressif\ -Force -Recurse
$FileName = "~\.espressif\"
if (Test-Path $FileName) {
Remove-Item $FileName -Force -Recurse
}

# Re-run the esp-idf setup
cd $PSScriptRoot
.\setup-esp-idf.ps1
2 changes: 2 additions & 0 deletions update-esp-idf.sh → scripts/update-esp-idf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ rm -rf ~/esp/esp-idf/
rm -rf ~/.espressif/

# Re-run the esp-idf setup
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd SCRIPT_DIR
./setup-esp-idf.sh
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions pyFlashGui/README.md → tools/pyFlashGui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ For the script to actually flash firmware, the following files must be in the sa

| File | Relative Path |
| ------------- | ------------- |
| ``bootloader.bin`` | ``../build/bootloader/bootloader.bin`` |
| ``swadge-esp32.bin`` | ``../build/swadge-esp32.bin`` |
| ``partition-table.bin`` | ``../build/partition_table/partition-table.bin`` |
| ``storage.bin`` | ``../build/storage.bin`` |
| ``bootloader.bin`` | ``../../build/bootloader/bootloader.bin`` |
| ``swadge-esp32.bin`` | ``../../build/swadge-esp32.bin`` |
| ``partition-table.bin`` | ``../../build/partition_table/partition-table.bin`` |
| ``storage.bin`` | ``../../build/storage.bin`` |

Assuming you've checked out the whole repository, set up the IDF, and are in the `Super-2023-Swadge-FW` folder, then this should build and place the files:

```bash
idf.py build
cp ./build/bootloader/bootloader.bin ./build/swadge-esp32.bin ./build/partition_table/partition-table.bin ./build/storage.bin ./pyFlashGui/
cp ./build/bootloader/bootloader.bin ./build/swadge-esp32.bin ./build/partition_table/partition-table.bin ./build/storage.bin ./tools/pyFlashGui/
```

# Instructions
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.