Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for compiling Cesanta v7 Javascript engine #1907

Closed
benjamind opened this issue Apr 14, 2016 · 1 comment
Closed

Add support for compiling Cesanta v7 Javascript engine #1907

benjamind opened this issue Apr 14, 2016 · 1 comment

Comments

@benjamind
Copy link

benjamind commented Apr 14, 2016

There's a little example of trying to compile v7 with Arduino here Arduinov7.zip

In order to get this to compile I had to add the lib_a-putc.o and lib_a-putc_u.o symbols from the feature/libc branch. This gave me _putc_r implementation, but there's still something else going wrong here. In theory this issue may be more related to v7 than the Arduino port here, but they manage to compile it for ESP8266 under the RTOS SDK, but it should be feasible to get it working under Arduino too. I've got a similar ticket open on the v7 github cesanta/v7#550

Here's the stack trace:

Exception (29):
epc1=0x4021d69e epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont 
sp: 3fff4260 end: 3fff4530 offset: 01a0

>>>stack>>>
3fff4400:  00000000 00000018 0001770c 40100711  
3fff4410:  3fff4f68 00000018 3fff6084 4020135c  
3fff4420:  00000000 3fff5054 00000024 3fff4e44  
3fff4430:  00000fa0 3fff5044 3fff4f30 4020f25f  
3fff4440:  00000018 feefeffe feefeffe 0001c200  
3fff4450:  0000001c 00000000 00000000 401006e4  
3fff4460:  00000000 00000000 00000000 402147e8  
3fff4470:  00000000 0000000a 3ffec94a 3fff344c  
3fff4480:  3fff4f4c 0000000a 3fff4f68 40213fcd  
3fff4490:  3ffece0c 00000000 3fff344c 3fff344c  
3fff44a0:  3fffdad0 00000000 3fff3500 4020fa75  
3fff44b0:  00000000 00000000 00000000 4021401c  
3fff44c0:  3fffdad0 00000000 3fff3500 40213689  
3fff44d0:  feefeffe feefeffe feefeffe feefeffe  
3fff44e0:  feefeffe feefeffe feefeffe feefeffe  
3fff44f0:  feefeffe feefeffe feefeffe feefeffe  
3fff4500:  feefeffe feefeffe feefeffe 3fff3508  
3fff4510:  3fffdad0 00000000 3fff3500 40214650  
3fff4520:  feefeffe feefeffe 3fff3510 40100964  
<<<stack<<<

Here's the output from the ESP exception parser:

Decoding 12 results
0x4021d69e: memset at ?? line ?
0x40100711: calloc at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266\umm_malloc/umm_malloc.c line 1682
0x4020135c: gc_new_block at E:\Temp\build93b5748ed8fde4d231b4b4b5930427cd.tmp\sketch/v7.c line 13957
0x4020f25f: gc_arena_init at E:\Temp\build93b5748ed8fde4d231b4b4b5930427cd.tmp\sketch/v7.c line 13957
:  (inlined by) v7_create_opt at E:\Temp\build93b5748ed8fde4d231b4b4b5930427cd.tmp\sketch/v7.c line 14075
0x401006e4: malloc at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266\umm_malloc/umm_malloc.c line 1662
0x402147e8: Print::write(unsigned char const*, unsigned int) at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.cpp line 38
0x40213fcd: Print::write(char const*) at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.cpp line 188
0x4020fa75: v7_create at E:\Temp\build93b5748ed8fde4d231b4b4b5930427cd.tmp\sketch/v7.c line 13957
0x4021401c: Print::println(char const*) at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Print.cpp line 188
0x40213689: setup at E:\Workspace\ArduinoV7/ArduinoV7.ino line 36
0x40214650: loop_wrapper at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/core_esp8266_main.cpp line 43
0x40100964: cont_norm at E:\Users\Ben\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/cont.S line 109

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@igrr igrr added this to the 2.3.0 milestone Apr 18, 2016
@igrr igrr modified the milestones: 2.3.0, 2.4.0 Jun 3, 2016
@devyte
Copy link
Collaborator

devyte commented Dec 18, 2017

Indeed, this is an issue for the v7 repo, because it is essentially a request to have the engine support the ESP8266 NONOS-based build system. In addition to actually getting the code to build, porting the engine may require internal code modifications, like adding calls to yield() due to timing constraints, which escapes the scope of this repo.
Closing.

@devyte devyte closed this as completed Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants