Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

Fix pre-SDK Cache_Read_Enable for PUYA flash

Open mhightower83 opened this issue 3 years ago • 2 comments

This resolves the exception 0 issue with PUYA flash during the pre-SDK context. This Issue showed when using flash/ICACHE for umm_init and/or using HWDT Stack Dump .

The SPI_CS_SETUP parameter has been observed set in RTOS SDK and NONOS SDK as part of flash init/configuration. It may be necessary for some flash chips to perform correctly. Turning on and leaving it on should be okay.

phy_get_bb_evm is the key function, called from fix_cache_bug in the NONOS SDK. This addition resolves the exception 0 issue with PUYA Flash when early Cache_Read_Enable is used.

Changed umm_init back to default in IRAM. Define UMM_INIT_USE_ICACHE to move umm_init to flash and free up IRAM. For the non-debug build, it frees 136 bytes of IRAM while increasing IROM by 224 bytes.

Resolves https://github.com/esp8266/Arduino/issues/8657#issue-1338167822 (has PUYA flash)

Unable to recreate the problem with the PUYA P25Q80H flash chip on ESP-01S.

Updated to summarize current PR.

mhightower83 avatar Aug 20 '22 18:08 mhightower83

Per testing, is this still a draft ?

d-a-v avatar Sep 13 '22 13:09 d-a-v

The approach has been tested; however, this PR with the approach has not been verified. Otherwise, it is ready.

Also for umm_init, do you agree with the change back to using IRAM as default and ICACHE requiring the override?

mhightower83 avatar Sep 13 '22 14:09 mhightower83