Skip to content
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

STM32F4 writing does not work #10

Closed
tech2077 opened this issue Oct 18, 2011 · 9 comments
Closed

STM32F4 writing does not work #10

tech2077 opened this issue Oct 18, 2011 · 9 comments

Comments

@tech2077
Copy link

After modifying the blink_flash example to work with the STM32F4 cortex-m4 family, I built and tried to write the program to flash. It stalled and outputted this repeatedly:

core status: running

*** stlink_status ***
submit_wait(req)
submit_wait(rep)
status == 0x80
data_len = 5 0x5
80 00 00 00 00

on both the "flash" and "gdbserver" applications. Reading seems to work, but i can't test if the reads are correct without a write to write the resulting file back. All other gdb commands seem to work.

Edit

On further testing, it shows that it writes to ram, but fails to execute. It occasionally gives several different errors and messages.

matthew@matthew-desktop:~/stlink/example/blink$ gdb
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
http://bugs.launchpad.net/gdb-linaro/.
(gdb) tar ext :4242
Remote debugging using :4242
0x00000000 in ?? ()
(gdb) kill
Kill the program being debugged? (y or n) y
(gdb) load blink.elf
Loading section .text, size 0x38 lma 0x20000000
Load failed
(gdb) load blink.elf
Loading section .text, size 0x38 lma 0x20000000
Load failed
(gdb) continue
The program is not being run.
(gdb) kill
The program is not being run.
(gdb) r
Starting program:
Could not write register "orig_eax"; remote failure reply 'E00'
(gdb) load blink.elf
Loading section .text, size 0x38 lma 0x20000000
Start address 0x20000000, load size 56
Transfer rate: 356 bytes/sec, 56 bytes/write.
(gdb) continue
Continuing.
^C
Program received signal SIGTRAP, Trace/breakpoint trap.

@karlp
Copy link
Contributor

karlp commented Oct 19, 2011

You've made the same mistake as I made in the beginning. :) Even though stlink runs as a remote gdb server, you still need to be running an arm gdb. the gdb you are loading is trying to run for "x86_64-linux-gnu"

you should be running "arm-eabi-none-gdb" then "target exte :4242" instead of just "gdb"

Cheers,
Karl P

@tech2077
Copy link
Author

Ah, that explains it. I was able to get writes to sram to work, but writes to flash do not fail with an error, but do not seem to work.

@bikeNomad
Copy link
Contributor

for me, both the flash tool and the arm-none-eabi-gdb "load" command never complete on the STM32F4 Discovery board. The debug output shows repeated wait and status running messages.

I can run gdb fine on the SRAM version.

@karlp
Copy link
Contributor

karlp commented Oct 19, 2011

man, how did you all get your F4 boards so fast! jealous they're still wildly out of stock at digikey and mouser.

@tech2077
Copy link
Author

I ordered mine the day they came out, and recieved it Monday.

@tech2077 tech2077 reopened this Oct 20, 2011
@frohro
Copy link

frohro commented Nov 5, 2011

Have any of you had any success with linking with the math library or getting it working with the FPU in Linux? I found the following page quite helpful getting started.

http://cu.rious.org/make/stm32f4-discovery-board-with-linux/

Thanks,

Rob

@karlp
Copy link
Contributor

karlp commented Nov 16, 2011

tech2077: f4 writing to flash should be working with current texane master branch. It's working for a few people in chat room, but all fixes are now merged in, and I'd like to close this ticket :)

@tech2077
Copy link
Author

Tested yesterday and today, with clean builds and proper GDB, and the flash utility works perfectly, but i can't write to flash with GDB still. Also, where is the chat room, if there are people which were able to make it work, I would like to talk to them.

@karlp
Copy link
Contributor

karlp commented Nov 17, 2011

irc.freenode.org channel: ##stm32

@xor-gate xor-gate closed this as completed May 4, 2016
@Nightwalker-87 Nightwalker-87 added this to the Resolved questions milestone Feb 23, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: Resolved questions, Resolved questions & general issues Feb 27, 2020
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants