TFM_PROFILE_TYPE

I've just spent about 4 hours trying to figure out why a particular build was failing (on nrf9151dk).

Examing the cryptic errors finally revealed that the TFM partition size was not large enough by a few percent (and only when the build configuration is optimised for debug). Removing the debug optimisation fixes it. But thing is I want the debug on. 

The interesting part of this is that I am integrating onomondo's softsim, which actually sets the partition size to 0xC000. So, I set about increasing it to 0xD000. But nothing I did chagned it.   At least one hour spent trying to ascertain if this was a consequence of overlay presedence, given  that the onomondo overlay is added though CMake. So I created my own custom overlay, and added a board specific guard in cmake to add that - the idea being to increase the partition size there. But no matter what I tried, it does not change. Turns out another benign sounding setting in the onomoondo overlay setting the TFM_PROFILE_TYPE_NOT_SET=y has the effect of enabling minimal, and changing the size is not possible. 

Could you please explain how this all is supposed to work. It's clear that neither me nor onomondo's team have the foggiest notion what is going on. 

Note I 'm working in nrf9151, sdk 3.2.3. I think onomondo were working at 3.1.1, and there may be some changes since then that break their code. 

Regards. 

Related