Closed ystrem closed 9 years ago
I just made a pull request for that https://github.com/nekromant/esp8266-frankenstein/pull/42
in the mean time, you can add #include
On jeu., mars 19, 2015 at 12:07:46 -0700, ystrem wrote:
ystrem@ubuntu:~/esp8266-frankenstein$ make [GEN] /home/ystrem/esp8266-frankenstein/tmp/edeploy.mk [GEN] /home/ystrem/esp8266-frankenstein/tmp/deploy.mk [GEN] /home/ystrem/esp8266-frankenstein/tmp/arch.mk [INFO] Config changed, running silentoldconfig [CHECK] bash [CHECK] sed [CHECK] awk [GEN] /home/ystrem/esp8266-frankenstein/tmp/arch.kcnf [GEN] /home/ystrem/esp8266-frankenstein/tmp/all-arch.kcnf [GEN] /home/ystrem/esp8266-frankenstein/tmp/deploy.kcnf [GEN] /home/ystrem/esp8266-frankenstein/tmp/all-deploy.kcnf [GEN] /home/ystrem/esp8266-frankenstein/tmp/edeploy.kcnf [GEN] /home/ystrem/esp8266-frankenstein/tmp/all-edeploy.kcnf [VERSION] 0.2-rc1, Insane Mushroom; git commit: 64304081377ff8ef93034af3e7bc2814e1fe588c [INFO] Building application code [CC] main.o [CC] stdio.o [CC] helpers.o [CC] microrl.o [CC] console.o [CC] hostname.o [CC] env.o [CC] cb.o [CC] cbtools.o [CC] tcpservice.o [CC] svc_telnet.o [CC] cmd_common.o [CC] cmd_env.o [CC] uart.o [CC] cmd_iw.o [CC] cmd_uart.o [CC] cmd_ifconfig.o [CC] cmd_gpio.o [CC] cmd_flash.o [CC] cmd_listen.o [CC] cmd_send.o [CC] cmd_ds18b20.o [CC] cmd_dht11.o [CC] cmd_tftp.o [CC] tftp.o [CC] cmd_at.o [CC] cmd_adc.o [CC] cmd_i2c.o [CC] pin_map.o [CC] i2c_master.o [CC] i2c_bmp180.o In file included from /home/ystrem/esp8266-frankenstein/src/i2c_bmp180.c:3:0: /home/ystrem/esp8266-frankenstein/include/console.h:55:26: error: unknown type name 'size_t' int vsnprintf(char *str, size_t size, const char *format, va_list ap); ^ make[1]: *** [i2c_bmp180.o] Error 1 make: *** [builtin] Error 2
Reply to this email directly or view it on GitHub: https://github.com/nekromant/esp8266-frankenstein/issues/40
Yep, I can compile it now. :]
ystrem@ubuntu:~/esp8266-frankenstein$ make
[GEN] /home/ystrem/esp8266-frankenstein/tmp/deploy.mk
[GEN] /home/ystrem/esp8266-frankenstein/tmp/arch.mk
[GEN] /home/ystrem/esp8266-frankenstein/tmp/edeploy.mk
[INFO] Config changed, running silentoldconfig
[CHECK] bash
[CHECK] sed
[CHECK] awk
[GEN] /home/ystrem/esp8266-frankenstein/tmp/arch.kcnf
[GEN] /home/ystrem/esp8266-frankenstein/tmp/all-arch.kcnf
[GEN] /home/ystrem/esp8266-frankenstein/tmp/deploy.kcnf
[GEN] /home/ystrem/esp8266-frankenstein/tmp/all-deploy.kcnf
[GEN] /home/ystrem/esp8266-frankenstein/tmp/edeploy.kcnf
[GEN] /home/ystrem/esp8266-frankenstein/tmp/all-edeploy.kcnf
[VERSION] 0.2-rc1, Insane Mushroom; git commit: 64304081377ff8ef93034af3e7bc2814e1fe588c
*
* Restart config...
*
*
* HeatShrink
*
HeatShrink (LIB_HEATSHRINK) [N/y] (NEW) y
Encoder (LIB_HEATSHRINK_ENCODE) [N/y] (NEW) y
Decoder (LIB_HEATSHRINK_DECODE) [N/y] (NEW) y
Use dynamic memory allocation alloc (LIB_HEATSHRINK_DYNAMIC_ALLOC) [N/y] (NEW) y
Use index during compression (LIB_HEATSHRINK_USE_INDEX) [N/y] (NEW) y
*
* Modules to build
*
Wireless commands (CMD_IW) [Y/n] y
UART commands (CMD_UART) [N/y] (NEW) y
ifconfig/apconfig (CMD_IF) [Y/n] y
GPIO commands (CMD_GPIO) [Y/n] y
FLASH commands (CMD_FLASH) [Y/n] y
Listen on a port (CMD_LISTEN) [Y/n] y
Send data over TCP (CMD_SEND) [Y/n] y
TFTP firmware update support (CMD_TFTP) [Y/n] y
AT to say OK (CMD_AT) [Y/n] y
System ADC support (CMD_ADC) [Y/n] y
*
* I2C support (experimental)
*
I2C support (experimental) (CMD_I2C) [N/y] (NEW) y
I2C bmp180 pressure sensor (CMD_I2C_BMP180) [N/y] (NEW) y
I2C sht21 humidity sensor (CMD_I2C_SHT21) [N/y] (NEW) y
I2C bh1750 light sensor (CMD_I2C_BH1750) [N/y] (NEW) y
I2C pcf8591 8-bit ADC DAC (CMD_I2C_PCF8591) [N/y] (NEW) y
I2C ina219 current sensor (CMD_I2C_INA219) [N/y] (NEW) y
I2C tcs3414cs color sensor (Needs testing) (CMD_I2C_TCS3414CS) [N/y] (NEW) y
I2C mlx90614 temperature sensor (Needs testing) (CMD_I2C_MLX90614) [N/y] (NEW) y
I2C hmc5883l 3-Axis Digital Compass (Needs testing) (CMD_I2C_HMC5883L) [N/y] (NEW) y
*
* DHT11 Thermal & Humidity Sensor support (Needs testing)
*
DHT11 Thermal & Humidity Sensor support (Needs testing) (CMD_DHT11) [N/y] (NEW) y
DHT11 Debugging (CMD_DHT11_DEBUG) [N/y/?] (NEW) y
#
# configuration written to .config
#
[INFO] Building application code
[CC] main.o
[CC] stdio.o
[CC] helpers.o
[CC] microrl.o
[CC] console.o
[CC] hostname.o
[CC] env.o
[CC] cb.o
[CC] cbtools.o
[CC] tcpservice.o
[CC] svc_telnet.o
[CC] cmd_common.o
[CC] cmd_env.o
[CC] uart.o
[CC] cmd_iw.o
[CC] cmd_uart.o
[CC] cmd_ifconfig.o
[CC] cmd_gpio.o
[CC] cmd_flash.o
[CC] cmd_listen.o
[CC] cmd_send.o
[CC] cmd_ds18b20.o
[CC] cmd_dht11.o
[CC] cmd_tftp.o
[CC] tftp.o
[CC] cmd_at.o
[CC] cmd_adc.o
[CC] cmd_i2c.o
[CC] pin_map.o
[CC] i2c_master.o
[CC] i2c_bmp180.o
[CC] i2c_ina219.o
[CC] i2c_sht21.o
[CC] i2c_bh1750.o
[CC] i2c_pcf8591.o
[CC] i2c_hmc5883l.o
/home/ystrem/esp8266-frankenstein/src/i2c_hmc5883l.c: In function 'HMC5883_Read':
/home/ystrem/esp8266-frankenstein/src/i2c_hmc5883l.c:39:5: warning: implicit declaration of function 'i2c_master_readRegister16' [-Wimplicit-function-declaration]
LAST_HMC5883_VECTOR.X = ((float)i2c_master_readRegister16(HMC5883L_ADDRESS, HMC5883L_REG_OUT_X_M)) * mgPerDigit;
^
/home/ystrem/esp8266-frankenstein/src/i2c_hmc5883l.c: In function 'HMC5883_SetConfig':
/home/ystrem/esp8266-frankenstein/src/i2c_hmc5883l.c:86:5: warning: implicit declaration of function 'i2c_master_writeRegister' [-Wimplicit-function-declaration]
if(!i2c_master_writeRegister(HMC5883L_ADDRESS, HMC5883L_REG_CONFIG_B, range << 5)){
^
/home/ystrem/esp8266-frankenstein/src/i2c_hmc5883l.c:91:5: warning: implicit declaration of function 'i2c_master_readRegister8' [-Wimplicit-function-declaration]
value = i2c_master_readRegister8(HMC5883L_ADDRESS, HMC5883L_REG_MODE);
^
[CC] i2c_tcs3414cs.o
[CC] i2c_mlx90614.o
[GEN] built-in.o
[CC] api_lib.o
[CC] api_msg.o
[CC] err.o
[CC] netbuf.o
[CC] netdb.o
[CC] netifapi.o
[CC] sockets.o
[CC] tcpip.o
[GEN] built-in.o
[CC] dhcpserver.o
[CC] espconn.o
[CC] espconn_tcp.o
[CC] espconn_udp.o
In file included from /home/ystrem/esp8266-frankenstein/antares/src/arch/esp8266/include-sdk/user_interface.h:11:0,
from /home/ystrem/esp8266-frankenstein/src/lwip/app/espconn_udp.c:15:
/home/ystrem/esp8266-frankenstein/src/lwip/app/espconn_udp.c: In function 'espconn_udp_recv':
/home/ystrem/esp8266-frankenstein/src/lwip/app/espconn_udp.c:167:31: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
if (!ip_addr_netcmp((struct ip_addr *)precv->pespconn->proto.udp->remote_ip, &ipconfig.ip, &ipconfig.netmask)) {
^
/home/ystrem/esp8266-frankenstein/include/lwip-esp8266/lwip/ip_addr.h:194:47: note: in definition of macro 'ip_addr_netcmp'
#define ip_addr_netcmp(addr1, addr2, mask) (((addr1)->addr & \
^
[GEN] built-in.o
[CC] def.o
[CC] dhcp.o
[CC] dns.o
[CC] init.o
[CC] mem.o
[CC] memp.o
[CC] netif.o
[CC] pbuf.o
[CC] raw.o
[CC] stats.o
[CC] sys_arch.o
[CC] sys.o
[CC] tcp.o
[CC] tcp_in.o
[CC] tcp_out.o
[CC] timers.o
[CC] udp.o
[CC] autoip.o
[CC] icmp.o
[CC] igmp.o
[CC] inet.o
[CC] inet_chksum.o
[CC] ip_addr.o
[CC] ip.o
[CC] ip_frag.o
[GEN] built-in.o
[GEN] built-in.o
[CC] etharp.o
[GEN] built-in.o
[GEN] built-in.o
[GEN] built-in.o
[INFO] Building antares library code and startup
[CC] newlib-dummies.o
[GEN] built-in.o
[GEN] built-in.o
[GEN] built-in.o
[GEN] built-in.o
[GEN] built-in.o
[GEN] built-in.o
[GEN] built-in.o
[CC] heatshrink_encoder.o
[CC] heatshrink_decoder.o
[GEN] built-in.o
[GEN] built-in.o
[GEN] built-in.o
[IROMIFY] Moving application code to IROM
[LD] images/antares.elf
/home/ystrem/esp8266-frankenstein/build/app/i2c_hmc5883l.o: In function `HMC5883_ReadDegrees':
i2c_hmc5883l.c:(.irom0.text+0x114): undefined reference to `i2c_master_readRegister16'
i2c_hmc5883l.c:(.irom0.text+0x12a): undefined reference to `i2c_master_readRegister16'
i2c_hmc5883l.c:(.irom0.text+0x14a): undefined reference to `i2c_master_readRegister16'
i2c_hmc5883l.c:(.irom0.text+0x166): undefined reference to `i2c_master_readRegister16'
/home/ystrem/esp8266-frankenstein/build/app/i2c_hmc5883l.o: In function `HMC5883_Read':
i2c_hmc5883l.c:(.irom0.text+0x1b0): undefined reference to `i2c_master_writeRegister'
i2c_hmc5883l.c:(.irom0.text+0x1b4): undefined reference to `i2c_master_readRegister8'
i2c_hmc5883l.c:(.irom0.text+0x214): undefined reference to `i2c_master_writeRegister'
i2c_hmc5883l.c:(.irom0.text+0x227): undefined reference to `i2c_master_readRegister8'
/home/ystrem/esp8266-frankenstein/build/app/i2c_hmc5883l.o: In function `HMC5883_SetConfig':
i2c_hmc5883l.c:(.irom0.text+0x23e): undefined reference to `i2c_master_writeRegister'
i2c_hmc5883l.c:(.irom0.text+0x24b): undefined reference to `i2c_master_readRegister8'
i2c_hmc5883l.c:(.irom0.text+0x266): undefined reference to `i2c_master_writeRegister'
i2c_hmc5883l.c:(.irom0.text+0x273): undefined reference to `i2c_master_readRegister8'
i2c_hmc5883l.c:(.irom0.text+0x28c): undefined reference to `i2c_master_writeRegister'
i2c_hmc5883l.c:(.irom0.text+0x2b6): undefined reference to `i2c_master_readRegister8'
i2c_hmc5883l.c:(.irom0.text+0x2cb): undefined reference to `i2c_master_readRegister8'
i2c_hmc5883l.c:(.irom0.text+0x2da): undefined reference to `i2c_master_readRegister8'
collect2: error: ld returned 1 exit status
make: *** [images/antares.elf] Error 1
I create pull request #48 to fix "undefined reference" for i2c functions, but for now you can disable HMC5883 in config and it must be compiled ok. And do not try co compile HMC5883 module, because after uploading new firmware with it, esp does not start by unknown reason. So I comment HMC5883 option in config file.
@darkbyte-ru You're likely running out of ram. Check if disabling a few other i2c modules and enabling HMC5883 will suddenly make things work.
@nekromant, hmm, it works. I disable all modules except one i2c for hmc.
@darkbyte-ru Well, than we've hit the RAM limit again. See https://github.com/nekromant/antares/blob/experimental/src/arch/esp8266/arch.mk. The most straightforward solution would be increasing FW_FILE_2 addr in both arch.mk and ld file. We can't put the maximum addresses there or we'll find ourselves back in the situation where firmware code starts at 256KiB leaving little possibilities for OTA updates. However, the cleaner approach would be calculating the RAM requirements dynamically before actually linking and generating a proper ld file on the run. That would basically require us to run xtensa-lx106-elf-size on every .o file, parse the output to get the estimation, round up to the next 4K and use it as FW_FILE_2
Btw, see if you can replace all the static allocations with dynamic ones via malloc().
@nekromant, what is the problem to write received by tftp data directly to flash? Only one time a got unexpected reset of esp while downloading new firmware via tftp.
@darkbyte-ru We'll crash this way. When you are downloading something lwip and the blobs are at work. Sooner or later you'll just overwrite the functions being called from flash and crash. the code that does the update MUST reside in RAM. But there's not enough RAM for all the blobs and lwip parts required to work. So the only possible way for this to work - buffer the whole firmware somewhere (we only have flash for that), and then overwrite the previous code by it. The code required to do copying is small and fits in ram. See commit_handler in cmd_tftp.c
Closing the issue, since BMP180 compiles in current master