Closed huming2207 closed 1 year ago
Hey! Thanks for the nice words! Yes, this is indeed wrong! I was lazy in the first pass of the target-gen PR and forgot to fix it later on ... It should, as you suggested, use the base address and the correct default value for the flash :)
Hey! Thanks for the nice words! Yes, this is indeed wrong! I was lazy in the first pass of the target-gen PR and forgot to fix it later on ... It should, as you suggested, use the base address and the correct default value for the flash :)
Understood, thanks for your reply! I will submit a PR later tonight or tomorrow to probe-rs
repo and fix this.
Thank you!
@Yatekii done, it's working:
with default (debug?) build:
Test: Erasing sectorwise and writing two pages ...
Message: Init
Message: Erase sector addr:0x8000000
Message: Erase sector addr:0x8000800
Message: Init
Message: Program Page addr:134217728 size:1024
Message: Program Page addr:134218752 size:1024
Finished programming in 335.871133ms
Test: Erasing the entire chip and writing two pages ...
Message: Init
Message: Erase All
Finished erasing in 70.769179ms
Message: Init
Message: Program Page addr:134217728 size:1024
Message: Program Page addr:134218752 size:1024
Finished programming in 335.360992ms
Test: Erasing sectorwise and writing two pages double buffered ...
Message: Init
Message: Erase sector addr:0x8000000
Message: Erase sector addr:0x8000800
Message: Init
Message: Program Page addr:134217728 size:1024
Message: Program Page addr:134218752 size:1024
Finished programming in 143.421234ms
Finished in 7.168853657s
with release build:
Test: Erasing sectorwise and writing two pages ...
Message: Init
Message: Erase sector addr:0x8000000
Message: Erase sector addr:0x8000800
Message: Init
Message: Program Page addr:134217728 size:1024
Message: Program Page addr:134218752 size:1024
Finished programming in 336.054229ms
Test: Erasing the entire chip and writing two pages ...
Message: Init
Message: Erase All
Finished erasing in 70.864407ms
Message: Init
Message: Program Page addr:134217728 size:1024
Message: Program Page addr:134218752 size:1024
Finished programming in 334.405652ms
Test: Erasing sectorwise and writing two pages double buffered ...
Message: Init
Message: Erase sector addr:0x8000000
Message: Erase sector addr:0x8000800
Message: Init
Message: Program Page addr:134217728 size:1024
Message: Program Page addr:134218752 size:1024
Finished programming in 142.896715ms
Finished in 5.038007484s
@Yatekii please check here: https://github.com/probe-rs/probe-rs/pull/1542
I will close this issue thread for now. Feel free to open it if necessary.
Hi all,
Firstly thanks for this great work! I've finally found something much more organized than CMSIS-Pack's flashing algorithm! I'm trying to implement a flash algorithm for STM32WLJC. Here's the implementation: https://github.com/huming2207/stm32wle5-flash-algo/blob/master/src/main.rs
Then I tried running
RUST_BACKTRACE=1 cargo run
, here's what I've got:However, if I use
pyocd cmd
and runrw 0x08000000 128
, here's what I've got:As you see, the flash has been emptied.
I've also checked the
target-gen
's code and here's something that made me a bit confused: https://github.com/probe-rs/probe-rs/blob/dc5eb11ba23a5abfd1dd734385b93c7edd60f490/target-gen/src/commands/test.rs#L98I'm not sure why it's hardcoded to 0x0? I think it probably should be to whichever the microcontroller's flash base address is. For my STM32WLE5JC, it should be 0x08000000. May I ask, am I right? Have I misinterpreted something?
Regards, Jackson