fix(esp8266): Use custom flash config due to different ROM implementation#75
fix(esp8266): Use custom flash config due to different ROM implementation#75
Conversation
…tion ESP8266 contains g_rom_flashchip, but it is in different order than esp_rom_spiflash_chip_t, esp_rom_spiflash_config_param might take also different order of parameters but due to missing possibility to check in ROM code custom implementation seems like okay solution preventing possible future issues.
👋 Hello Dzarda7, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
There was a problem hiding this comment.
Pull request overview
Adjusts ESP8266 flash configuration handling to avoid relying on ROM structs/functions whose field/parameter ordering may not match esp_rom_spiflash_chip_t.
Changes:
- Replaces the ESP8266 ROM
g_rom_flashchipusage with a custom in-RAMesp_rom_spiflash_chip_tinstance. - Adds an ESP8266-specific
stub_target_flash_update_config()implementation that updates the custom struct. - Marks the common
stub_target_flash_update_config()asweakso targets can override it.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/target/esp8266/src/flash.c | Introduces a custom flashchip config struct and overrides config update/getter for ESP8266. |
| src/target/common/src/flash.c | Makes the default stub_target_flash_update_config() weak to allow per-target overrides. |
erhankur
left a comment
There was a problem hiding this comment.
Thanks for the fix. Is this because I removed macros and forced client codes to get flash params from config?
Yes, I then had to use |
|
FYI @radimkarnis |
ESP8266 contains g_rom_flashchip, but it is in different order than esp_rom_spiflash_chip_t, esp_rom_spiflash_config_param might take also different order of parameters but due to missing possibility to check in ROM code custom implementation seems like okay solution preventing possible future issues.
Description
Related
Testing
Checklist
Before submitting a Pull Request, please ensure the following: