Skip to content

Conversation

@Frostie314159
Copy link
Contributor

@Frostie314159 Frostie314159 commented Aug 3, 2025

Thank you for your contribution!

We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:

Submission Checklist 📝

  • I have updated existing examples or added new ones (if applicable).
  • I have used cargo xtask fmt-packages command to ensure that all changed code is formatted correctly.
  • My changes were added to the CHANGELOG.md in the proper section.
  • I have added necessary changes to user code to the Migration Guide.
  • My changes are in accordance to the esp-rs developer guidelines

Extra:

Pull Request Details 📖

Description

This is a follow-up to #3687, that extracts the PHY init into a separate esp-phy crate, to make it generically usable for both esp-radio and esp-wifi-hal. The PHY init is now tied to the peripheral singleton, just like the PHY clock initialization. LMK if this architecture looks good to you.

I think, that it would be good to add this PR to #3814.

Testing

Describe how you tested your changes.

closes #2469

@bjoernQ
Copy link
Contributor

bjoernQ commented Aug 6, 2025

I think this is going into a good direction.

As a matter of taste I would probably move the common_adapter_XXX and phy_init_data_XXX files into own its modules. (i.e. move the common_adapter_XXX into it's own module)

We can also take the opportunity to turn a few static muts into atomics

@Frostie314159
Copy link
Contributor Author

@bjoernQ I may need some help with the linker files for esp-radio and esp-phy.

@bjoernQ
Copy link
Contributor

bjoernQ commented Aug 18, 2025

A quick look at libphy.a shows these undefined functions (used the ESP32 library - will slightly vary across chips):

To be defined:

  • esp_dport_access_reg_read
  • phy_enter_critical
  • phy_exit_critical
  • rtc_get_xtal

Undefined - no idea if needed

  • temprature_sens_read
  • phy_tx_pwr_track_en

esp-wifi-sys

  • sprint
  • phy_printf

esp-rom-sys

  • __divsf3
  • __floatunsidf
  • __divdi3
  • memcpy
  • __truncdfsf2
  • ets_delay_us
  • __divdf3
  • phy_get_romfuncs

Things defined in esp-*-sys you don't need to worry about.

No idea about the second category - we don't define them anywhere. Maybe they come from one of the other static libraries but haven't seen anything there

Things from the first category should be implemented following the pattern in #3890

@Frostie314159
Copy link
Contributor Author

Alright, I will implement it like that. Thanks for the detailed response

@Frostie314159
Copy link
Contributor Author

Hi, sorry for the delay. I'll work on this tomorrow.

@bjoernQ
Copy link
Contributor

bjoernQ commented Aug 29, 2025

There were some changes around the moved code - just FYI

@Frostie314159
Copy link
Contributor Author

@bjoernQ I'm not quite sure, what's causing the CI failure on the S3. Do you have any ideas?

@Frostie314159
Copy link
Contributor Author

Oh crap, I forgot about the other uses of critical-section. Sorry

Copy link
Contributor

@bugadani bugadani left a comment

Choose a reason for hiding this comment

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

I think this is now ready to go, thanks very much :)

Copy link
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

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

Can you modify https://github.com/esp-rs/esp-hal/blob/main/.github/workflows/changelog.yml to check the new esp-phy changelog too?

@bugadani bugadani requested a review from bjoernQ September 19, 2025 13:15
Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

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

LGTM

@bugadani bugadani enabled auto-merge September 19, 2025 13:35
@bjoernQ
Copy link
Contributor

bjoernQ commented Sep 19, 2025

@SergioGasquez I guess we need a thumbs up from your side, too

@bugadani bugadani added this pull request to the merge queue Sep 19, 2025
Merged via the queue into esp-rs:main with commit 8e29b92 Sep 19, 2025
27 of 28 checks passed
@Frostie314159 Frostie314159 deleted the esp-phy branch September 20, 2025 06:21
default:
- value: false

- name: phy_full_calibration
Copy link
Contributor

Choose a reason for hiding this comment

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

This config is unused. Was this an intentional change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Crap, I forgot to implement that. I can create a new PR for that, if you want.

Copy link
Contributor

Choose a reason for hiding this comment

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

That would be awesome, if you don't mind

@Frostie314159 Frostie314159 mentioned this pull request Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog No changelog modification needed

5 participants