-
Notifications
You must be signed in to change notification settings - Fork 121
fix(spi_nand_flash): fix nand flash issue caused by data length unalignment on esp32p4 #583
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
fix(spi_nand_flash): fix nand flash issue caused by data length unalignment on esp32p4 #583
Conversation
c6fe5f6 to
fec10df
Compare
|
|
fec10df to
61fff94
Compare
@mythbuster5 My bad! I hadn’t pushed the latest changes earlier — I’ve done it now. PTAL |
|
LGTM otherwise |
…gnment on esp32p4
f4e2b91 to
823795a
Compare
|
@RathiSonika please, provide more details in description (how did you find out, related issue reports if any, and other context). So far, the update looks reasonable |
|
Could you also explain how you test the fix? I don't see anything related in your test_app... |
If the length is not aligned, the SPI driver will trigger an assertion. This is generally handled by the esp_driver_spi. reference link to check how spi driver handles https://github.com/espressif/esp-idf/blob/master/components/esp_driver_spi/src/gpspi/spi_master.c#L1180 |
Ok, understand. Thanks |
pacucha42
left a comment
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.
Fix approved
Change description
When I tested NAND flash on the P4, I found that it was failing at the SPI driver level due to an RX length alignment issue. After reviewing esp_driver_spi, I noticed that SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE is enabled for the ESP32-P4, which requires data length alignment in addition to buffer alignment. I’m adding this fix to handle that requirement.
Adjusted the handling logic to ensure proper alignment, restoring correct flash operation.