Skip to content

Commit 8647627

Browse files
committed
add rest to factory app
1 parent aa58b94 commit 8647627

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,27 @@ The default configuration for ESP32-S3-BOX-3.
77
For M5Stack-CoreS3 - uncomment BSP in `idf_component.yml`
88

99

10+
## Quick start
11+
12+
```shell
13+
idf.py build flash
14+
pushd apps/tic_tac_toe
15+
idf.py build
16+
esptool.py --chip esp32s3 --baud 921600 --before default_reset --after hard_reset write_flash 0x220000 build/tic_tac_toe.bin
17+
popd
18+
```
19+
1020
## Build
1121

1222
Initial build and flash of the application and partition table.
1323

14-
```
24+
```shell
1525
idf.py build flash monitor
1626
```
1727

1828
After the initial flash, it's possible to use following command, just to update the factory application:
1929

20-
```
30+
```shell
2131
idf.py app-flash monitor
2232
```
2333

@@ -26,7 +36,7 @@ idf.py app-flash monitor
2636
Applications are stored in ota_0 - ota_4.
2737

2838
Build application (e.g. hello_world):
29-
```
39+
```shell
3040
idf.py build
3141
```
3242

@@ -53,7 +63,7 @@ The bootloader is using OTA mechanism. It's necessary to add following code to t
5363
in order to reboot to bootloader.
5464

5565
Put the following code to main, before starting the rest of the application:
56-
```
66+
```c
5767
#include "esp_ota_ops.h"
5868

5969
const esp_partition_t* factory_partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_FACTORY, NULL);
@@ -64,7 +74,9 @@ if (factory_partition != NULL) {
6474

6575
Here's more elaborate version which can be put somwhere into application, like reaction on back button:
6676

67-
```
77+
```c
78+
#include "esp_ota_ops.h"
79+
6880
// Get the partition structure for the factory partition
6981
const esp_partition_t *factory_partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_FACTORY, NULL);
7082
if (factory_partition != NULL) {
@@ -87,6 +99,6 @@ If the project is using explicit list of components, you need to add `app_update
8799
idf_component_register(
88100
SRCS "main.cpp"
89101
INCLUDE_DIRS "."
90-
REQUIRES esp-box-3 app_update
102+
REQUIRES app_update
91103
)
92104
```

apps/tic_tac_toe/main/tic_tac_toe.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "esp_log.h"
66
#include "lvgl.h"
77
#include "bsp/esp-bsp.h"
8+
#include "esp_ota_ops.h"
89

910
#define TAG "TicTacToe"
1011

0 commit comments

Comments
 (0)