Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Add a basic example which blinks an LED #10

Merged
merged 2 commits into from
Mar 18, 2020
Merged

Add a basic example which blinks an LED #10

merged 2 commits into from
Mar 18, 2020

Conversation

jessebraham
Copy link
Member

Pretty self-explanatory. If there are any issues please let me know and I will get them fixed up.


/// 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;
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe merge this PR first because #7 has been superseded by #11

Copy link
Member

@MabezDev MabezDev left a 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:)

examples/blinky.rs Outdated Show resolved Hide resolved
.cargo/config Outdated
[build]
rustflags = [
"-C", "link-arg=-nostartfiles",
"-C", "debuginfo=0", # not 2
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor

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

Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Member

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.

Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
@jessebraham
Copy link
Member Author

I think everything should be okay now. If I still don't have the config file correct just let me know and I'll make the necessary adjustments.

@MabezDev
Copy link
Member

Perfect! Thank you!

@MabezDev MabezDev merged commit 1fdbcd6 into esp-rs:master Mar 18, 2020
@jessebraham jessebraham deleted the examples branch March 18, 2020 19:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants