Skip to content

Commit

Permalink
Lua RTOS don't start after last esp-idf update (see espressif/esp-idf@8…
Browse files Browse the repository at this point in the history
…615dbd)

* Bug at start up (Guru Mediation error) was caused by customized version of esp32.common.ld
* Now esp32.common.ld are customized from a patch file

Know bugs after esp-idf update:

* Operations on directories does not work: mkdir, ls
  • Loading branch information
jolivepetrus committed Jan 9, 2017
1 parent 42e6753 commit f3d7591
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 204 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ ifeq ("$(wildcard $(IDF_PATH)/components/lua_rtos)","")
endif
@touch $(PROJECT_PATH)/components/lua_rtos/sys/sys_init.c
@touch $(PROJECT_PATH)/components/lua_rtos/lwip/socket.c
@cat ld/lua-rtos.ld > $(IDF_PATH)/components/esp32/ld/esp32.common.ld
@cd $(IDF_PATH)/components/esp32/ld && git checkout esp32.common.ld
@cd $(IDF_PATH)/components/lwip/api && git checkout api_msg.c
@patch -f $(IDF_PATH)/components/esp32/ld/esp32.common.ld $(PROJECT_PATH)/main/patches/ld.patch
@patch -f $(IDF_PATH)/components/lwip/api/api_msg.c $(PROJECT_PATH)/main/patches/api_msg.patch

restore-idf:
Expand Down
203 changes: 0 additions & 203 deletions ld/lua-rtos.ld

This file was deleted.

31 changes: 31 additions & 0 deletions main/patches/ld.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--- /Users/jaumeolivepetrus/esp-idf/components/esp32/ld/esp32.common.ld 2017-01-09 15:53:18.000000000 +0100
+++ /Users/jaumeolivepetrus/Lua-RTOS-ESP32/ld/lua-rtos.ld 2017-01-09 15:48:30.000000000 +0100
@@ -163,6 +163,21 @@
*(.xt_except_desc_end)
*(.dynamic)
*(.gnu.version_d)
+
+ /* Lua RTOS changes (begin) */
+
+ . = ALIGN(4);
+ /* Lua enabled modules. KEEP ensures that will not be removed */
+ lua_libs1 = ABSOLUTE(.);
+ KEEP (*(.lua_libs1))
+ LONG(0) LONG(0) /* Null-terminate the array */
+
+ lua_rotable = ABSOLUTE(.);
+ KEEP(*(.lua_rotable1))
+ LONG(0) LONG(0) /* Null-terminate the array */
+
+ /* Lua RTOS changes (end) */
+
_rodata_end = ABSOLUTE(.);
/* Literals are also RO data. */
_lit4_start = ABSOLUTE(.);
@@ -185,4 +200,4 @@
_text_end = ABSOLUTE(.);
_etext = .;
} >iram0_2_seg
-}
+}
\ No newline at end of file
19 changes: 19 additions & 0 deletions sdkconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@ CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
CONFIG_ESPTOOLPY_FLASHSIZE="2MB"
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
CONFIG_ESPTOOLPY_BEFORE_RESET=y
# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
# CONFIG_ESPTOOLPY_BEFORE_ESP32R0 is not set
CONFIG_ESPTOOLPY_BEFORE="default_reset"
CONFIG_ESPTOOLPY_AFTER_RESET=y
# CONFIG_ESPTOOLPY_AFTER_NORESET is not set
CONFIG_ESPTOOLPY_AFTER="hard_reset"
# CONFIG_MONITOR_BAUD_9600B is not set
# CONFIG_MONITOR_BAUD_57600B is not set
CONFIG_MONITOR_BAUD_115200B=y
# CONFIG_MONITOR_BAUD_230400B is not set
# CONFIG_MONITOR_BAUD_921600B is not set
# CONFIG_MONITOR_BAUD_2MB is not set
# CONFIG_MONITOR_BAUD_OTHER is not set
CONFIG_MONITOR_BAUD_OTHER_VAL=115200
CONFIG_MONITOR_BAUD=115200

#
# Partition Table
Expand Down Expand Up @@ -117,6 +134,7 @@ CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=0
CONFIG_ESP32_PHY_AUTO_INIT=y
# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set
CONFIG_ESP32_PHY_MAX_TX_POWER=20
CONFIG_ESP32_WIFI_RX_BUFFER_NUM=25
# CONFIG_ETHERNET is not set

#
Expand Down Expand Up @@ -275,6 +293,7 @@ CONFIG_LUA_RTOS_LUA_USE_MQTT=y
CONFIG_LWIP_MAX_SOCKETS=10
CONFIG_LWIP_THREAD_LOCAL_STORAGE_INDEX=0
# CONFIG_LWIP_SO_REUSE is not set
# CONFIG_LWIP_SO_RCVBUF is not set
CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1
# CONFIG_LWIP_IP_FRAG is not set
# CONFIG_LWIP_IP_REASSEMBLY is not set
Expand Down
5 changes: 5 additions & 0 deletions sdkconfig.old
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ CONFIG_LUA_RTOS_LMIC_DIO0=26
CONFIG_LUA_RTOS_LMIC_DIO1=25
CONFIG_LUA_RTOS_LMIC_DIO2=33

#
# HTTP server
#
CONFIG_LUA_RTOS_USE_HTTP_SERVER=y

#
# Lua
#
Expand Down

0 comments on commit f3d7591

Please sign in to comment.