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

feat(hardware): Add support for boards based on Freenove ESP32S3-WROOM design (N16R8) #164

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9fe1017
feat(hardware): Add support for board Freenove ESP32S3 (and compatible)
Slider0007 Jul 19, 2024
3630edc
Update build action
Slider0007 Jul 19, 2024
ac928a9
Update
Slider0007 Jul 19, 2024
8236d29
Update sdkconfig
Slider0007 Jul 19, 2024
4ec60b7
Update status led --> active high
Slider0007 Jul 19, 2024
1c5d9b7
Update build action
Slider0007 Jul 21, 2024
d0c6b5d
Update
Slider0007 Jul 21, 2024
d359bae
Merge branch 'esp32s3wroom' of https://github.com/Slider0007/AI-on-th…
Slider0007 Jul 21, 2024
a531796
build action: add board specific subfolder
Slider0007 Aug 15, 2024
73b0341
Rename board to ESP32S3-N16R8
Slider0007 Sep 27, 2024
b6e441a
Merge branch 'develop'
Slider0007 Oct 10, 2024
4b49e62
Add freenove-esp32s3-n16r8 readme
Slider0007 Oct 10, 2024
0948eb9
Use hardware specific partition table
Slider0007 Oct 11, 2024
d8a9c5b
Merge branch 'esp32s3wroom' of https://github.com/Slider0007/AI-on-th…
Slider0007 Oct 11, 2024
910812a
Merge branch 'develop'
Slider0007 Oct 11, 2024
bd2bd32
Merge branch 'develop'
Slider0007 Nov 19, 2024
be34d49
Update partition table
Slider0007 Nov 19, 2024
8b1be89
Fix gpio pin init (smartled as default)
Slider0007 Nov 19, 2024
2e7b719
Add missing define
Slider0007 Nov 19, 2024
93f9dae
Add device readme
Slider0007 Nov 19, 2024
f4eb9ea
Cleanup
Slider0007 Nov 21, 2024
580a460
Cleanup docs
Slider0007 Nov 21, 2024
d8ede5b
Merge remote-tracking branch 'Slider0007/develop' into esp32s3wroom
Slider0007 Nov 24, 2024
5eb4b2d
Merge branch 'develop'
Slider0007 Dec 2, 2024
35ec791
Merge remote-tracking branch 'Slider0007/develop' into esp32s3wroom
Slider0007 Jan 9, 2025
e69e834
Init gpio handler in setup mode
Slider0007 Jan 9, 2025
71461f1
Update
Slider0007 Jan 10, 2025
dbfca4b
Merge remote-tracking branch 'Slider0007/develop' into esp32s3wroom
Slider0007 Jan 10, 2025
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
3 changes: 2 additions & 1 deletion .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
plat:
- esp32cam
- xiao-esp32s3-sense

- freenove-esp32s3-n16r8
steps:
- name: Checkout branch
if: ${{ ! needs.prepare-release.outputs.release_created }}
Expand Down Expand Up @@ -182,6 +182,7 @@ jobs:
plat:
- esp32cam
- xiao-esp32s3-sense
- freenove-esp32s3-n16r8

# Sets permissions of the GITHUB_TOKEN to allow downloading artifacts
permissions:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ As a result, you get the digitized value of your meter. There are several option
|:--- |:--- |:--- |:---
| [ESP32-CAM](http://www.ai-thinker.com/pro_view-24.html) | ESP32 | All |⚠️ Only boards with >4MB RAM are supported<br>⚠️ Beware of inferior quality Chinese clones
| [XIAO ESP32 Sense](https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html) | ESP32S3 | $\ge$ v17.0.0 |⚠️ Running quite hot, a small heat sink is recommended<br>ℹ️ No onboard illumination: Separate illumination (PWM controlable LED / Intelligent LED) required
| [ESP32S3-WROOM](https://github.com/Freenove/Freenove_ESP32_S3_WROOM_Board) | ESP32S3-WROOM-1-N16R8 | $\ge$ v17.0.0 |ℹ️ SOC and pin compatible borads of Freenove ESP32S3-WROOM with 16MB flash and 8MB RAM supported

### Camera
| Camera Type | Sensor Resolution | Digital Zoom | Firmware Release | Remarks
Expand Down
4 changes: 3 additions & 1 deletion code/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ dependencies.lock
sdkconfig.esp32cam
sdkconfig.esp32cam-localbuild
sdkconfig.xiao-esp32s3-sense
sdkconfig.xiao-esp32s3-sense-localbuild
sdkconfig.xiao-esp32s3-sense-localbuild
sdkconfig.freenove-esp32s3-n16r8
sdkconfig.freenove-esp32s3-n16r8-localbuild
9 changes: 9 additions & 0 deletions code/components/camera_ctrl/ClassControlCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,12 +1054,21 @@ void ClassControlCamera::setStatusLed(bool _status)
/* Set the GPIO as a push/pull output */
gpio_set_direction(GPIO_STATUS_LED_ONBOARD, GPIO_MODE_OUTPUT);

#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
if (!_status) {
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);
}
else {
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);
}
#else
if (_status) {
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);
}
else {
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);
}
#endif // GPIO_STATUS_LED_ONBOARD_LOWACTIVE
}
}

Expand Down
2 changes: 1 addition & 1 deletion code/components/gpio_ctrl/gpioControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ esp_err_t GpioHandler::loadParameter()
for (int i = 0; i < GPIO_SPARE_PIN_COUNT; ++i) {
if (strcmp(gpio_spare_usage[i], FLASHLIGHT_SMARTLED) == 0) {
GpioPin *gpioPin = new GpioPin((gpio_num_t)gpio_spare[i], ("gpio" + std::to_string((int)gpio_spare[i])).c_str(),
GPIO_PIN_MODE_FLASHLIGHT_SMARTLED, GPIO_INTR_DISABLE, 200, 5000, false, false, "",
GPIO_PIN_MODE_FLASHLIGHT_SMARTLED, GPIO_INTR_DISABLE, 200, 5000, false, false, false, "",
GPIO_FLASHLIGHT_DEFAULT_SMARTLED_TYPE, GPIO_FLASHLIGHT_DEFAULT_SMARTLED_QUANTITY,
Rgb{255, 255, 255}, 100);
(*gpioMap)[(gpio_num_t)gpio_spare[i]] = gpioPin;
Expand Down
17 changes: 9 additions & 8 deletions code/components/mainprocess_ctrl/MainFlowControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,20 @@ bool doInit(void)
cameraCtrl.printCamInfo();
}

// Init main flow components
// ********************************************
if (!flowctrl.initFlow()) {
flowctrl.deinitFlow();
return false;
}

// Init GPIO handler
// Note: It has to be initialized before MQTT (topic subscription)
// and after flow init (MQTT main topic parameter)
// ********************************************
if (!gpio_handler_init()) {
bRetVal = false;
}

// Init main flow components
// ********************************************
if (!flowctrl.initFlow()) {
flowctrl.deinitFlow();
return false;
}

// Init MQTT service
// ********************************************
#ifdef ENABLE_MQTT
Expand Down Expand Up @@ -937,6 +936,8 @@ void task_autodoFlow(void *pvParameter)
publishMqttData(mqttServer_getMainTopic() + "/process/status/process_state", flowctrl.getActualProcessState(), 1, false);
#endif // ENABLE_MQTT

gpio_handler_init(); // Init GPIO handler to handle flashlight requests during setup

while (true) { // Waiting for a REQUEST
vTaskDelay(1000 / portTICK_PERIOD_MS);
if (reloadConfig) {
Expand Down
38 changes: 34 additions & 4 deletions code/components/misc_helper/statusled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,53 @@ void task_StatusLED(void *pvParameter)

esp_rom_gpio_pad_select_gpio(GPIO_STATUS_LED_ONBOARD); // Init the GPIO
gpio_set_direction(GPIO_STATUS_LED_ONBOARD, GPIO_MODE_OUTPUT); // Set the GPIO as a push/pull output
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1); // LED off

for (int i = 0; i < 2;) // Default: repeat 2 times
{
#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1); // LED off
#else
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0); // LED off
#endif // GPIO_STATUS_LED_ONBOARD_LOWACTIVE

for (int i = 0; i < 2;) { // Default: repeat 2 times
if (!StatusLEDDataInt.bInfinite) {
++i;
}

for (int j = 0; j < StatusLEDDataInt.iSourceBlinkCnt; ++j) {
#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);
#else
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);
#endif // GPIO_STATUS_LED_ONBOARD_LOWACTIVE

vTaskDelay(StatusLEDDataInt.iBlinkTime / portTICK_PERIOD_MS);

#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);
#else
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);
#endif // GPIO_STATUS_LED_ONBOARD_LOWACTIVE

vTaskDelay(StatusLEDDataInt.iBlinkTime / portTICK_PERIOD_MS);
}

vTaskDelay(500 / portTICK_PERIOD_MS); // Delay between module code and error code

for (int j = 0; j < StatusLEDDataInt.iCodeBlinkCnt; ++j) {
#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);
#else
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);
#endif // GPIO_STATUS_LED_ONBOARD_LOWACTIVE

vTaskDelay(StatusLEDDataInt.iBlinkTime / portTICK_PERIOD_MS);

#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1);
#else
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0);
#endif // GPIO_STATUS_LED_ONBOARD_LOWACTIVE

vTaskDelay(StatusLEDDataInt.iBlinkTime / portTICK_PERIOD_MS);
}
vTaskDelay(1500 / portTICK_PERIOD_MS); // Delay to signal new round
Expand Down Expand Up @@ -146,5 +172,9 @@ void setStatusLedOff(void)

esp_rom_gpio_pad_select_gpio(GPIO_STATUS_LED_ONBOARD); // Init the GPIO
gpio_set_direction(GPIO_STATUS_LED_ONBOARD, GPIO_MODE_OUTPUT); // Set the GPIO as a push/pull output
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1); // LED off
#ifdef GPIO_STATUS_LED_ONBOARD_LOWACTIVE
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 1); // LED off
#else
gpio_set_level(GPIO_STATUS_LED_ONBOARD, 0); // LED off
#endif // GPIO_STATUS_LED_ONBOARD_LOWACTIVE
}
Loading
Loading