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

rust-analyzer can not recognize peripherals.GPIO*. #3148

Closed
traversebitree opened this issue Feb 19, 2025 · 4 comments
Closed

rust-analyzer can not recognize peripherals.GPIO*. #3148

traversebitree opened this issue Feb 19, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@traversebitree
Copy link

Bug description

rust-analyzer can not recognize peripherals.GPIO*. But the compilation was successful.

Image


Image

To Reproduce

  1. Generate codes using esp-generate
esp-generate --chip esp32s3 blinky
  1. Modify src/async_main.rs. My LED is at GPIO#48.
#![no_std]
#![no_main]

use esp_backtrace as _;
use esp_hal::{
    delay::Delay,
    gpio::{Level, Output},
    main,
};

use esp_println::println;

#[main]
fn main() -> ! {
    let peripherals = esp_hal::init(esp_hal::Config::default());

    println!("Hello world!");

    // Set GPIO7 as an output, and set its state high initially.
    let mut led = Output::new(peripherals.GPIO48, Level::Low);

    led.set_high();

    // Initialize the Delay peripheral, and use it to toggle the LED state in a
    // loop.
    let delay = Delay::new();

    loop {
        led.toggle();
        delay.delay_millis(500);
    }
}

Expected behavior

I expect when I typed peripherals.GP in VS Code. Then peripherals.GPIO48 can appear.

Environment

  • Target device: ESP32-S3]
PS C:\Users\xykon> espflash board-info
✔ Use serial port 'COM3' - USB 串行设备 (COM3)? · yes
✔ Remember this serial port for future use? · no
[2025-02-19T04:06:40Z INFO ] Serial port: 'COM3'
[2025-02-19T04:06:40Z INFO ] Connecting...
[2025-02-19T04:06:40Z INFO ] Using flash stub
Chip type:         esp32s3 (revision v0.2)
Crystal frequency: 40 MHz
Flash size:        32MB
Features:          WiFi, BLE
MAC address:       84:fc:e6:7e:4e:74
  • Crate name and version: esp-hal = { version = "0.23.1", features = ["esp32s3", "unstable"] }
@traversebitree traversebitree added bug Something isn't working status:needs-attention This should be prioritized labels Feb 19, 2025
@bugadani
Copy link
Contributor

bugadani commented Feb 19, 2025

Image

This is the current state on main. Also while this was caused by our macros, the issue is really a rust-analyzer issue.

@MabezDev MabezDev removed the status:needs-attention This should be prioritized label Feb 19, 2025
@traversebitree
Copy link
Author

traversebitree commented Feb 19, 2025

@bugadani Thank you very much for your answer, so how can I solve this problem by myself?Or wait for the new version to be released?

@bugadani
Copy link
Contributor

You can wait for a new release, or you can start using our git main branch for the time being.

@traversebitree
Copy link
Author

Thank you for your help in resolving my issue!

@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants