Flashing code with stlink does not run code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-03-08 7:41 AM
I used the STM32CubeIDE to make a simple LED flashing program for an STM32H753. When I run the code with the CubeIDE, it uploads and flashes the LED as intended.
I would like to be able to run this code without the CubeIDE. I am on Mac and have stlink tools installed. I tried running:
st-flash write STM32H753XIHX_FLASH.ld 0x8000000
which outputted:
st-flash 1.7.0
2023-03-08T10:36:48 INFO usb.c: Unable to match requested speed 1800 kHz, using 1000 kHz
2023-03-08T10:36:48 INFO common.c: H74x/H75x: 128 KiB SRAM, 2048 KiB flash in at least 128 KiB pages.
file STM32H753XIHX_FLASH.ld md5 checksum: 517ef4c77a491566f06f321eb8bba767, stlink checksum: 0x00050078
2023-03-08T10:36:48 INFO common.c: Attempting to write 4713 (0x1269) bytes to stm32 address: 134217728 (0x8000000)
2023-03-08T10:36:48 WARN common.c: unaligned len 0x1269 -- padding with zero
2023-03-08T10:36:49 INFO common.c: Flash page at addr: 0x08000000 erased
2023-03-08T10:36:49 INFO common.c: Finished erasing 1 pages of 131072 (0x20000) bytes
2023-03-08T10:36:49 INFO common.c: Starting Flash write for H7
4714/4714 bytes written
2023-03-08T10:36:49 INFO common.c: Starting verification of write complete
2023-03-08T10:36:49 INFO common.c: Flash written and verified! jolly good!
I then tried again with:
st-flash write STM32H753XIHX_RAM.ld 0x8000000
which outputted:
st-flash 1.7.0
2023-03-08T10:37:33 INFO usb.c: Unable to match requested speed 1800 kHz, using 1000 kHz
2023-03-08T10:37:33 INFO common.c: H74x/H75x: 128 KiB SRAM, 2048 KiB flash in at least 128 KiB pages.
file STM32H753XIHX_RAM.ld md5 checksum: 226d4e61708c5f589a484848218556c, stlink checksum: 0x00050b31
2023-03-08T10:37:33 INFO common.c: Attempting to write 4728 (0x1278) bytes to stm32 address: 134217728 (0x8000000)
2023-03-08T10:37:34 INFO common.c: Flash page at addr: 0x08000000 erased
2023-03-08T10:37:34 INFO common.c: Finished erasing 1 pages of 131072 (0x20000) bytes
2023-03-08T10:37:34 INFO common.c: Starting Flash write for H7
4728/4728 bytes written
2023-03-08T10:37:34 INFO common.c: Starting verification of write complete
2023-03-08T10:37:34 INFO common.c: Flash written and verified! jolly good!
Both seemed to have valid outputs, but neither make the LED flash. What could I be doing wrong?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-03-08 8:14 AM
Are you sure the .ld file is the output of what you've compiled? .ld is usually used for the linker script.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-03-08 8:17 AM
Would Debug/<projectName>.elf be the correct file to flash?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-03-08 8:24 AM
This software is not from ST. It is an opensource project. For help you can ask the authors and maintainers.
From this documentation, it accepts only bin files, not elf.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-03-08 2:15 PM
No idea what stm32cube does - never used it, but openocd does not run a program after flashing. You need to execute reset command manually or add to programming sequence.
I highly recommend openocd for ST-LINK. Recently they added STM32G/C support.
Works just perfectly under FreeBSD. and for sure almost any other commonly used unix systems.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-03-08 5:01 PM
Why dont you use cube programmer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-03-09 12:53 AM
Because there are still people in the world that:
- don't want to use point and click way of "work"
- don't want vendor lock in
- don't want binary only packages
- want unix style tools that can be easily integrated with everything
- want small and simple tools doing one thing well, according to unix philosophy
- want tools that they can fully understand.
- want tools that never limit you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-06-28 6:53 AM
I have the issue here, did you find a solution to your problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-06-28 7:05 AM
Better is open new and explain...
