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

Remove stale patch for SDK v1.1 and earlier #8858

Merged
merged 2 commits into from
Feb 22, 2023

Conversation

mhightower83
Copy link
Contributor

@mhightower83 mhightower83 commented Feb 15, 2023

The rts_reg addresses referenced are not valid for SDK v2.0.0 and up. For rts_reg[30] = 0; on SDK v1.1.0, it cleared a checksum. On SDL v2.0.0, it zeros TestStaFreqCalValInput.

I don't think this is needed; however, if you have a need to recreate the old behavior for comparison, use RF_PRE_INIT() as shown:

#include <Esp.h>

RF_PRE_INIT() {
#if 1 && (NONOSDK < (0x30000))
  // Old legacy SDK v1.1 and earlier patch
  // Clear RTC RAM backup area checksum
  volatile uint32_t* rtc_reg = (volatile uint32_t*) 0x60001000;
  rtc_reg[30] = 0;

  // Hide checksum error message
  system_set_os_print(0);
#endif

#if 0 && (NONOSDK >= (0x20000))
  // I don't expect this to be useful; however, this should do what was
  // intended to have been done before.
  //
  // For SDKs 2.0.0 through 3.0.5
  // Clear RTC RAM backup area checksum
  volatile uint32_t* rtc_reg = (volatile uint32_t*) 0x60001000;
  rtc_reg[26] = 0;
#endif
}

Long long ago

In the beginning, before the release of Arduino ESP8266 Core v2.0.0-rc1
We were using SDK v1.1.0. This version of the SDK stored the results of a call to deep_sleep_set_option() at rtc_reg[24]. And kept an RTC memory checksum at rtc_reg[30].

At the first file commit the patch looked like this:

volatile uint32_t* rtc_reg = (volatile uint32_t*) 0x60001000;
rtc_reg[30] = 0;
system_set_os_print(0);

By the time of Core v2.0.0-rc1 we had a more selective patch:
When this commit was made Aug 5, 2015 the SDK version was around v1.1.0

volatile uint32_t* rtc_reg = (volatile uint32_t*) 0x60001000;
if((rtc_reg[24] >> 16) > 4) {
rtc_reg[24] &= 0xFFFF;
rtc_reg[30] = 0;
}
system_set_os_print(0);

By the time of the release of Core v2.0.0-rc1 (Nov 17, 2015), we were using SDK v1.3.0 which no longer used those offsets in RTC memory. It is not clear to me that the patch was required anymore. And the message that often showed "RTC MEM CHECK FAIL!!!" was no longer in the SDK.

These issues may be entangled with the long version of the patch it is hard to sort out:

rts_reg address referenced was not valid for SDK v2.0.0 and up.
rts_reg[30] = 0; cleared storaged used to set TestStaFreqCalValInput.
@mhightower83 mhightower83 marked this pull request as ready for review February 17, 2023 14:38
@mcspr mcspr added this to the 3.1.2 milestone Feb 22, 2023
@mcspr mcspr merged commit be02af0 into esp8266:master Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants