-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
Sming Host Emulator #1692
Sming Host Emulator #1692
Conversation
The Windows CI needs update as mentioned in #1333 (comment) There are issues reported by Codacy that have to be addressed. |
Appveyor build still isnt' quite right, will take a closer look later on. I think it's simpler having a separate
We can now actively run (some) applications instead of just building, so with travis/appveyor those probably need to go in a separate section after the build. I'm fairly new to CI so perhaps best left to someone else? |
c82c9c1
to
513be2c
Compare
All we need to do for C99 compliance is change |
I would suggest the following standards to be imposed on our own code: For C language - use C11, for C++ use C+11. |
@mikee47 Can you do the following change: extract only that change "Remove user_config.h file from all samples - identical to default" as a separate PR ? I would like to decrease the number of files that need to be reviewed in this PR. If you think that there is also another change that can be extracted as a separate PR, please, propose ti. |
Unfortunately this is a necessary change because it breaks the Host build - there's a lot of stuff in there which is platform-specific. If you look at the examples provided with the NON-OS SDK, the |
I was meaning to put only that change as a PR and then rebase this PR code on top of the the latest code(with merged includes-simplify PR) . But if that is too much of a hassle then leave it like that. |
I see what you mean. That's no problem, I reckon the first 10 commits could fall into that category - everything before
|
…ing().c_str() Unsafe to return pointer to temporary
79c880c
to
c01ebb2
Compare
@mikee47 Please, merge |
01ad266
to
764e290
Compare
Implemented: * Serial port driver emulation, based on gdbstub technique. Socket server support added to allow multiple terminal connection via telnet. * Flash memory emulated using backing file * Dummy gdbstub component (not required) * Task queues * Timers * Basic time functions * Network support for Linux and Windows Dummy modules: * Digital * Interrupts Build * Use different build subdirectory for Linux/Windows (based on UNAME)
* Replace `itoa` macro with fucntion definition * Rename `random()` in WMath.cpp (name conflict) * `#undef` conflicting structure member names in `gdb_syscall.h` * Fix implementation of sprintf_P()
* `.word` only emits 2 bytes on Linux, so use `.long` which is fine for all 32-bit machines * Windows (COFF format) requires different implemention * Use `.irom0.text`, not `.irom.text` (fixes 'section changed' warning)
Add `HostTests` sample * Runs some tests against ArduinoJson6 and filesystem, asserts on failure * Remove related code from `LiveDebug` sample Travis * Move script into separate `build.sh` file * Use more recent linux distro (xenial vs. trusty) with less dated GCC - resolves conflict with `std::isnan` and `std::isinf` and stdc function declarations * Build and run `HostTests` sample Appveyor * Run mingw update/upgrade - default appveyor install is 5.3.0, current is 6.3.0 * Move build script into batch file * Add basic Host build and run `HostTests` sample
764e290
to
ad14726
Compare
Is there a decent Unit Test framework for C/C++ that is easy to install and use? Can you recommend something? Google Test and Catch2 seem quite promising but I have never used them. |
Unfortunately my experience of formal testing frameworks is a little (lot!) out of date. I am aware that ArduinoJson uses 'catch' extensively (albeit an older version). From a casual inspection it looks simple enough, is lightweight and modern. I like the way Benoit freely adds test cases as bugs are introduced and fixed. The ESP32-IDF uses Unity but that's more of a C framework and looks rather more complex. Perhaps a way forward is to pick something that needs testing, devise a plan then see how well that fits a particular framework. |
* This is required only for Esp8266 platform, the check is done in `Arch/Esp8266/app.mk` * Move `HttpServer_ConfigNetwork` sample `Makefile` modifications into `Makefile-user.mk`
* Move install section into `install.sh` * Run host tests in separate job, only continue to build once that has completed successfully as it should be a lot faster than an actual build * Cannot export variables from script so apply deploy condition explicitly * Define `SMING_ARCH` in `.travis.yml`, not in scripts * Move coding style checks into test stage * Use `TRAVIS_BUILD_STAGE_NAME`
* Move install into external script file
I am planning to merge the PR later today. Do you think it is ready as it or you would like to add some small changes? |
Good to go I think, unless you wanted any of the commits split out as separate PRs. |
Not at the moment. Thanks a lot for your great work! I will merge the PR now and test it quickly.
As a next step, as new PR, we need axTLS on Host. |
make list-config | ||
|
||
# Build the framework | ||
make |
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.
We could try also parallel build splitting this command to the following two:
make submodules
make -j
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.
We could.... I gave it a brief try with appveyor but after one initial failure didn't bother any further as I figured what we really need is a clear and accurate log for when it goes wrong. I had a hell of a job with the initial CI updates on appveyor, had to remote terminal into the server to find out how to fix things so really rather not have to do that if poss.!
The --output-sync
option might help but haven't tried it - I have make 3.81 under MinGW which doesn't have the option anyway. I use parallel building all the time under Windows, on an 8-core system it kind of speeds things up just a teeny bit :-)
I suspect on a VM parallel builds wouldn't help much anyway. My Linux install is running under VirtualBox and really doesn't like parallel builds at all, but that's my problem!
I suspect we'd also need lwip:
make submodules
make lwip
make -j
Running |
make -j2 or -j3 seem OK... |
Hi guys, great work! |
Compiler's a lot fussier (a good thing!). Try this:
Could you do a |
gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0 |
OK, try this:
The issue arises because I'll need to think about a proper fix for this... |
An alternative which won't break anything is adding
|
From https://gcc.gnu.org/gcc-8/changes.html
|
I'll open an issue for this |
Initial PR providing support for building and running Sming applications directly within Host environment (Linux / Windows).
Implemented
Dummy modules
Build
HostTests
samplebuild.sh
filestd::isnan
andstd::isinf
and stdc function declarationsHostTests
sampleFile layout changes
pwm.h
intoComponents/drivers
, consistent with ESP-IDFesp_wifi
componentBuild conflicts
itoa
macro with function definitionrandom()
in WMath.cpp (name conflict)#undef
conflicting structure member names ingdb_syscall.h
Fix
IMPORT_FSTR
for Linux/Windows host builds.word
only emits 2 bytes on Linux, so use.long
which is fine for all 32-bit machines.irom0.text
, not.irom.text
(fixes 'section changed' warning)