anakyr wrote:I am using ESP-WROOM-32D module on the devkitc. I see that the module has a 40 MHz crystal.
Then how can I verify what you say about the internal bus clock? Where is that located? Isn't that derived from the CPU's clock as well?
Actually, I said a bit of bullsh*t above. The APB_CLK the SPI periferial is using is actually derived from the CPU clock.
(Technical reference manual, top of page 40).
APB_CLK is 80MHz, and SPI max clock is APBfreq/2, so 40MHz, with all other deviders set to default state.
Are you 100% sure that you in fact have a 26MHz clock on the module?
By default in Menuconfig you select 40MHz clock, which tells the rest of IDF that you run a 40MHz CPU, which will use it in it's calculations as reference, even though you may be having a different clock!
By setting 40MHz, it means - i guess - that almost all the clock deivders are set to their default state - eg. no clock devision - so it should be 40MHz coming out. Having no devision and 26MHz coming out suggest to me that in fact you have a 26MHz crystal on your module.
Maybe I'm wrong, but it's woth trying to work with clock register settings. (TRM Page 132 SPI_CLOCK_REG)
You can also try to use the formula on Page 121, to calculate the register values needed for 26MHz clock, and then read out the registers, to see if register settings are the same as you calculated.