-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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/ulp_riscv_test_multiple_firmware' into 'master'
ulp-riscv: Added API ulp_riscv_reset to reset the ULP core See merge request espressif/esp-idf!22165
- Loading branch information
Showing
6 changed files
with
157 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
set(app_sources "test_app_main.c" "test_ulp_riscv.c") | ||
set(ulp_sources "ulp/test_main.c") | ||
set(ulp_sources2 "ulp/test_main_second_cocpu_firmware.c") | ||
set(ulp_sources3 "ulp/test_main_cocpu_crash.c") | ||
|
||
idf_component_register(SRCS ${app_sources} | ||
INCLUDE_DIRS "ulp" | ||
REQUIRES ulp unity | ||
WHOLE_ARCHIVE) | ||
|
||
set(ulp_app_name ulp_test_app) | ||
set(ulp_app_name2 ulp_test_app2) | ||
set(ulp_app_name3 ulp_test_app3) | ||
set(ulp_exp_dep_srcs ${app_sources}) | ||
ulp_embed_binary(${ulp_app_name} "${ulp_sources}" "${ulp_exp_dep_srcs}") | ||
ulp_embed_binary(${ulp_app_name2} "${ulp_sources2}" "${ulp_exp_dep_srcs}") | ||
ulp_embed_binary(${ulp_app_name3} "${ulp_sources3}" "${ulp_exp_dep_srcs}") |
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
18 changes: 18 additions & 0 deletions
18
components/ulp/test_apps/ulp_riscv/main/ulp/test_main_cocpu_crash.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdint.h> | ||
|
||
int main (void) | ||
{ | ||
/* Make sure ULP core crashes by doing a NULL pointer access */ | ||
uint32_t *null_ptr = NULL; | ||
*null_ptr = 1; | ||
|
||
/* ulp_riscv_halt() is called automatically when main exits */ | ||
return 0; | ||
} |
17 changes: 17 additions & 0 deletions
17
components/ulp/test_apps/ulp_riscv/main/ulp/test_main_second_cocpu_firmware.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <stdint.h> | ||
|
||
volatile uint32_t riscv_counter2 = 0; | ||
|
||
int main (void) | ||
{ | ||
riscv_counter2++; | ||
|
||
/* ulp_riscv_halt() is called automatically when main exits */ | ||
return 0; | ||
} |
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