GithubHelp home page GithubHelp logo

Comments (7)

cwoodall avatar cwoodall commented on August 15, 2024 1

@japaric Thanks for the support on this issue! We were having this problem at the Boston Embedded Systems Meetup's Bring and Blink and some people were very impressed with your responsiveness and helpfulness in resolving this issue. Thank you for this book and all of the work you have done! It is awesome

from discovery.

japaric avatar japaric commented on August 15, 2024

Sounds like the linker is dropping the main symbol at link time. Could you check with objdump?

# is `<main>` there?
$ arm-none-eabi-objdump -Cd target/thumbv7m-none-eabihf/debug/led-roulette | less

It's a bug with some gcc versions. It has been reported before (#34). You have to install / use a different GCC version. #34 mentions an alternative GCC repo at the end of its description.

from discovery.

spamwax avatar spamwax commented on August 15, 2024

The <main> is not there!
I tried the mentioned px4 brew tap in #34, its gdb crashes immediately.
The only way to get the gdb 7.12's support for rust on OS X seems to be using the linker from 5_4-2016q3 (ARM's official gcc) and then downloading/using gdb from 6-2017-q1-update

from discovery.

fluxchief avatar fluxchief commented on August 15, 2024

I'm having the same issue. How is the initialization done? It reaches pg::init, but this doesn't call the main function. The stack backtrace at pg::init also does not show anything beyond this and $sp seems to be at the start of the stack. How is main supposed to get called?

EDIT: Well it seems that this issue is pretty common here. I'll have a look at the possible solutions,

from discovery.

kcking avatar kcking commented on August 15, 2024

After first following these instructions, the px4/px4 tap fixed this issue for me

$ brew info px4/px4/gcc-arm-none-eabi
px4/px4/gcc-arm-none-eabi: stable 20160928
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
/usr/local/Cellar/gcc-arm-none-eabi/20160928 (5,502 files, 447.2MB) *
  Built from source on 2017-04-03 at 19:42:16
From: https://github.com/px4/homebrew-px4/blob/master/gcc-arm-none-eabi.rb

from discovery.

japaric avatar japaric commented on August 15, 2024

Turns out newer versions of gcc were dropping the entry point _reset, which is marked as so in the linker script. I have modified the linker script to force the linker to keep the symbol around and released a new version of the f3 crate (v0.3.1) with the fix.

Tentatively closing as fixed but let me know if you run into any other linker error.

from discovery.

durka avatar durka commented on August 15, 2024

Hi, this came up again for me. I'm using GCC 5.4 on Debian 9.5. The main symbol is present but GDB can't find it for some reason. I was able to set a breakpoint by line number.

$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (15:5.4.1+svn241155-1) 5.4.1 20160919
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ arm-none-eabi-objdump -Cd target/thumbv7em-none-eabihf/debug/led-roulette | rg main
08000188 <led_roulette::main>:
 8000192:	e7ff      	b.n	8000194 <led_roulette::main+0xc>
 8000194:	e7fe      	b.n	8000194 <led_roulette::main+0xc>
08000196 <main>:
 8000444:	f7ff fea7 	bl	8000196 <main>

$ arm-none-eabi-gdb target/thumbv7em-none-eabihf/debug/led-roulette
GNU gdb (7.12-6+9+b2) 7.12.0.20161007-git
Copyright (C) 2016 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 "--host=x86_64-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from target/thumbv7em-none-eabihf/debug/led-roulette...done.
(gdb) target remote :3333
Remote debugging using :3333
Reset () at /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.5.3/src/lib.rs:491
491	    let pre_init: unsafe extern "C" fn() = __pre_init;
(gdb) load
Loading section .vector_table, size 0x188 lma 0x8000000
Loading section .text, size 0x3f0 lma 0x8000188
Loading section .rodata, size 0x12c lma 0x8000580
Start address 0x80003e4, load size 1700
Transfer rate: 708 bytes/sec, 566 bytes/write.
(gdb) break led_roulette::main
Function "led_roulette::main" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) break main.rs:11
Breakpoint 1 at 0x800018c: file src/05-led-roulette/src/main.rs, line 11.
(gdb) continue
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.

Breakpoint 1, led_roulette::main::h1bb7a04b9156fd55 () at src/05-led-roulette/src/main.rs:13
13	    let x = 42;
(gdb) 

from discovery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.