
Hi Fabio,
On 30.11.18 11:58, Fabio Estevam wrote:
On Fri, Nov 30, 2018 at 8:29 AM Stefan Roese sr@denx.de wrote:
-#define CONFIG_ENV_OFFSET (8 * SZ_64K) +#define CONFIG_ENV_OFFSET (12 * SZ_64K)
I find this hard to read: (12 * SZ_64K). Wouldn't (768 * SZ_1K) be better?
Yes, this is a good idea, but it does not work in conjunction with your suggestion below.
And I found using CONFIG_BOARD_SIZE_LIMIT quite handy, as it detects such increased image growths beyond its limit upon build time. Perhaps you could add this as well? This should do it for this board:
#define CONFIG_BOARD_SIZE_LIMIT CONFIG_ENV_OFFSET
Thanks for this suggestion.
I was not aware of CONFIG_BOARD_SIZE_LIMIT, which is very helpful!
Yes, I also only found out about this a few months ago. Always something new to learn... ;)
The only issue I see with this approach is that it does not accept expressions like (768 * SZ_1K):
SYM u-boot.sym /bin/sh: 1: printf: (768 * SZ_1K): expected numeric value u-boot-nodtb.bin exceeds file size limit: limit: 0 bytes actual: 482952 bytes excess: 482952 bytes Makefile:1040: recipe for target 'u-boot-nodtb.bin' failed
So I will hardcode CONFIG_ENV_OFFSET and use CONFIG_BOARD_SIZE_LIMIT:
#define CONFIG_ENV_OFFSET 786432 /* Detect overlap between U-Boot image and environment area in build-time */ #define CONFIG_BOARD_SIZE_LIMIT CONFIG_ENV_OFFSET
IMHO it is better to get an error in build time when U-Boot and env area overlaps than providing a pretty CONFIG_ENV_OFFSET format :-)
I agree. I'm using hex values like this 0x80000, which look better to my eyes (personal taste). Perhaps the Makefile logic handling BOARD_LIMIT_SIZE can be improved to support other expressions as well.
Thanks, Stefan