current stage

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2024-05-13 20:58:56 +02:00
parent f955848721
commit 84be50fd19
12 changed files with 57 additions and 42 deletions

1
.clang-format Normal file
View File

@@ -0,0 +1 @@
BasedOnStyle: Chromium

View File

@@ -6,6 +6,12 @@ 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:
@@ -13,16 +19,8 @@ jobs:
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 }}

View File

@@ -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)

View File

@@ -1,3 +1,3 @@
idf_component_register(SRCS "osr_ble.c"
INCLUDE_DIRS "."
REQUIRES "nvs_flash")
PRIV_REQUIRES "nvs_flash")

View File

@@ -3,18 +3,16 @@
#include <nvs.h>
#include <nvs_flash.h>
void nvs_init()
{
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)
{
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()
{
void osr_ble_init() {
nvs_init();
}

1
data/dummy.txt Normal file
View File

@@ -0,0 +1 @@
This is just a dummy file.

View File

@@ -1,23 +1,19 @@
#include <stdio.h>
#include <esp_task_wdt.h>
#include <stdio.h>
#include "osr_ble.h"
void setup()
{
void setup() {
osr_ble_init();
}
void loop()
{
void loop() {
ESP_ERROR_CHECK(esp_task_wdt_reset());
}
void app_main()
{
void app_main() {
setup();
while (1)
{
while (1) {
loop();
}
}

7
partitions.csv Normal file
View File

@@ -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,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x5000
3 otadata data ota 0xe000 0x2000
4 app0 app ota_0 0x10000 0x140000
5 app1 app ota_1 0x150000 0x140000
6 spiffs data spiffs 0x290000 0x160000
7 coredump data coredump 0x3F0000 0x10000

View File

@@ -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
@@ -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
sdkconfig.defaults linux Normal file
View File

@@ -0,0 +1,2 @@
# FreeRTOS Linux Simulator
CONFIG_IDF_TARGET="linux"

View File

@@ -0,0 +1,2 @@
# default ESP target
CONFIG_IDF_TARGET="esp32s3"

1
version.txt Normal file
View File

@@ -0,0 +1 @@
0.0.1