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

[msom] support 16MB GD flash. #2701

Merged
merged 4 commits into from
Oct 12, 2023
Merged

[msom] support 16MB GD flash. #2701

merged 4 commits into from
Oct 12, 2023

Conversation

XuGuohui
Copy link
Member

As the title describes.

This PR doesn't include the updating of memory map.

References

N/A


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

hal/src/rtl872x/exflash_hal.cpp Outdated Show resolved Hide resolved
hal/src/rtl872x/exflash_hal.cpp Outdated Show resolved Hide resolved
hal/src/rtl872x/exflash_hal.cpp Outdated Show resolved Hide resolved
hal/src/rtl872x/exflash_hal.cpp Outdated Show resolved Hide resolved
hal/src/rtl872x/exflash_hal.cpp Outdated Show resolved Hide resolved
hal/src/rtl872x/exflash_hal.cpp Outdated Show resolved Hide resolved
hal/src/rtl872x/exflash_hal.cpp Outdated Show resolved Hide resolved
hal/src/rtl872x/exflash_hal.cpp Outdated Show resolved Hide resolved
Copy link
Member

@scott-brust scott-brust left a comment

Choose a reason for hiding this comment

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

The main issue is that I cant seem to get writes >9 bytes to succeed. Can you reproduce the same behavior?

FLASH_WaitBusy(WAIT_WRITE_DONE);

// Write/Erase disable
FLASH_TxCmd(GENERIC_FLASH_CMD_WRDI, 0, nullptr);
Copy link
Member

Choose a reason for hiding this comment

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

Should we return SYSTEM_ERROR_NONE after this command?
It looks like execution will continue past the if (flash_init_para.FLASH_Id == FLASH_ID_GD) {} block and return ERROR NOT SUPPORTED?

hal/src/rtl872x/exflash_hal.cpp Outdated Show resolved Hide resolved
hal/src/rtl872x/exflash_hal.cpp Show resolved Hide resolved
}
});
memcpy(ptr, addrBuf, 3);
memcpy(ptr + 3, buf, size);
Copy link
Member

Choose a reason for hiding this comment

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

We need to allocate an intermediate buffer because the address bytes + data need to be contiguous when sent with FLASH_TxCmd()?
Does the data need to be in heap / PSRAM or not?

hal/src/rtl872x/exflash_hal.cpp Outdated Show resolved Hide resolved
hal/src/rtl872x/exflash_hal.cpp Outdated Show resolved Hide resolved
RTK_SPIC_DATA_WORD = 2
};

static void rtkSpiFlashSetDataReg(uint32_t index, uint32_t data, enum RtkSpicFlashDataWidth byteWidth) {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: instead of static might be better to just move to an anonymous namespace.

@XuGuohui XuGuohui merged commit 1110463 into develop Oct 12, 2023
13 checks passed
@XuGuohui XuGuohui deleted the feature/rw-gd-16mb-otp branch October 12, 2023 14:41
technobly pushed a commit that referenced this pull request Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants