-
Notifications
You must be signed in to change notification settings - Fork 935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
embassy-boot sample issues on STM32F3DISCOVERY #3945
Comments
Looks to me like you're doing everything correct here. I'm assuming you're using the memory.x https://github.com/embassy-rs/embassy/blob/main/examples/boot/application/stm32f3/memory.x for the application as well, since b is working if you flash it with the bootloader running. One thing to check next is maybe to verify that the flash operations work as expected on your chip (i.e. run an example that erase, write, read flash across the same regions to check that there is no bug in the flash driver). Then, another point might be to verify that bank1_region.base + active_offset points to 0x08008000. Fwiw the chip metadata used by the HAL should be this https://github.com/embassy-rs/stm32-data-generated/blob/main/stm32-metapac/src/chips/stm32f303vc/metadata.rs |
Yes, this one:
I also got a NUCLEO-F303RE dev board and tried the same steps (with the different board specified obviously). It had the same issue. I tried using cargo run to get some debugging, and I found that this was the last information before the crash.
I've had some trouble getting debug messages going in the bootloader, so I'm having a little difficulty troubleshooting the flash driver and pointer to the flash vector table address, but I will get something going this week and get back to you. |
There's a good chance this is related to me missing a step, so I apologize if that's the case, but I've been trying to get this example working for a week with no luck and I think it should be working. The board I'm working with is an STM32F3DISCOVERY with an STM32F303VCT6 on it.
Here's what I'm doing:
cloning embassy fresh into a new directory
I'm going to the embassy/examples/boot/application/stm32f3/
I'm updating Cargo.toml , replacing "stm32f303re" with "stm32f303vc" in embassy-stm32 features
I'm updating the bootloader, a.rs, and b.rs with LEDs and input pins that are usable on my board
bootloader main.rs
a.rs
b.rs
I'm flashing the bootloader with:
cargo flash --manifest-path ../../bootloader/stm32/Cargo.toml --release --features embassy-stm32/stm32f303vc --chip STM32F303VCTx
I'm building the secondary firmware with:
cargo build --release --bin b
I'm creating the bin file with:
cargo objcopy --release --bin b -- -O binary b.bin
I'm flashing the initial firmware with:
cargo flash --release --bin a --chip STM32F303VCTx
At first everything works well. I get 2 flashes from PE10 showing the bootloader runs.
Then I get PE11 and PE13 on showing that the "a" firmware is running
I short PC6 to ground and PE11 turns off while PE14 turns on which shows the update was completed without a panic
The board then boots back to the bootloader, which flashes PE10 twice.
Then, nothing. The "b" firmware does not run. All LEDs turn off and stay off.
Because PE10 flashes twice, I know that the bootloader makes it to the last line without trouble
I can go back and run the same thing with "b" as the main firmware with:
cargo build --release --bin b --chip STM32F303VCTx
That works well, and PE9 flashes continuously after the bootloader finishes.
I've tried this with several machines and have really tried to run this problem down, but have not had any luck.
side note, I know that .cargo/config.toml also has a reference to the target chip, but when I went to change it I noticed that the runner is already set to STM32F303VCTx.
The text was updated successfully, but these errors were encountered: