构建支持 u8g2 的 nodemcu (lua) esp32-dev 固件不包含请求的显示驱动程序

问题描述 投票:0回答:1

nodemcu
esp32-dev
分支克隆到
raspberry pi 5
。使用基本模块构建的固件看起来不错,使用
espressif esp32-wroom-32
生成 bin 文件并刷新到
esptool
(也是通用 32E,开发套件 1,...)。然而,使用 make
u8g2 for i2c
添加
menuconfig
,然后 make 会导致缺少
u8g2.ssd1306_i2c_128x64_noname
。值得注意的是,存在所选的 3 种字体,例如
u8g2.font_6x10_tf

可能感兴趣,请显示此

/home/pi/esp32/nodemcu-firmware-esp32-241010a/components/modules/u8g2.c:617:12: warning: 'ldisplay_i2c' defined but not used [-Wunused-function]
  617 | static int ldisplay_i2c( lua_State *L, display_setup_fn_t setup_fn )

期待这样的事情(来自

esp8266
,但是
chilipeppr esp32
静态固件看起来很相似,并且在这个例子中工作得很好)

for k,v in pairs(u8g2) do print(k,v) end
ssd1306_i2c_128x64_noname   function: 0x4024c0b8
uc1601_i2c_128x32   function: 0x4024c09c
ssd1306_i2c_128x32_univision    function: 0x4024c080
ssd1305_i2c_128x32_noname   function: 0x4024c064
ssd1306_128x64_noname   function: 0x4024c0f8
font_6x10_tf    lightfunction: 0x4027e800
font_unifont_t_symbols  lightfunction: 0x4027c518
DRAW_UPPER_RIGHT    1
DRAW_UPPER_LEFT 2
DRAW_LOWER_RIGHT    8
DRAW_LOWER_LEFT 4
DRAW_ALL    15
R0  lightfunction: 0x4027f014
R1  lightfunction: 0x4027f008
R2  lightfunction: 0x4027effc
R3  lightfunction: 0x4027eff0
MIRROR  lightfunction: 0x4027efe4

通过

esp32
构建,我得到了这个(缺少显示驱动程序)

for k,v in pairs(u8g2) do print(k,v) end
font_6x10_tf    userdata: 0x3f40a51e
font_unifont_t_symbols  userdata: 0x3f408236
font_chikita_tf userdata: 0x3f407ae5
DRAW_UPPER_RIGHT    1
DRAW_UPPER_LEFT 2
DRAW_LOWER_RIGHT    8
DRAW_LOWER_LEFT 4
DRAW_ALL    15
R0  userdata: 0x3f40ad30
R1  userdata: 0x3f40ad24
R2  userdata: 0x3f40ad18
R3  userdata: 0x3f40ad0c
MIRROR  userdata: 0x3f40ad00

搜索品牌列表会显示可能感兴趣的内容。

Including the following modules: FILE;GPIO;HTTP;I2C;NET;NODE;OW;PIPE;TMR;U8G2;UART;WIFI
awk: line 2: function strtonum never defined

这些重复

RMT
sigma-delta
adc
dac
i2c

/home/pi/esp32/nodemcu-firmware-esp32-241010a/sdk/esp32-esp-idf/components/driver/deprecated/driver/i2s.h:27:2: warning: #warning "This set of I2S APIs has been deprecated, please include 'driver/i2s_std.h', 'driver/i2s_pdm.h' or 'driver/i2s_tdm.h' instead. if you want to keep using the old APIs and ignore this warning, you can enable 'Suppress leagcy driver deprecated warning' option under 'I2S Configuration' menu in Kconfig" [-Wcpp]
   27 | #warning "This set of I2S APIs has been deprecated, \

我尝试过单独使用

i2c
spi
i2c
驱动程序进行构建

来自 make menuconfig 的片段如下

[*] U8G2 module
        Displays  --->
        Fonts  --->

[*] I2C  --->
[ ] SPI  ----

[*] ssd1306_i2c_128x32_univision
[*] ssd1306_i2c_128x64_noname

(font_6x10_tf,font_unifont_t_symbols,font_chikita_tf) Font list

Nodemcu 启动头文件

NodeMCU ESP32 build 2024-11-07 03:38 powered by Lua 5.3.5 [5.3-int32-singlefp] on IDF v5.1.3
cannot open init.lua: No such file or directory
> =node.heap()
209168

构建配置

for k,v in pairs(node.info("build_config")) do print (k,v) end
number_type float
ssl true
esp_console uart
lfs_size    262144
modules file,gpio,http,i2c,net,node,ow,pipe,tmr,u8g2,uart,wifi

sdkconfig
在制作之前删除
menuconfig

回顾我的笔记,另一个可能的线索是,在固件构建设置期间,由于 make 期间出现以下错误(后来更改为 256K),我通过将

components/modules/node.c
替换为 0 来修改
BUILDINFO_LFS_SIZE

/home/pi/esp32/nodemcu-firmware-esp32-241010a/components/modules/node.c: In function 'node_info':
/home/pi/esp32/nodemcu-firmware-esp32-241010a/components/modules/node.c:475:45: error: expected expression before ',' token
  475 |       add_int_field(L,    BUILDINFO_LFS_SIZE,   "lfs_size");
...
make failed with exit code 2, output of the command is in the /home/pi/esp32/nodemcu-firmware-esp32-241010a/build/log/idf_py_stderr_output_7451 and /home/pi/esp                                       32/nodemcu-firmware-esp32-241010a/build/log/idf_py_stdout_output_7451
make[1]: *** [Makefile:18: all] Error 2
make[1]: Leaving directory '/home/pi/esp32/nodemcu-firmware-esp32-241010a'
make: *** [Makefile:10: all] Error 2
lua esp32 nodemcu firmware
1个回答
0
投票

由于make时出现以下错误,我修改了components/modules/node.c,将BUILDINFO_LFS_SIZE替换为0(后来更改为256K)

为了计算 BUILDINFO_LFS_SIZE,当前使用

awk "{print strtonum( $1 )}"
strtonum()
函数是
gawk
扩展。但 Debian 稳定版默认不包含
gawk
软件包。

您应该安装

gawk
软件包或应用 PR#3675

© www.soinside.com 2019 - 2024. All rights reserved.