esp32 上构造当前 task 栈内存被程序别的地方踩踏引起的 crash

本文探讨了ESP32微控制器中遇到的一个问题,即当前任务栈内存被其他程序部分错误地占用,从而引起系统崩溃。通过对现象的深入分析,揭示了栈内存管理的潜在风险及其对系统稳定性的影响。
摘要由CSDN通过智能技术生成

在这里插入图片描述

/* Hello World Example

   This example code is in the Public Domain (or CC0 licensed, at your option.)

   Unless required by applicable law or agreed to in writing, this
   software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
   CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
#define DATA_LEN  100

static void echo_task1()
{
    int data[DATA_LEN] = { 1 };
    printf("%p \n", &data[0]);

    for(int i=0; i < DATA_LEN; i++) {
        data[i] = 100;
        // printf("-data[i]-%d--%d----\r\n", i, data[i]);
            
    }
    while(1) {
        
        for(int i=0; i < DATA_LEN; i++) {
            printf("-d
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值