Skip to content
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
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ add_compile_options("-Werror")
option(VE_BUILD_WEB "Build the Vigilant UI with npm when the embedded HTML is missing" ON)
set(VE_VIGILANT_HTML "" CACHE FILEPATH "Path to a prebuilt vigilant.html file for firmware builds")

if(NOT DEFINED ENV{IDF_PATH} OR "$ENV{IDF_PATH}" STREQUAL "")
message(FATAL_ERROR
"IDF_PATH is not set. Open the project from an exported ESP-IDF shell or use the VS Code ESP-IDF extension. "
"Generic CMake Tools launches do not load the ESP-IDF environment automatically.")
endif()

include($ENV{IDF_PATH}/tools/cmake/project.cmake)

# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
Expand Down
7 changes: 7 additions & 0 deletions components/vigilant_engine/test/test_vigilant_engine.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "unity.h"
#include "status_led.h"

TEST_CASE("Unity test framework is running", "[status_led]")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn't it called "unit test"? Or are we planning on using some external framework?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Unity is the "official" recommended test framework for testing by espressif

{
TEST_ASSERT_TRUE(1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question is if unnecessary tests don't add too much bloat / if the tradeoff is given

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is just a test test, and test are only flashed to an esp when you need to test code

}
4 changes: 2 additions & 2 deletions docs/partitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ The project uses a custom partition layout defined in `partitions.csv`.

## Primary partitions

- `factory`: Recovery firmware (1 MB at `0x10000`)
- `ota_0`: Main firmware (~2.94 MB at `0x110000`)
- `factory`: Recovery firmware (1.1875 MB at `0x10000`)
- `ota_0`: Main firmware (2.75 MB at `0x140000`)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Idk if it makes sense to include these if they change everytime

- `otadata`: OTA selection data

The `factory` partition is intended as a stable fallback and should not be overwritten during
Expand Down
2 changes: 2 additions & 0 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ You are not in an ESP-IDF exported shell.

- Windows: open ESP-IDF PowerShell
- Linux/macOS: source `export.sh`
- In VS Code, prefer the ESP-IDF extension over generic `CMake Tools`
- If `CMake Tools` logs an include failure for `/tools/cmake/project.cmake`, it launched without the ESP-IDF environment

## `BIN not found`

Expand Down
6 changes: 3 additions & 3 deletions partitions.csv
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Now I don't know about these. Are we sure?

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
nvs, data, nvs, 0x9000, 0x4000,
otadata, data, ota, 0xD000, 0x2000,
phy_init, data, phy, 0xF000, 0x1000,
factory, app, factory, 0x10000, 0x100000,
ota_0, app, ota_0, 0x110000, 0x2F0000,
factory, app, factory, 0x10000, 0x130000,
ota_0, app, ota_0, 0x140000, 0x2C0000,

# esptool.py write_flash 0x110000 build/vigilant-engine.bin
# esptool.py write_flash 0x140000 build/vigilant-engine.bin
12 changes: 11 additions & 1 deletion vigilant-engine-recovery/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)

if(NOT DEFINED ENV{IDF_PATH} OR "$ENV{IDF_PATH}" STREQUAL "")
message(FATAL_ERROR
"IDF_PATH is not set. Open the recovery firmware from an exported ESP-IDF shell or use the VS Code ESP-IDF extension. "
"Generic CMake Tools launches do not load the ESP-IDF environment automatically.")
endif()

if(NOT DEFINED IDF_TARGET AND NOT DEFINED ENV{IDF_TARGET})
set(IDF_TARGET "esp32c6")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As someone who doesn't test with esp32c6 I am not a fan haha

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

xD

endif()

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
idf_build_set_property(MINIMAL_BUILD ON)
Expand All @@ -20,7 +30,7 @@ if(VE_BUILD_WEB)
set(VE_NODE_ROOT_DIR "${VE_REPO_ROOT}")
set(VE_WEB_DIR "${VE_REPO_ROOT}/vigilant-engine-frontend")

set(VE_OUT_RECOVERY "${CMAKE_SOURCE_DIR}/main/static/index.html")
set(VE_OUT_RECOVERY "${VE_REPO_ROOT}/build/static/recovery/index.html")
set(VE_WEB_STAMP "${CMAKE_BINARY_DIR}/ve_web_build.stamp")

file(GLOB_RECURSE VE_WEB_SOURCES CONFIGURE_DEPENDS
Expand Down
5 changes: 4 additions & 1 deletion vigilant-engine-recovery/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
get_filename_component(VE_REPO_ROOT "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
set(VE_RECOVERY_HTML "${VE_REPO_ROOT}/build/static/recovery/index.html")

idf_component_register(
SRCS "recovery_app.c"
INCLUDE_DIRS "."
EMBED_FILES
"static/index.html"
"${VE_RECOVERY_HTML}"
REQUIRES esp_wifi esp_netif esp_event nvs_flash esp_http_server app_update esp_partition
)

Expand Down
Loading