File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
samples/nrf_rpc/protocols_serialization/server Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,16 @@ project(protocols_serialization_server)
1313target_sources (app PRIVATE src/main.c)
1414
1515if (CONFIG_NRF_PS_SERVER_FATAL_ERROR_TRIGGER)
16- target_sources (app PRIVATE src/fatal_error_trigger.c)
16+ target_sources (app PRIVATE src/fatal_error_trigger.c)
17+ endif ()
18+
19+ if (CONFIG_NRF_PS_SERVER_RPC_ALIVE_LED)
20+ # Wrap z_fatal_error to turn off the RPC alive LED on fatal error
21+ target_link_options (app INTERFACE -Wl,--wrap=z_fatal_error)
1722endif ()
1823# NORDIC SDK APP END
1924
2025# Link OpenThread CLI even though OPENTHREAD_SHELL is not selected
2126if (CONFIG_OPENTHREAD_RPC)
22- zephyr_link_libraries(openthread-cli-ftd)
27+ zephyr_link_libraries(openthread-cli-ftd)
2328endif ()
Original file line number Diff line number Diff line change @@ -29,6 +29,17 @@ void nrf_rpc_uart_initialized_hook(const struct device *uart_dev)
2929 LOG_ERR ("Failed to configure RPC alive GPIO: %d" , ret );
3030 }
3131}
32+
33+ void __real_z_fatal_error (unsigned int reason , const struct arch_esf * esf );
34+
35+ void __wrap_z_fatal_error (unsigned int reason , const struct arch_esf * esf )
36+ {
37+ const struct gpio_dt_spec alive_gpio = GPIO_DT_SPEC_GET (DT_ALIAS (rpc_alive_led ), gpios );
38+
39+ (void )gpio_pin_configure_dt (& alive_gpio , GPIO_OUTPUT_INACTIVE );
40+
41+ __real_z_fatal_error (reason , esf );
42+ }
3243#endif
3344
3445int main (void )
You can’t perform that action at this time.
0 commit comments