Skip to content

Conversation

maribu
Copy link
Member

@maribu maribu commented Nov 6, 2021

Contribution description

As the title says.

Testing procedure

This should make sure that the buffer never gets allocated at an address not suitable for 32 bit reads / writes, which I believe would have cause hard faults on Xtensa.

Issues/PRs references

Split out of #14955

@maribu maribu requested a review from gschorcht as a code owner November 6, 2021 19:09
@maribu maribu added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Nov 6, 2021
@github-actions github-actions bot added the Area: cpu Area: CPU/MCU ports label Nov 6, 2021
@kaspar030 kaspar030 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Nov 6, 2021
@@ -269,7 +269,7 @@ esp_err_t IRAM_ATTR spi_flash_read(size_t addr, void *buff, size_t size)
critical_enter();
Cache_Read_Disable(PRO_CPU_NUM);

result |= esp_rom_spiflash_read (addr, (uint32_t*)_flash_buf, len_full_words);
result |= esp_rom_spiflash_read (addr, _flash_buf, len_full_words);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
result |= esp_rom_spiflash_read (addr, _flash_buf, len_full_words);
result |= esp_rom_spiflash_read(addr, _flash_buf, len_full_words);

@gschorcht
Copy link
Contributor

Works as expected. Tested on esp32-wroom-32 with examples/filesystem and module spiffs as well as tests/pkg_littlefs and tests/pkg_spiffs with CFLAGS='-DCONFIG_USE_HARDWARE_MTD'.

@maribu maribu force-pushed the cpu/esp_common/periph_flashpage branch from 695e3ec to cb6525b Compare November 7, 2021 21:06
@maribu maribu merged commit 73fc2c2 into RIOT-OS:master Nov 8, 2021
@maribu
Copy link
Member Author

maribu commented Nov 8, 2021

Thx! :-)

@maribu maribu deleted the cpu/esp_common/periph_flashpage branch November 8, 2021 09:49
@fjmolinas fjmolinas added this to the Release 2022.01 milestone Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants