Skip to content

Restore EEPROM support #344

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

Merged
merged 7 commits into from
Feb 22, 2021
Merged

Restore EEPROM support #344

merged 7 commits into from
Feb 22, 2021

Conversation

nseidle
Copy link
Member

@nseidle nseidle commented Feb 7, 2021

In this commit, EEPROM compilation was fixed. But later in this commit, it was broken again.

This PR:

  • Fixes the missing drivers for FlashIAPBlockDevice.h error
  • Changes how write() works. Now uses an uint8_t based scratch to avoid writing corruption across 32-bit blocks.
  • Adds back example 3 to demo all functions
  • Correct typo in example 1 so that it appears in dropdown menu

Nothing about this PR has me worried. The only question I have is why the includes.extra="-I{cores.path}/mbed-os/drivers/" was removed. If this was an error, then I think this PR is good to go. If the removal was intentional because of some other issue then we need further review.

@nseidle nseidle requested a review from Wenn0101 February 7, 2021 19:49
@Wenn0101
Copy link
Contributor

Wenn0101 commented Feb 7, 2021

Hey @nseidle
The includes.extra="-I{cores.path}/mbed-os/drivers/" was removed because this folder also contains a SPI.h. This conflicted with the arduino core SPI.h and is what cause SPI compilation error in v2.0.4. To address this, I removed includes.extra="-I{cores.path}/mbed-os/drivers/" again, but I changed our version of FlashIAPBlockDevice.h in mbed core to have a more explicit include path #include "FlashIAP.h" became #include "drivers/FlashIAP.h". See this commit.
I thought I updated the submodules correctly so that this would work in the latest build.
Are you seeing the problem when you download from the arduino boards manager, or did you get it from git? If the latter, can you try running a git submodule update --init --recursive and see if this clears up the problem. I thought I double checked this before release, so I would be somewhat surprised if it was not working.

@nseidle
Copy link
Member Author

nseidle commented Feb 7, 2021

Ah! That makes sense.

Yep, your update recommendation fixed the issue. I'm able to compile without the includes.extra. I've updated the PR. Let's let a few other folks kick the tires on release candidate but we should be good.

Wenn0101
Wenn0101 previously approved these changes Feb 7, 2021
FlashIAPBlockDevice::read((uint8_t*)scratch, 0, _cfg.sram_bytes); // keep all of flash in sram in case we need to erase
if(memcmp((void*)(((uint8_t*)scratch) + idx), data, size)){ // compare desired data (data) to existing information in flash (scratch)

if(memcmp((void*)(((uint8_t*)scratch) + idx), data, size)){ // compare desired data (data) to existing information in flash (scratch)
Copy link
Contributor

Choose a reason for hiding this comment

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

This casting seems unnecessary now that scratch is a uint8_t.

@Wenn0101
Copy link
Contributor

Wenn0101 commented Feb 7, 2021

I just noticed, after approving. Can we change this to merge into dev instead of master?

@nseidle nseidle changed the base branch from master to release-candidate February 8, 2021 03:37
@nseidle
Copy link
Member Author

nseidle commented Feb 8, 2021

I based off of rc but I suspect Windows GUI defaults to opening PR on main. Should be rc now.

@Wenn0101 Wenn0101 changed the base branch from release-candidate to dev February 8, 2021 05:45
@Wenn0101 Wenn0101 dismissed their stale review February 8, 2021 05:45

The base branch was changed.

@Wenn0101
Copy link
Contributor

Wenn0101 commented Feb 8, 2021

rc is actually an automatically generated branch that is based off dev. It takes the info in dev, and uses it to to build the precompiled libraries of the mbed submodule. Changed the base to dev, since I noticed I have that power too :D.

I'll take one more look at this tomorrow before merging it in.

@Wenn0101 Wenn0101 merged commit 5ad5acf into dev Feb 22, 2021
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