-
Notifications
You must be signed in to change notification settings - Fork 28
Add a basic example which blinks an LED #10
Conversation
|
||
/// The default clock source is the onboard crystal | ||
/// In most cases 40mhz (but can be as low as 2mhz depending on the board) | ||
const CORE_HZ: u32 = 40_000_000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't intend to change this but to keep this as a side note, in the PR #7 this can be calculated at run time depending on the clock source used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out. I'm fine with waiting until that PR has merged and updating the example if that's preferable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Sorry I didn't get to this sooner. Just a few bits to change:)
.cargo/config
Outdated
[build] | ||
rustflags = [ | ||
"-C", "link-arg=-nostartfiles", | ||
"-C", "debuginfo=0", # not 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer required, the new llvm fork supports debug info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for clarification, am I removing the entire rustflags
array, its first 2 elements, or just the debuginfo
line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MabezDev Which exact llvm fork are you using? If I use https://github.com/espressif/llvm-project/tree/xtensa_release_9.0.1 I still get CFI not supported errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arjanmels I'm using that fork; it should work. Note that if you're trying to compile .S assembly files, it will be passed to the gcc assembler at the moment, which will produce these errors. Inline assembly works though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange, not working for me. I recompiled llvm and rust, but no luck, must be missing something.
This is what I get if I check my version (afraid it may not be super helpfull:
$RUSTC --version --verbose
rustc 1.44.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.44.0-dev
LLVM version: 9.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is weird, so you can't create debug info at all? I've defintely got it working on my machine: espressif/llvm-project#10 (comment)
Ive been pretty tied up this week, but today I've been revisiting the rust fork, looking to improve the ABI calls, and use the built in llvm module, which might fix your issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No debug info not working for me. If I understand your comment for espressif/llvm-project#10 (comment) correct you are working with a local rebase, so theoretically could be something different?
More likely that I did something wrong perhaps, but I don't know what. Anyway I am managing ok without the debugger at the moment as I have the serial output up and running, but debugger would be nice of course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That rebase was temporary, the current default branch of the fork has the correct changes in it.
I think everything should be okay now. If I still don't have the |
Perfect! Thank you! |
Pretty self-explanatory. If there are any issues please let me know and I will get them fixed up.