-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/dis_wdt' into 'main'
Disable WDTs, add flashing over JTAG See merge request idf/esp32c3-direct-boot-example!3
- Loading branch information
Showing
12 changed files
with
75 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set remotetimeout 10 | ||
target extended-remote | openocd -c "gdb_port pipe" -c "set ESP_RTOS none" -f "board/esp32c3-builtin.cfg" -c "init; reset halt" | ||
mon gdb_breakpoint_override hard | ||
mon flash write_image build/blink.bin 0 bin | ||
mon reset halt | ||
tb main | ||
c |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set remotetimeout 10 | ||
target extended-remote | openocd -c "gdb_port pipe" -c "set ESP_RTOS none" -f "board/esp32c3-builtin.cfg" -c "init; reset halt" | ||
mon gdb_breakpoint_override hard | ||
mon flash write_image build/hello_world.bin 0 bin | ||
mon reset halt | ||
tb main | ||
c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
#include <stdio.h> | ||
#include "hal/wdt_hal.h" | ||
|
||
static void delay(void); | ||
|
||
int main(void) | ||
{ | ||
printf("Hello, world!\n"); | ||
// Disable the watchdogs | ||
wdt_hal_context_t mwdt_ctx = {.inst = WDT_MWDT0, .mwdt_dev = &TIMERG0}; | ||
wdt_hal_write_protect_disable(&mwdt_ctx); | ||
wdt_hal_disable(&mwdt_ctx); | ||
wdt_hal_set_flashboot_en(&mwdt_ctx, false); | ||
wdt_hal_context_t rwdt_ctx = RWDT_HAL_CONTEXT_DEFAULT(); | ||
wdt_hal_write_protect_disable(&rwdt_ctx); | ||
wdt_hal_disable(&rwdt_ctx); | ||
wdt_hal_set_flashboot_en(&rwdt_ctx, false); | ||
// Super WDT is still enabled; no HAL API for it yet | ||
|
||
while(1) { | ||
printf("Hello, world!\n"); | ||
delay(); | ||
} | ||
return 0; | ||
} | ||
|
||
static void delay(void) | ||
{ | ||
for (int i = 0; i < 300000; i++) { | ||
asm volatile ("nop"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
This component provides a HAL for functions such as: | ||
* GPIO | ||
* WDT | ||
|
||
So that we don't have to implement the HAL from scratch, the source from https://github.com/espressif/esp-hal-components/tree/sync-3-master is used. Since the upstream CMakeLists.txt files can't yet be used a normal CMake library, the [CMakeLists.txt](CMakeLists.txt) of this component manually adds the right set of include directories and source files to the build. | ||
|
||
Note: this is done just for demonstration purposes, to be used in the examples. This component isn't intended to provide the HAL for all peripherals and all chips. |
File renamed without changes.