Skip to content

Update Zephyr RTOS port for Zephyr 1.10 release #2120

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

Closed
wants to merge 4 commits into from

Conversation

pfalcon
Copy link
Contributor

@pfalcon pfalcon commented Nov 23, 2017

Zephyr 1.10 has switched to CMake-based build system (kind of like JerryScript, but the best way to think about it is of course as "different CMake-based build system").

Besides updating for new build system, the patch also removes some old stuff and updates for other changes in Zephyr.

@pfalcon
Copy link
Contributor Author

pfalcon commented Nov 23, 2017

Note that this shouldn't be merged before the official 1.10 release (ETA is beginning of December).

@pfalcon
Copy link
Contributor Author

pfalcon commented Nov 23, 2017

@SebastianBoe, @grgustaf, @jimmy-huang, @poussa : FYI.

COMMAND echo Z_CFLAGS=${system_includes}${includes}${definitions}${options}
COMMAND echo NOSTDINC_FLAGS=${system_includes}
COMMAND echo ZEPHYRINCLUDE=${includes}
COMMAND echo KBUILD_CFLAGS=${definitions}${options}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see that this worked :)

@pfalcon pfalcon force-pushed the zephyr-1.10-cmake branch 4 times, most recently from f962b5b to ecd19dd Compare November 27, 2017 16:04
@pfalcon
Copy link
Contributor Author

pfalcon commented Nov 27, 2017

Update: Makefile.zephyr was updated, CI now passes.

@pfalcon
Copy link
Contributor Author

pfalcon commented Nov 29, 2017

@akosthekiss : Can you please review Makefile.travis changes (as updating your #2102) ?

@pfalcon pfalcon force-pushed the zephyr-1.10-cmake branch 3 times, most recently from 4929b56 to 3b6a073 Compare December 6, 2017 13:40
@pfalcon
Copy link
Contributor Author

pfalcon commented Dec 6, 2017

Updated for latest changes in Zephyr build system.

@pfalcon pfalcon force-pushed the zephyr-1.10-cmake branch 2 times, most recently from 410ff5e to 5595101 Compare December 12, 2017 10:32
@pfalcon pfalcon changed the title [RFC][WIP] Update Zephyr RTOS port for the upcoming Zephyr 1.10 release Update Zephyr RTOS port for Zephyr 1.10 release Dec 12, 2017
@pfalcon
Copy link
Contributor Author

pfalcon commented Dec 12, 2017

Zephyr 1.10 has been released, so this is ready for merge now.

@akosthekiss, @yichoi, @LaszloLango, @dbatyai : Can you please review?

@@ -0,0 +1,31 @@
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the license header.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

target_link_libraries(app jerry-core jerry-ext)



Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many empty lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

set_target_properties(jerry-core PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/../obj/lib/libjerry-core.a)
set_target_properties(jerry-core PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/../../jerry-core/include)
set_target_properties(jerry-ext PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/../obj/lib/libjerry-ext.a)
set_target_properties(jerry-ext PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/../../jerry-ext/include)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These set_target_properties lines are quite long. What about wrapping them?

For example:

set_target_properties(jerry-ext PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                      ${CMAKE_CURRENT_SOURCE_DIR}/../../jerry-ext/include)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


# Fetch Zephyr Project repository and install python dependencies.
install-zephyr: install-apt-get-deps
git clone https://github.com/zephyrproject-rtos/zephyr.git ../zephyr -b zephyr-v1.9.1
git clone https://github.com/zephyrproject-rtos/zephyr.git ../zephyr -b v1.10-branch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this branch live forever? IMHO it will be better to use the release tag and not the branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch would transition thru 1.10.x point releases, and the idea was to check that JrS remains buildable with them, but as you wish, switching to the tag.

@LaszloLango
Copy link
Contributor

Nice patch, I have just a few minor comments.

In 1.10, Zephyr RTOS switched to CMake as means to generate application
makefiles. Consequently, drop Makefile, and introduce CMakeLists.txt,
and update master Makefile.zephyr accordingly.

With these changes, take a chance to make following "cosmetic" changes:

1. Make "qemu_x86" board target the default instead of "arduino_101".
Arduino 101 is just one of the boards of many supported by Zephyr
(and thus JerryScript port), while qemu_x86 is something everyone has.

2. Zephyr make target to run QEMU switched from "qemu" to "run".

3. Don't rely that there's zephyr.strip, it's presence is now
board-dependent. The most we can rely on is zephyr.elf.

JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
MDEF files have been deprecated and ignored for few Zephyr releases.

JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
qemu_x86 target now has stack guard enabled by default and it trips with
the default stack size. Set it to 2K for now.

JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
Zephyr 1.10 requires SDK 0.9.2 and CMake 3.8.2.

Also, don't hardcode CC path, it depends on a board and choosed
automatically by Zephyr build system.

JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
Copy link
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please squash the commits with an appropriate commit message.

@pfalcon
Copy link
Contributor Author

pfalcon commented Dec 21, 2017

LGTM, but please squash the commits with an appropriate commit message.

Thanks! Originally, these commits were intended to be separate. If your request them to be squashed, let me do that in the separate PR: #2155

@pfalcon pfalcon closed this Dec 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants