-
Notifications
You must be signed in to change notification settings - Fork 423
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
esp-open-rtos compatibility #61
Comments
Unfortunately, I am not familiar with esp-open-rtos. You can use libcoap without the lwip memory pools (the POSIX and Contiki ports, e.g.,, do not use it). The lwip port is a bit special here but I would think that it should be possible to make the lwip pools optional -- all memory allocations in libcoap are done through the include/coap/mem.h API. Can you suggest an (optional) alternate memory allocation technique for lwIP? |
Unfortunately I don't know the tools well enough to make a suggestion. I would merely think straight up heap allocation. Unclear if that's even a good idea though. It seems close to compiling though on my fork. I'm asking on the esp-open-rtos side, 'cause keeping the memory pools seems like a good idea. |
Heap-allocation using malloc() might not be a good idea on an RTOS but in that case, you could use the posix-functions which map to malloc/free. |
Sorry to leave this dangling so long. Taking another crack it it now EDIT: I am getting pretty overwhelmed. The esp-open-rtos utilizes FreeRTOS + LWIP environment also really wants to use its own makefiles, so I'm trying to yank in libcoap via esp-open-rtos native makefile/component architecture. It seems like one can do a Contiki or Posix or LWIP scenario, with maybe Contiki having a non reflexive dependency on LWIP. Is that a correct assumption? |
LWIP has emerged from Contiki AFAIK but since they have been split the gap continually increases. FWIW: The embedded platform ports (Contiki, LWIP, RIOT, and even TinyOS) all use their own Makefiles to integrate with the OS's build system. I think it is valid to build another Makefile for the esp-open-rtos integration. |
OK good to know. I was about ready to throw in the towel, but maybe I can post my build errors here and you can point me in the right direction...I never knew LWIP actually came from Contiki... interesting! |
Yes, please do. This platform is interesting enough to spend some development cycles :-) |
OK, so here's the very beginning of a long list of errors I get. It seems that some LWIP glue still needs application somewhere !
I run configure first also, and I have a question about that - I compile my esp-open-rtos from inside a docker image, but I had to run autogen.sh outside the image. configure itself ran well inside the image. Is that OK? |
The POSIX network I/O functions are not available in LWIP, and apparently, the toolchain for esp-open-rtos does not provide a compatibility wrapper. |
OK, good intel. I thought for sure I "enabled all" the LWIP stuff, but clearly I missed a spot. It's worth the effort to diverge from POSIX for me (no beef with POSIX, but the name clashing is good to avoid). Side note: I do think there is a POSIX compatibility wrapper in esp-open-rtos... not sure. But moot, for me. I'll chip away at that one Hopefully we can work around LWIP breaking API changes with some clever #ifdef'ing...and I wouldn't know to look for those runtime errors without your input, so thank you |
OK trying with the WITH_LWIP flag, but hitting this error:
Seems to me at this point the code isn't watching for the WITH_LWIP flag and instead assumes a posix availability. Otherwise, I'd expect we'd be detecting/including something more like <lwip/inet.h> around https://github.com/obgm/libcoap/blob/develop/include/coap/libcoap.h#L26. This is my best guess. What do you think? |
There is definitely a guard for |
OK; with that in mind, I'll add some code along those lines to my fork |
So this sounds a bit like what you were talking about with parameter mismatch, but not in the area I was expecting:
Rooting through endpoint, it looks like one could find the session* there but it seems multiple sessions would be present so I'm not sure how you would decide which one to grab. |
This is exactly the spot where it was expected to break :-) |
libcoap LwIP support has been re-written in PR #884, and so this should no longer be an issue. |
I am attempting to get this working in esp-open-rtos, but there seems to be a snag with the custom lwip memp allocation pool.
Using the custom memory pool is a great idea, but is it possible to use libcoap without it? The RTOS seems to disable it on purpose
The text was updated successfully, but these errors were encountered: