Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By mvdbro
#30100 Is there a way to determine the chosen flash size so you can use it as a compiler directive in the code?

Something like:

#if (ESP_FLASH_SIZE > 512)
< include extra goodies that will not fit the smaller versions...>
#endif
User avatar
By mvdbro
#30118 Ok, so that would mean that we have to provide our 'users' with a custom platform.txt file. Would probably raise more issues than we try to solve...

Can we make a feature request for this, so this will be maintained at the right place?
User avatar
By martinayotte
#30122 I don't think it can become a priority for IGRR and other maintainers, since it has not been requested before.
But it should not be too risky to add it in platform.txt, especially if you do it yourself and do proper testing, since it is only adding a define nearby F_CPU such as :

Code: Select all-DF_CPU={build.f_cpu} -DESP_FLASH_SIZE={build.flash_size}


But be aware that the vulue of {build.flash_size} has currently some suffixes : 512K, 1M, 4M, so "greater than", like in your example, comparisons won't work ...