dts/st: enables possibility to define Flash and SRAM out of tree
dts/st: enables possibility to define Flash and SRAM out of tree

In case of out of tree SoC, mem.h will trigger and error since
it is not aware of new SoC CONFIG_SOC_<reference>.
Modify error condition in order to generate the error only if
the flash and error size are not defined at this point (even in
out of tree case).

Fixes #9978

Signed-off-by: Erwan Gouriou <de4d967452b83bb0e37525652734e7d9163b6a4c@linaro.org>

kraj/zephyr,punitvara/zephyr,GiulianoFranchetto/zephyr,finikorg/zephyr,kraj/zephyr,galak/zephyr,punitvara/zephyr,nashif/zephyr,galak/zephyr,galak/zephyr,GiulianoFranchetto/zephyr,finikorg/zephyr,Vudentz/zephyr,kraj/zephyr,nashif/zephyr,ldts/zephyr,explora26/zephyr,Vudentz/zephyr,GiulianoFranchetto/zephyr,kraj/zephyr,explora26/zephyr,GiulianoFranchetto/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,Vudentz/zephyr,ldts/zephyr,nashif/zephyr,finikorg/zephyr,Vudentz/zephyr,explora26/zephyr,galak/zephyr,punitvara/zephyr,punitvara/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,ldts/zephyr,Vudentz/zephyr,explora26/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,punitvara/zephyr,explora26/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,kraj/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,finikorg/zephyr