Skip to content

Commit

Permalink
current stage
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Siegmund <[email protected]>
  • Loading branch information
mars3142 committed May 13, 2024
1 parent f955848 commit 84be50f
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 42 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BasedOnStyle: Chromium
20 changes: 9 additions & 11 deletions .github/workflows/esp32_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ on:

jobs:
build:
strategy:
matrix:
idf_ver:
[release-v4.4.6, release-v5.0.5, release-v5.1.3, release-v5.2.1]
idf_target: [esp32, esp32s3, esp32c3]

runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: esp-idf build
- name: ESP-IDF build
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v5.2.1
target: esp32s3
- name: Archive build output artifacts
uses: actions/upload-artifact@v4
with:
name: build
path: |
build/bootloader/bootloader.bin
build/partition_table/partition-table.bin
build/${{ github.event.repository.name }}.bin
esp_idf_version: ${{ matrix.idf_ver }}
target: ${{ matrix.idf_target }}
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(firmware_thomas_the_tank_engine)

# idf_build_set_property(COMPILE_OPTIONS "-Wno-error" APPEND)
idf_build_set_property(COMPILE_OPTIONS "-Werror" APPEND)
spiffs_create_partition_image(spiffs data FLASH_IN_PROJECT)
2 changes: 1 addition & 1 deletion components/ble/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
idf_component_register(SRCS "osr_ble.c"
INCLUDE_DIRS "."
REQUIRES "nvs_flash")
PRIV_REQUIRES "nvs_flash")
22 changes: 10 additions & 12 deletions components/ble/osr_ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@
#include <nvs.h>
#include <nvs_flash.h>

void nvs_init()
{
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
{
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK(ret);
void nvs_init() {
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES ||
ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK(ret);
}

void osr_ble_init()
{
nvs_init();
void osr_ble_init() {
nvs_init();
}
1 change: 1 addition & 0 deletions data/dummy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is just a dummy file.
24 changes: 10 additions & 14 deletions main/main.c
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
#include <stdio.h>
#include <esp_task_wdt.h>
#include <stdio.h>

#include "osr_ble.h"

void setup()
{
osr_ble_init();
void setup() {
osr_ble_init();
}

void loop()
{
ESP_ERROR_CHECK(esp_task_wdt_reset());
void loop() {
ESP_ERROR_CHECK(esp_task_wdt_reset());
}

void app_main()
{
setup();
while (1)
{
loop();
}
void app_main() {
setup();
while (1) {
loop();
}
}
7 changes: 7 additions & 0 deletions partitions.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x140000,
app1, app, ota_1, 0x150000,0x140000,
spiffs, data, spiffs, 0x290000,0x160000,
coredump, data, coredump,0x3F0000,0x10000,
14 changes: 11 additions & 3 deletions sdkconfig.defaults
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# default ESP target
CONFIG_IDF_TARGET="esp32s3"

# activate Bluetooth Low Energy (BLE)
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y
Expand All @@ -9,3 +6,14 @@ CONFIG_BT_NIMBLE_ENABLED=y
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_LOG_MAXIMUM_LEVEL=4

# Flash Size
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

# Partitions
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_MD5=y
2 changes: 2 additions & 0 deletions sdkconfig.defaults linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# FreeRTOS Linux Simulator
CONFIG_IDF_TARGET="linux"
2 changes: 2 additions & 0 deletions sdkconfig.defaults.esp32s3
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# default ESP target
CONFIG_IDF_TARGET="esp32s3"
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.1

0 comments on commit 84be50f

Please sign in to comment.