From 46dd90e0022fdac8379c7ef0586d02d1ae24287c Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Mon, 21 Sep 2026 09:44:20 -0500 Subject: [PATCH] fix(canopen): can_bridge_example never initialized its TWAI node before START start_bus() constructed the espp::Twai and called start() without initialize(), so the node was never created and start() returned operation_not_permitted -- reported to the host as "start failed: Not owner" (newlib's EPERM string). Call initialize() first; start() still runs explicitly so the host gets a precise error code. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU --- .../canopen/can_bridge_example/main/can_bridge_example.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/canopen/can_bridge_example/main/can_bridge_example.cpp b/components/canopen/can_bridge_example/main/can_bridge_example.cpp index c065032cb7..6fb92b6b49 100644 --- a/components/canopen/can_bridge_example/main/can_bridge_example.cpp +++ b/components/canopen/can_bridge_example/main/can_bridge_example.cpp @@ -170,8 +170,11 @@ extern "C" void app_main(void) { cfg.on_receive = on_can_rx; cfg.on_error = on_can_err; auto node = std::make_unique(cfg); - if (!node->start(ec)) - return false; // node destructs, uninstalling the driver + // initialize() creates the node + receive task; start() enables it on the + // bus (start() on a node that was never initialized fails with + // operation_not_permitted, which the host saw as "start failed: Not owner"). + if (!node->initialize(ec) || !node->start(ec)) + return false; // node destructs, deleting the driver twai = std::move(node); return true; };