Espressif8266 OOM docs wrong
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 55/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
调研方向
打开 Espressif8266 文档页面的 Debug Level 部分,并将其中的 build_flags 示例与链接的 PlatformIO 报告进行比较。如有需要,复现所示的 platformio.ini 配置,然后更新说明,使 out-of-memory detector 的指导不会导致汇编编译错误;验证文档中的示例仍然可用。
由索引模型根据 Issue 内容生成。
描述
https://docs.platformio.org/en/latest/platforms/espressif8266.html#debug-level says to basically add
build_flags =
-DDEBUG_ESP_PORT=Serial
-DDEBUG_ESP_OOM
-include "umm_malloc/umm_malloc_cfg.h"
to the platformio.ini of a Arduino-ESP8266 project to enable the out-of-memory detection system in the core.
However, the -include flags leads to a multitude of compile errors the moment an assembly file (cont.S) is compiled. Full platformio.ini of
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
monitor_speed = 74880
build_flags =
-DDEBUG_ESP_PORT=Serial
-DDEBUG_ESP_OOM
-include "umm_malloc/umm_malloc_cfg.h"
Results in
Compiling .pio\build\nodemcuv2\FrameworkArduino\cont.S.o
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h: Assembler messages:
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:22: Error: unknown opcode or format name 'typedef'
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:23: Error: unknown opcode or format name 'typedef'
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:26: Error: unknown opcode or format name 'typedef'
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:27: Error: unknown opcode or format name 'typedef'
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:30: Error: unknown opcode or format name 'typedef'
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:31: Error: unknown opcode or format name 'typedef'
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:34: Error: unknown opcode or format name 'typedef'
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:35: Error: unknown opcode or format name 'typedef'
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:38: Error: unknown opcode or format name 'typedef'
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:39: Error: unknown opcode or format name 'typedef'
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:42: Error: unknown opcode or format name 'typedef'
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:43: Error: unknown opcode or format name 'typedef'
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:46: Error: unknown opcode or format name 'typedef'
c:\users\max\.platformio\packages\[email protected]\xtensa-lx106-elf\include\machine\_default_types.h:47: Error: unknown opcode or format name 'typedef'
This header file is not assembly-file safe.
Removing the -include instruction allows for succesful compilation, and seemingly working OOM detection in a minimal example code
#include <Arduino.h>
void setup() {
delay(1000);
Serial.begin(74880);
Serial.println("Testing out-of-memory...");
}
void loop() {
Serial.println("Mallocing 5K.."); Serial.flush();
void* ptr = malloc(5 * 1024);
Serial.print("Alloced ptr "); Serial.println((unsigned int) ptr, HEX);
Serial.print("Now free: " );
Serial.println(ESP.getFreeHeap());
if(ptr == nullptr) {
Serial.println("malloc() returned NULL!! Ran out of memory");
delay(10000); //"halt"
}
}
with the last few lines of the output being
Now free: 712
Mallocing 5K..
:oom(5120)@main.cpp:11
Alloced ptr 0
which does not come from the sketch code but from the OOM detector.
The documentation should be corrected in regards for activating the out-of-memory detector, or any other features that can be enabled through umm_malloc_cfg.h.
- 主要语言
- Python
- 星标
- 288
- 派生
- 361
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
platformio/platformio-docs 的其他 Issue
-
难度 5/5 一周以上 新手友好度 20/100
platformio/platformio-docs#409 ·
-
难度 3/5 1-2 天 新手友好度 55/100
platformio/platformio-docs#406 ·
-
难度 5/5 一周以上 新手友好度 15/100
platformio/platformio-docs#398 ·
-
难度 3/5 1-2 天 新手友好度 42/100
platformio/platformio-docs#393 · 1 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 45/100
platformio/platformio-docs#390 ·
查看 platformio/platformio-docs 的全部 Issue
相似的 Issue
-
docs(contributing): the two things that silently block a PR可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭available documentation good first issue
难度 1/5 1-3 小时 新手友好度 95/100
Nixitov/Riptide-Native#944 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
JTHCode/secretguard#24 ·
维护者通常 1 天内回复
-
area: middleware documentation good first issue
难度 2/5 1-3 小时 新手友好度 88/100
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
omarelshamy25x/shamy-hijri#63 ·
维护者通常 1 天内回复