I have a STM32H730VBTx target with a custom board with some own SPI flash memory. The CMSIS database doesn't have the appropriate driver for my MCU / memory chip combination.
I have read how to make an own "external loader" with STMCubeIDE / STMCubeMX. I think, that term means the same as "flash algorithm" in the probe-rs world.
Now I want to use the convinient assistant of STMCubeMX for generating the external loader source with all nessecary pinout configurations, initializations etc. I see no use in (re)writing that stuff by hand in rust.
But, I want to write my main application in rust. So I'd like to use the generated external loader from STMCubeIDE with my rust toolchain (VSCode, rust-analyzer, probe-rs).
How Can I achieve this? I can compile the external loader inside STM32CubeIDE to an elf file. But then what? How to I get this ELF file into my probe-rs target definition yaml under "flash_algorithms -> instructions" ? I see some BASE64-enconding in the existing target-yamls. But when I use the probe-rs' flash-algorithm-template and compare the base64-decoded "instructions" of the resulting yaml with the resulting ELF, it's totally different. So, there must be some other magic involved?
Ok, one possibility I see in integrating the STM32CubeProgrammer into my Rust Toolchain as a GDB server. Might work (didn't try yet), but anyway I'd like not to have 2 toolchains ready, after my flash algorithm is ready. Also, there are other developers of the main application in rust, and it would be tedious, if all of them also would need to install the STM tools too.
Any solution somebody, ELF file -> probe-rs target?
Error: Failed to extract flash information from ELF file 'CLIVEONE-IS25LP128_STM32H72X-PA3-PC11-PC9-PC10-PE2-PA6.stldr'.
Caused by:
Failed to find 'FlashDevice' symbol in ELF file.
Can someone help me, how do I get the "FlashDevice" symbol into that elf?
$ objdump -t CLIVEONE-IS25LP128_STM32H72X-PA3-PC11-PC9-PC10-PE2-PA6.stldr
CLIVEONE-IS25LP128_STM32H72X-PA3-PC11-PC9-PC10-PE2-PA6.stldr: Dateiformat elf32-little
SYMBOL TABLE:
00000000 g O .info 000000c8 StorageInfo
240007c1 g F .prog 000001e0 Init
240009a1 g F .prog 00000004 DeInit
24000aa1 g F .prog 000000a4 Write
24000a31 g F .prog 00000070 Read
24000a21 g F .prog 0000000e MassErase
240009a5 g F .prog 0000007c SectorErase
Same error message Failed to find 'FlashDevice' symbol in ELF file I also get for any arbitrary external loader that is delivered with STM32CubeProgrammer inside the STM32CubeProgrammer/bin/ExternalLoader directory.
That said, please report your findings here to build up the searchable knowledge base for future programmers going down the same path, let's avoid this:
Yes, I'll do that, that was the reason for post 3.
But here's a better space (room) for explaining the problem and a better findability for the solution, as You said.