-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Added code that allows programmatically to manage the phy data. #1491
Conversation
@tius2000 Any comments or feedback from your side? |
Sming/system/esp8266_phy.c
Outdated
int ICACHE_FLASH_ATTR __attribute__((weak)) custom_register_chipv6_phy(uint8_t* initData) | ||
{ | ||
if (initData != NULL) { | ||
memcpy(initData, phyInitData, sizeof(phyInitData)); |
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.
Shouldn't this be memcpy_P?
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 think that is needed but will test it later just to be sure.
f7a7e12
to
07cfda7
Compare
@slaff : I do not understand the details, but I think that is great idea! |
…l parameters data. That option can be enabled with ENABLE_CUSTOM_PHY=1.
d4228e3
to
9d574df
Compare
I will give this a +1 as I didn't realize that the phy data was different between SDKs. I am migrating to 3.0 to fix some stability issues with wifi. So far I haven't seen any major problems with OTA updating to a version of my app on the 3.0 SDK, but I can also say it hasn't really fixed some of the issues I'm seeing. I would say updating the PHY with SDK moving forward would be somewhat required for anyone that has used SMING for a period of time. |
@slaff I've been trying to get analogue reading working so tried patching PHY to see if that helped (it doesn't, probably broken hardware). Anyway, I've got this ported onto current develop but not sure best way to submit it. |
The problem with this PR is that it works only with the latest SDK. If we want to use it for 1.5.4 or 2.0.0 it will not work. There are different tricks to intercept reading or writing to special area on the flash memory but unfortunately I was not able to find a solution that works on all supported SDKs. We can eventually say that this will work only with SDK >= 3.0.0.
Submit your code as a new PR and I will close this one. |
OK, thanks. |
You might find this funny. I had signal connected to D0 instead of A0 on my nodeMCU. Shoot me now :-( |
@slaff With #2171 changing the PHY could be done by adding a build variable with the partition name for the PHY initialisation data (default would be (NB. This still leaves the issue of how to construct the PHY data but with a HEX editor and the Official configuration guide not too difficult. If there's a need could be handled using a python script, with the configuration described in a JSON file.) |
7b19c1b
to
295a5f3
Compare
308f912
to
9d574df
Compare
Closing in favour of #2830 |
The initial PHY data is used initialize an ESP8266 chip and controls its behaviour. This is stored in the ``phy_init`` partition and is loaded at startup. Sometimes you may want to change that data for a certain ROM on the device without changing it for all ROMs on the device. To do this, build with ``ENABLE_CUSTOM_PHY=1`` and add code to your application: ``` #include <esp_phy.h> void customPhyInit(PhyInitData data) { // Use methods of `data` to modify as required data.set_vdd33_const(0xff); } ``` This PR supersedes #1491 and provides a more C++ mechanism for adjusting the configuration at runtime.
The initial physical data is used initialize an ESP8266 chip and controls its behaviour. Sometimes you may want to change that data for a certain ROM on the device without changing it for all ROMs on the device.
This PR introduces a new feature that allows programmatically to control and change the initial physical data.
That option is not enabled by default but can be enabled with ENABLE_CUSTOM_PHY=1 directive.
Closes #985.