esp8266ex java编程_创建一个Arduino ESP8266库

在尝试将一个在Arduino Nano上正常运行的测试库移植到ESP8266时遇到崩溃问题。文章详细描述了在ESP8266上运行时遇到的LoadProhibited异常,附有堆栈信息和错误代码。作者寻求关于可能的错误原因和解决方案的帮助,提到使用的是Arduino IDE 1.8.2。
摘要由CSDN通过智能技术生成

我想为ESP8266或ESP32微控制器创建一个Arduino库 . 我写了一个测试库,它在Arduino Nano板上运行没有问题 . 这里是库cpp文件:

#include "Test.h"

Test::Test(){

}

uint32_t Test::libTest(strcttest* t){

uint32_t w;

w = t->a;

return w;

}

这是头文件:

#include

typedef struct {

uint32_t a;

uint32_t b;

}strcttest;

class Test

{

public:

Test();

uint32_t libTest(strcttest* t);

private:

};

最后但并非最不重要的是Arduino ino文件:

#include

//Instante Test

Test t;

void setup() {

// put your setup code here, to run once:

Serial.begin(9600);

Serial.println("Start");

}

void loop() {

// put your main code here, to run repeatedly:

//Create structure

strcttest *tt;

tt->a=1;

tt->b=2;

//Output result

Serial.println (t.libTest(tt));

delay(1000);

}

每个编译都可以使用Arduino Nano板以及ESP8266 / ESP32板 . 当我在Nano Board上运行时,我得到了预期的结果:

Start

1

1

1

1

1

1

1

1

1

...

当我在ESP8266板上运行时,我得到以下崩溃结果:

l*⸮⸮⸮⸮CI>⸮⸮⸮HB⸮⸮Start

Exception (28):

epc1=0x402024f8 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont

sp: 3ffef7d0 end: 3ffef9a0 offset: 01a0

>>>stack>>>

3ffef970: feefeffe 00000000 3ffee950 40201eb4

3ffef980: feefeffe feefeffe 3ffee96c 40202340

3ffef990: feefeffe feefeffe 3ffee980 40100108

<<

7!a!*6⸮⸮⸮Start

Exception (28):

epc1=0x402024f8 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont

sp: 3ffef7d0 end: 3ffef9a0 offset: 01a0

>>>stack>>>

3ffef970: feefeffe 00000000 3ffee950 40201eb4

3ffef980: feefeffe feefeffe 3ffee96c 40202340

3ffef990: feefeffe feefeffe 3ffee980 40100108

<<

ĜBs⸮`⸮"⸮⸮Start

...

最后但并非最不重要的是我收到的ESP开发板:

i%M/⸮`⸮i%M7

⸮⸮%Q=qU=\Md⸮aGd

Guru Meditation Error of type LoadProhibited occurred on core 1. Exception was unhandled.

Register dump:

PC : 0x400dde93 PS : 0x00060030 A0 : 0x800d0570 A1 : 0x3ffc7390

A2 : 0x3ffc1c30 A3 : 0x00000000 A4 : 0x0800001c A5 : 0xffffffff

A6 : 0xffffffff A7 : 0x00060d23 A8 : 0x800832e9 A9 : 0x3ffc7380

A10 : 0x00000003 A11 : 0x00060023 A12 : 0x00060020 A13 : 0x00000003

A14 : 0x00000001 A15 : 0x00000000 SAR : 0x0000001f EXCCAUSE: 0x0000001c

EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff

Backtrace: 0x400dde93:0x3ffc7390 0x400d0570:0x3ffc73b0 0x400d79b0:0x3ffc73d0

CPU halted.

所以我的问题是:我做错了什么 . 我错过了什么我没有用Arduino IDE,cpp,指针等理解的东西 .

对不起,我忘记了:我使用的是Arduino IDE 1.8.2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值