Blink.rs of embassy examples is not blinking my led

I'm trying to follow the example provided by Embassy on GitHub, specifically attempting to blink an LED on my board. The output of the commands (cargo build --bin blinky --release, cargo flash --release --bin blinky --chip STM32F412ZGTx --probe 0483:374f:002B00453038510934333935) is successful, but I get a warning: "WARN probe_rs::architecture::arm::core::armv7m: Core is running, but we expected it to be halted".
The blinky.rs code has not been modified., despite this, the LED on my board refuses to light up.
I'm using an ST-Link V3Set and an STM32F412ZG, and I believe I've set everything up correctly. I've tried with a different example that wasn't from Embassy and managed to blink the LED using openocd instead of probe-rs, but in this case, I can't get it to work with either openocd or probe-rs.

Does anyone know the reason for this? Or has anyone else encountered this issue? Thank you very much.

PS C:\Users\simone.mansueti\Desktop\embassy\examples\stm32f4> cargo flash --release --bin blinky --chip STM32F412ZGTx --probe 0483:374f:002B00453038510934333935
   Compiling embassy-stm32f4-examples v0.1.0 (C:\Users\simone.mansueti\Desktop\embassy\examples\stm32f4)
    Finished `release` profile [optimized + debuginfo] target(s) in 5.73s
    Flashing C:\Users\simone.mansueti\Desktop\embassy\examples\stm32f4\target\thumbv7em-none-eabi\release\blinky
      Erasing โœ” [00:00:00] [##############################################################################################################] 32.00 KiB/32.00 KiB @ 43.86 KiB/s (eta 0s )
  Programming โœ” [00:00:00] [##############################################################################################################] 22.00 KiB/22.00 KiB @ 62.66 KiB/s (eta 0s )
    Finished in 1.091s
 WARN probe_rs::architecture::arm::core::armv7m: Core is running, but we expected it to be halted

I edited the title to change the category to Embedded so that embedded devs notice this. Please select a category when posting next time.

Could you also please edit your post to change the image to text (enclosed in triple backslashes as described here), so that everyone can read it, including those with screen readers?

yes, of course
i'm sorry for not selecting a category.

1 Like

this warning seems indicate the probe had problem controlling the DAP or the target core, but on the other hand, the flashing did seem to be successful. I'm a little bit confused.

what is the output of the commands:

$ probe-rs list
$ probe-rs info
$ probe-rs reset

also, did you try a different program outside embassy, such as the blinky example of the stm32f4xx-hal crate?

Yes, I've already tried with another blinky.rs example and managed to make the LED blink, so I believe my hardware setup is correct.

Here is the output of the commands you asked me to run

PS C:\Users\simone.mansueti\Desktop\embassy\examples\stm32f4> probe-rs list
The following debug probes were found:
[0]: Dual RS232 -- 0403:6010: (FTDI)
[1]: STLink V3 -- 0483:374f:002B00453038510934333935 (ST-LINK)
PS C:\Users\simone.mansueti\Desktop\embassy\examples\stm32f4> probe-rs info  --probe 0483:374f:002B00453038510934333935
Probing target via JTAG

ARM Chip with debug port Default:
Debug Port: DPv1, DP Designer: ARM Ltd
โ””โ”€โ”€ 0 MemoryAP
    โ””โ”€โ”€ ROM Table (Class 1), Designer: STMicroelectronics
        โ”œโ”€โ”€ Cortex-M4 SCS   (Generic IP component)
        โ”‚   โ””โ”€โ”€ CPUID
        โ”‚       โ”œโ”€โ”€ IMPLEMENTER: ARM Ltd
        โ”‚       โ”œโ”€โ”€ VARIANT: 0
        โ”‚       โ”œโ”€โ”€ PARTNO: Cortex-M4
        โ”‚       โ””โ”€โ”€ REVISION: 1
        โ”œโ”€โ”€ Cortex-M3 DWT   (Generic IP component)
        โ”œโ”€โ”€ Cortex-M3 FBP   (Generic IP component)
        โ”œโ”€โ”€ Cortex-M3 ITM   (Generic IP component)
        โ”œโ”€โ”€ Cortex-M4 TPIU  (Coresight Component)
        โ””โ”€โ”€ Cortex-M4 ETM   (Coresight Component)


Unable to debug RISC-V targets using the current probe. RISC-V specific information cannot be printed.
Unable to debug Xtensa targets using the current probe. Xtensa specific information cannot be printed.

Probing target via SWD

ARM Chip with debug port Default:
Debug Port: DPv1, DP Designer: ARM Ltd
โ””โ”€โ”€ 0 MemoryAP
    โ””โ”€โ”€ ROM Table (Class 1), Designer: STMicroelectronics
        โ”œโ”€โ”€ Cortex-M4 SCS   (Generic IP component)
        โ”‚   โ””โ”€โ”€ CPUID
        โ”‚       โ”œโ”€โ”€ IMPLEMENTER: ARM Ltd
        โ”‚       โ”œโ”€โ”€ VARIANT: 0
        โ”‚       โ”œโ”€โ”€ PARTNO: Cortex-M4
        โ”‚       โ””โ”€โ”€ REVISION: 1
        โ”œโ”€โ”€ Cortex-M3 DWT   (Generic IP component)
        โ”œโ”€โ”€ Cortex-M3 FBP   (Generic IP component)
        โ”œโ”€โ”€ Cortex-M3 ITM   (Generic IP component)
        โ”œโ”€โ”€ Cortex-M4 TPIU  (Coresight Component)
        โ””โ”€โ”€ Cortex-M4 ETM   (Coresight Component)


Debugging RISC-V targets over SWD is not supported. For these targets, JTAG is the only supported protocol. RISC-V specific information cannot be printed.
Debugging Xtensa targets over SWD is not supported. For these targets, JTAG is the only supported protocol. Xtensa specific information cannot be printed.
PS C:\Users\simone.mansueti\Desktop\embassy\examples\stm32f4> probe-rs reset --probe 0483:374f:002B00453038510934333935
Error: Connecting to the chip was unsuccessful.

Caused by:
    0: Unable to load specification for chip
    1: The connected chip could not automatically be determined.

Note that I am not using probe-rs for running and debugging, but openocd

it looks like the debug probe is working.

although probe-rs cannot automatically detect the chip model from the CPUID, it shouldn't cause any problem when you specify the --chip STM32F412ZGTx command line flag. I would guess the embassy example didn't correctly initialize the chip.

it could be a hardware compatibility issue with embassy. did you forget to change the dependency feature of the hal crate (embassy-stm32 in this case)?

you should change these lines in Cargo.toml of the example:

the embassy project has its own hal crates, which use cargo features to select the hardware model. see the docs for an overview:

I resolved it, thanks a lot, it was a stupid error