-
Notifications
You must be signed in to change notification settings - Fork 651
examples/xedge: Add Xedge example with BAS integration #3120
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
base: master
Are you sure you want to change the base?
Conversation
Create new example application that: - Integrates BAS (Barracuda Application Server) library - Automatically downloads BAS and BAS-Resources repositories - Generates XedgeZip.c for embedded web resources - Provides complete build configuration for NuttX Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
do you follow the suggestion from #3071? |
why still contain error in your log? |
Yes, I tried to implement all the suggestions, please if I forget something that is violating the nuttx rules tell me. |
I'm trying to talk to @surfskidude to fix the build error. |
examples and 3rd party project shouldn't bundle, but split and put into the different folder. |
The two functions longjmp and setjmp, which are part of the standard C library, are required by Lua. The fact that you get a link error for setjmp alone indicates that there is an issue with the NuttX stm32h753bi build. Since NuttX is POSIX compliant, it should also include function setlocale, but this function can be removed if it’s generally not part of NuttX. However, that would mean NuttX is not POSIX-compliant. Regarding the SRAM issue: Note that Xedge is not designed for microcontrollers without external RAM, so your RAM sections must be adjusted accordingly. I have configured a 2Mbyte allocator in xedge_main.c. This is a static array and can typically not be in sram on a micro. Please note that I only tested Xedge in the host simulator. |
I think it is happening because you forgot to enable CONFIG_ARCH_SETJMP_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @JorgeGzm :-)
This seems to be a copy of #3071 but why it was closed before problem resolution and merge? I guess you took over the work right? :-)
Please take a look at:
- https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md
- https://nuttx.apache.org/docs/latest/contributing/index.html
- https://nuttx.apache.org/docs/latest/
Hopefully we can make it this time when fixes are ready and all works as expected, thanks again :-)
@xiaoxiang781216 Could you check if there's anything else that needs to be fixed. In the PR apache/nuttx#16665 I added an example of how to use xedge with qemu-armv8a board. |
Hmm I have this build error on FreeBSD, any hints welcome :-) Is 11.3 compiler too old and I should use 14.2? :-)
|
Yup :-) GCC 14.2 AARCH64 needs to be used :-)
|
I followed the qemu-armv8a board tutorial to set up the build environment: https://nuttx.apache.org/docs/latest/platforms/arm64/qemu/boards/qemu-armv8a/index.html Compile ToolchainHost environment: GNU/Linux: Ubuntu 18.04 or greater Download and Install wget https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf.tar.xz
xz -d gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf.tar.xz
tar xf gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf.tar Put gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf/bin/ on your host PATH environment variable, like: export PATH=$PATH:/opt/software/arm/linaro-toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf/bin check the toolchain: aarch64-none-elf-gcc -v |
@xiaoxiang781216 @cederom PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @JorgeGzm amazing work! :-)
Why does GitHub say it cannot be merged? Need to rebase or something? |
All comments must be resolved :-) There is still one open conversation :-) |
I believe I have resolved all the improvements, can you please tell me what part is missing. |
Oh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before merged, this patch should separate xedge to independent project and split one patch to two: one is xedge project and another is xedge demo.
Thank you for the feedback. I understand now that the project should be split into two separate patches:
Before proceeding with the implementation, I have a question about the proper location for the Xedge library. Would apps/netutils/xedge/ be the appropriate directory, or would you recommend a different location such as apps/framework/xedge/ ? I want to ensure I place the library in the correct directory according to NuttX conventions to avoid rework. |
netutils or system is a good candidate. @cederom what's your opinion? |
Thanks for asking @xiaoxiang781216 :-) I would go for |
Create new example application that:
Summary
I'm supporting @surfskidude to update xedge support with nuttx.
This commit covers conversations:
apache/nuttx#16352
#3071
Impact
Xedge
a lightweight Lua-based web framework for building secure, real-time IoT applicationsXedge <https://realtimelogic.com/products/xedge/>
_ is a robust IoT and web framework that is designed for microcontrollers. It is based on the industrial-grade Barracuda Application Server, designed for seamless OEM integration. Xedge accelerates embedded firmware development by providing a flexible, Lua-based environment and a full stack of industrial-strength protocols, including:This Xedge port for NuttX comes pre-configured and requires:
xedge/xedge_main.c
.. note::
These instructions set up Xedge in development mode. Xedge supports many configuration options that differ between development and production builds. For production settings and optimization, refer to the general Xedge build instructions (details below).
Why Use Lua and Xedge in Embedded Systems
Great Lua developers don't treat it as a "better C"; they treat it as a complement. Lua is an extension language, which means it's designed to work alongside C, not replace it. Smart embedded programmers use C for performance-critical, low-level code and Lua for high-level business logic, such as processing sensor data and managing secure cloud connectivity.
Writing embedded business logic purely in C often means hundreds of lines of boilerplate code to manage memory, handle complex APIs, and handle errors. Lua, especially when paired with a framework like Xedge, lifts that burden. It provides high-level libraries and modules out of the box for protocols, networking, file systems, and more.
This shift doesn't just make development easier; it makes it faster. What used to take weeks in C can now be done in days. Lua's simplicity encourages rapid prototyping and quick iteration, which is essential in modern IoT and embedded development, where both time-to-market and security are critical. For a conceptual overview of why this hybrid development model is so powerful, check out the tutorial `Why Smart C Coders Love Lua.
Testing
Run xedge example with qemu-armv8a board
Running with QEMU:
Running Xedge in NuttX terminal
Launch your web browser and access 127.0.0.1:8080