完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我正在使用由警报信号触发的中断服务例程以连续模式读取 ADS1115 ADC。该例程相当短,只需将值读入循环缓冲区,使用 350KHz 的 i2c 时钟执行大约需要 120 uSec。
这工作正常,将永远运行没有问题。 但是,在前台循环中我有 server.handleClient(); 响应网络请求。当我发出请求时,我通常会得到一个异常(偶尔第一个成功)。 如果我从 ISR 中取出 Wire 代码,则没有例外;ISR 仍由警报触发并以相同的速率执行。 ISR 代码是 代码:全选void ICACHE_RAM_ATTR adsAlertisr() { readCount++; Wire.requestFrom(ADS_ADDRESS,2); ADSBuffer[ADSBufferHead] = (Wire.read() << 8) | Wire.read(); ADSBufferHead = (ADSBufferHead + 1) & (ADS_BUFFER_SIZE - 1); } 异常堆栈跟踪是 代码:全选Exception 0: Illegal instruction PC: 0x40210fa8: TwoWire::requestFrom(int, int) at D:UtilsArduinohardwareespressifesp8266librariesWireWire.cpp line 132 EXCVADDR: 0x00000000 Decoding stack results 0x40100e38: interrupt_handler(void*) at D:UtilsArduinohardwareespressifesp8266coresesp8266core_esp8266_wiring_digital.cpp line 165 0x40100d78: interrupt_handler(void*) at D:UtilsArduinohardwareespressifesp8266coresesp8266core_esp8266_wiring_digital.cpp line 133 0x40100e49: interrupt_handler(void*) at D:UtilsArduinohardwareespressifesp8266coresesp8266core_esp8266_wiring_digital.cpp line 169 0x40100e38: interrupt_handler(void*) at D:UtilsArduinohardwareespressifesp8266coresesp8266core_esp8266_wiring_digital.cpp line 165 0x40100d78: interrupt_handler(void*) at D:UtilsArduinohardwareespressifesp8266coresesp8266core_esp8266_wiring_digital.cpp line 133 0x40210fb7: TwoWire::requestFrom(int, int) at D:UtilsArduinohardwareespressifesp8266librariesWireWire.cpp line 134 0x40100d78: interrupt_handler(void*) at D:UtilsArduinohardwareespressifesp8266coresesp8266core_esp8266_wiring_digital.cpp line 133 0x4021ac89: spiffs_phys_rd(spiffs*, u8_t, spiffs_file, u32_t, u32_t, u8_t*) at D:UtilsArduinohardwareespressifesp8266coresesp8266spiffsspiffs_cache.cpp line 163 0x4021866d: spiffs_obj_lu_find_entry_visitor(spiffs*, spiffs_block_ix, int, u8_t, spiffs_obj_id, spiffs_visitor_f, void const*, void*, spiffs_block_ix*, int*) at D:UtilsArduinohardwareespressifesp8266coresesp8266spiffsspiffs_nucleus.cpp line 186 0x40213c74: esp_yield() at D:UtilsArduinohardwareespressifesp8266coresesp8266core_esp8266_main.cpp line 91 0x401002c1: __wrap_spi_flash_read(uint32_t, uint32_t*, size_t) at D:UtilsArduinohardwareespressifesp8266coresesp8266core_esp8266_phy.cpp line 309 0x402112d5: EspClass::flashRead(unsigned int, unsigned int*, unsigned int) at D:UtilsArduinohardwareespressifesp8266coresesp8266Esp.cpp line 639 0x40215df8: spiffs_hal_read(unsigned int, unsigned int, unsigned char*) at D:UtilsArduinohardwareespressifesp8266coresesp8266spiffs_hal.cpp line 67 0x4021802b: spiffs_object_find_object_index_header_by_name_v(spiffs*, spiffs_obj_id, spiffs_block_ix, int, void const*, void*) at D:UtilsArduinohardwareespressifesp8266coresesp8266spiffsspiffs_nucleus.cpp line 1675 0x4021aca5: spiffs_phys_rd(spiffs*, u8_t, spiffs_file, u32_t, u32_t, u8_t*) at D:UtilsArduinohardwareespressifesp8266coresesp8266spiffsspiffs_cache.cpp line 155 0x40220e11: _vsnprintf_r at ../../../../../../dl/newlib-xtensa/newlib/libc/stdio/vsnprintf.c line 73 0x40218610: spiffs_obj_lu_find_entry_visitor(spiffs*, spiffs_block_ix, int, u8_t, spiffs_obj_id, spiffs_visitor_f, void const*, void*, spiffs_block_ix*, int*) at D:UtilsArduinohardwareespressifesp8266coresesp8266spiffsspiffs_nucleus.cpp line 169 0x40217fb0: spiffs_object_find_object_index_header_by_name_v(spiffs*, spiffs_obj_id, spiffs_block_ix, int, void const*, void*) at D:UtilsArduinohardwareespressifesp8266coresesp8266spiffsspiffs_nucleus.cpp line 1664 0x40212bfb: String::String(String const&) at D:UtilsArduinohardwareespressifesp8266coresesp8266WString.cpp line 38 0x40219f8a: spiffs_object_find_object_index_header_by_name(spiffs*, u8_t const*, spiffs_page_ix*) at D:UtilsArduinohardwareespressifesp8266coresesp8266spiffsspiffs_nucleus.cpp line 1705 0x40216c89: realloc(void*, size_t) at D:UtilsArduinohardwareespressifesp8266coresesp8266umm_mallocumm_malloc.cpp line 1508 0x40212968: String::changeBuffer(unsigned int) at D:UtilsArduinohardwareespressifesp8266coresesp8266WString.cpp line 179 0x40217a51: SPIFFS_stat(spiffs*, char const*, spiffs_stat*) at D:UtilsArduinohardwareespressifesp8266coresesp8266spiffsspiffs_hydrogen.cpp line 769 0x40212968: String::changeBuffer(unsigned int) at D:UtilsArduinohardwareespressifesp8266coresesp8266WString.cpp line 179 0x402157b2: SPIFFSImpl::exists(char const*) at D:UtilsArduinohardwareespressifesp8266coresesp8266spiffs_api.cpp line 63 0x402129e6: String::reserve(unsigned int) at D:UtilsArduinohardwareespressifesp8266coresesp8266WString.cpp line 148 0x402169c0: _umm_free(void*) at D:UtilsArduinohardwareespressifesp8266coresesp8266umm_mallocumm_malloc.cpp line 1304 0x40216de4: free(void*) at D:UtilsArduinohardwareespressifesp8266coresesp8266umm_mallocumm_malloc.cpp line 1764 0x4021cc01: fs::FS::exists(char const*) at D:UtilsArduinohardwareespressifesp8266coresesp8266FS.cpp line 229 0x402113fe: fs::FS::exists(String const&) at D:UtilsArduinohardwareespressifesp8266coresesp8266FS.cpp line 233 0x40202283: handleFileRead(String) at D:DocumentsArduinoPowerMeterDev/PowerMeterDev.ino line 338 0x402129e6: String::reserve(unsigned int) at D:UtilsArduinohardwareespressifesp8266coresesp8266WString.cpp line 148 0x40212be0: String::operator=(String const&) at D:UtilsArduinohardwareespressifesp8266coresesp8266WString.cpp line 259 0x40202386: std::_Function_handler ::_M_invoke(const std::_Any_data &) at D:DocumentsArduinoPowerMeterDev/PowerMeterDev.ino line 718 0x40207412: std::function ::operator()() const at d:utilsarduinohardwareespressifesp8266toolsxtensa-lx106-elfxtensa-lx106-elfincludec++4.8.2/functional line 2465 0x4020753a: ESP8266WebServer::_handleRequest() at D:UtilsArduinohardwareespressifesp8266librariesESP8266WebServersrcESP8266WebServer.cpp line 607 0x40100c50: millis() at D:UtilsArduinohardwareespressifesp8266coresesp8266core_esp8266_wiring.cpp line 186 0x4021c0a8: WiFiServer::available(unsigned char*) at D:UtilsArduinohardwareespressifesp8266librariesESP8266WiFisrcWiFiServer.cpp line 116 0x4020772c: ESP8266WebServer::handleClient() at D:UtilsArduinohardwareespressifesp8266librariesESP8266WebServersrcESP8266WebServer.cpp line 308 0x40203520: loop() at D:DocumentsArduinoPowerMeterDev/PowerMeterDev.ino line 733 0x40213d24: loop_wrapper() at D:UtilsArduinohardwareespressifesp8266coresesp8266core_esp8266_main.cpp line 125 |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
310 浏览 1 评论
550浏览 6评论
460浏览 5评论
有没有办法在不使用混杂模式的情况下实现Wifi驱动程序接收缓冲区访问中断呢?
442浏览 5评论
444浏览 4评论
415浏览 4评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 02:20 , Processed in 0.711791 second(s), Total 76, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号