Skip to content

Commit

Permalink
[nrfconnect] Cherry-pick fixes for RPC builds in the interop testing …
Browse files Browse the repository at this point in the history
…branch (#16183)

* [nrfconnect] Fix pigweed/protobuf compiler flags (#14876)

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).

* [nrfconnect] Fix flashing script (#15628)

--reset flash should be used to reset the board after
flashing a firmware.

Co-authored-by: Damian Królik <[email protected]>
  • Loading branch information
rgoliver and Damian-Nordic authored Mar 17, 2022
1 parent e09fab3 commit 7602727
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 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
2 changes: 1 addition & 1 deletion scripts/flashing/nrfconnect_firmware_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def flash(self, image):

def reset(self):
"""Reset the device."""
return self.run_tool('nrfjprog', ['--pinresetenable'], name='Enable pin reset')
return self.run_tool('nrfjprog', ['--reset'], name='Reset')

def actions(self):
"""Perform actions on the device according to self.option."""
Expand Down

0 comments on commit 7602727

Please sign in to comment.