From a363de77424b554176928a87c3abeb54df7b6b5b Mon Sep 17 00:00:00 2001 From: Anders Johan Jamtli Date: Wed, 30 Jul 2025 07:40:35 +0200 Subject: [PATCH] Add paragraph to general troubleshooting guide - Add paragraph about 'no loadable segments' error when '.cargo/config.toml' is missing and how to fix it --- .../1-general-troubleshooting/README.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/mdbook/src/appendix/1-general-troubleshooting/README.md b/mdbook/src/appendix/1-general-troubleshooting/README.md index 1099eea0..19f8e049 100644 --- a/mdbook/src/appendix/1-general-troubleshooting/README.md +++ b/mdbook/src/appendix/1-general-troubleshooting/README.md @@ -52,3 +52,29 @@ Install the proper target. ``` console $ rustup target add thumbv7em-none-eabihf ``` + +### Unable to flash the device: `No loadable segments were found in the ELF file` + +*Symptoms:* +```console +> cargo embed + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.04s + Config default + Target /home/user/embedded/target/thumbv7em-none-eabihf/debug/examples/init + WARN probe_rs::flashing::loader: No loadable segments were found in the ELF file. + Error No loadable segments were found in the ELF file. +``` + +*Cause:* + +Cargo needs to know how to build and link the program to the requirements of the target device. +You therefore need to set the correct parameters in the `.cargo/config.toml` file. + +*Fix:* + +Add a `.cargo/config.toml` file with the correct parameters: +```toml +{{#include ../../05-meet-your-software/.cargo/config.toml}} +``` + +See [Embedded Setup](../../05-meet-your-software/embedded-setup.md) for further details.