Skip to content

Commit

Permalink
[nrfconnect] Fix pigweed/protobuf compiler flags (project-chip#14876)
Browse files Browse the repository at this point in the history
Enhance the way Zephyr flags are passed to Pigweed and
Protobuf components. It happened in the past that some
MCU-related flags were not passed correctly causing
crashes or build failures (e.g. with FPU enabled).
  • Loading branch information
Damian-Nordic authored and Rob Oliver committed Mar 14, 2022
1 parent e09fab3 commit 6c21b2a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions examples/lighting-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ endif()

if (CONFIG_CHIP_PW_RPC)

# Make all targets created below depend on zephyr_interface to inherit MCU-related compilation flags
link_libraries($<BUILD_INTERFACE:zephyr_interface>)

set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo")
include(${PIGWEED_ROOT}/pw_build/pigweed.cmake)
include(${PIGWEED_ROOT}/pw_protobuf_compiler/proto.cmake)
Expand Down Expand Up @@ -240,6 +243,4 @@ target_link_options(app
"-T${PIGWEED_ROOT}/pw_tokenizer/pw_tokenizer_linker_sections.ld"
)

target_link_libraries(pw_build INTERFACE zephyr_interface)

endif(CONFIG_CHIP_PW_RPC)
2 changes: 1 addition & 1 deletion examples/lighting-app/nrfconnect/rpc.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ CONFIG_LOG_BACKEND_UART=n
CONFIG_LOG_BACKEND_RTT=n

# Increase zephyr tty rx buffer
CONFIG_CONSOLE_GETCHAR_BUFSIZE=128
CONFIG_CONSOLE_GETCHAR_BUFSIZE=128
5 changes: 3 additions & 2 deletions examples/pigweed-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ include(${CHIP_ROOT}/config/nrfconnect/app/enable-gnu-std.cmake)

target_compile_options(app PRIVATE -Werror)

# Make all targets created below depend on zephyr_interface to inherit MCU-related compilation flags
link_libraries($<BUILD_INTERFACE:zephyr_interface>)

include(${PIGWEED_ROOT}/pw_build/pigweed.cmake)
include(${PIGWEED_ROOT}/pw_protobuf_compiler/proto.cmake)

Expand Down Expand Up @@ -82,6 +85,4 @@ target_link_libraries(app PUBLIC
pw_rpc.server
)

target_link_libraries(pw_build INTERFACE zephyr_interface)

include(${CHIP_ROOT}/config/nrfconnect/app/flashing.cmake)
2 changes: 1 addition & 1 deletion examples/pigweed-app/nrfconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ to read more about flashing on the nRF52840 Dongle.
Run the following command to start an interactive Python shell, where the Echo
RPC commands can be invoked:

python -m pw_hdlc.rpc_console --device /dev/ttyACM0 -b 115200 $CHIP_ROOT/third_party/pigweed/repo/pw_rpc/echo.proto -o /tmp/pw_rpc.out
python -m pw_hdlc.rpc_console --device /dev/ttyACM0 -b 115200 --proto-globs $CHIP_ROOT/third_party/pigweed/repo/pw_rpc/echo.proto -o /tmp/pw_rpc.out

To send an Echo RPC message, type the following command, where the actual
message is the text in quotation marks after the `msg=` phrase:
Expand Down

0 comments on commit 6c21b2a

Please sign in to comment.