misc adjustment of esp32 component

This commit is contained in:
morris
2019-03-26 16:30:43 +08:00
committed by suda-morris
parent 30e3e26834
commit f5b03c9ea3
62 changed files with 146 additions and 302 deletions
@@ -14,7 +14,7 @@
#include <string.h>
#include <stdbool.h>
#include "esp32/rom/crc.h"
#include "esp_panic.h"
#include "esp_debug_helpers.h"
#include "esp_partition.h"
#include "esp_core_dump_priv.h"
@@ -37,15 +37,15 @@ static esp_err_t esp_core_dump_write_binary(void *frame, core_dump_write_config_
task_num = esp_core_dump_get_tasks_snapshot(tasks, CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM, &tcb_sz);
ESP_COREDUMP_LOGI("Found tasks: (%d)!", task_num);
// Take TCB padding into account, actual TCB size will be stored in header
if (tcb_sz % sizeof(uint32_t))
tcb_sz_padded = (tcb_sz / sizeof(uint32_t) + 1) * sizeof(uint32_t);
else
tcb_sz_padded = tcb_sz;
// Verifies all tasks in the snapshot
for (i = 0; i < task_num; i++) {
for (i = 0; i < task_num; i++) {
task_is_valid = esp_core_dump_process_tcb(frame, &tasks[i], tcb_sz);
// Check if task tcb is corrupted
if (!task_is_valid) {
@@ -67,7 +67,7 @@ static esp_err_t esp_core_dump_write_binary(void *frame, core_dump_write_config_
// Add core dump header size
data_len += sizeof(core_dump_header_t);
ESP_COREDUMP_LOG_PROCESS("Core dump len = %lu (%d %d)", data_len, task_num, write_cfg->bad_tasks_num);
// Prepare write
if (write_cfg->prepare) {
err = write_cfg->prepare(write_cfg->priv, &data_len);
+3 -3
View File
@@ -13,7 +13,7 @@
// limitations under the License.
#include <string.h>
#include <stdbool.h>
#include "esp_panic.h"
#include "esp_debug_helpers.h"
#include "esp_core_dump_priv.h"
const static DRAM_ATTR char TAG[] __attribute__((unused)) = "esp_core_dump_port";
@@ -41,7 +41,7 @@ uint32_t esp_core_dump_get_tasks_snapshot(core_dump_task_header_t* const tasks,
bool esp_core_dump_process_tcb(void *frame, core_dump_task_header_t *task_snaphort, uint32_t tcb_sz)
{
XtExcFrame *exc_frame = (XtExcFrame*)frame;
if (!esp_tcb_addr_is_sane((uint32_t)task_snaphort->tcb_addr, tcb_sz)) {
ESP_COREDUMP_LOG_PROCESS("Bad TCB addr %x!", task_snaphort->tcb_addr);
return false;
@@ -74,7 +74,7 @@ bool esp_core_dump_process_tcb(void *frame, core_dump_task_header_t *task_snapho
}
bool esp_core_dump_process_stack(core_dump_task_header_t* task_snaphort, uint32_t *length)
{
{
uint32_t len = 0;
bool task_is_valid = false;
len = (uint32_t)task_snaphort->stack_end - (uint32_t)task_snaphort->stack_start;