Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHi LiangYi,
The u-boot memory layout for the PK1C20 board is as follows: +--------------------+ (Top of SDRAM) | | u-boot code (256 KB = CFG_MONITOR_LEN) | +--------------------+ <== CFG_MONITOR_BASE, TEXT_BASE | | heap (128 KB = CFG_MALLOC_LEN) | +--------------------+ <== CFG_MALLOC_BASE | | global data (128 B = CFG_GBL_DATA_SIZE) | +--------------------+ <== CFG_GLB_DATA_OFFSET, CFG_INIT_SP | | STACK (Grows down) | The heap includes room for the ram-based environment (which is dynamically allocated) and copied from flash at startup. > And How to set them in nios2 system? Typically the monitor length is set to some value (2**n) that is larger than the u-boot memory footprint. In this case 256 KB ... which is almost twice what is required (depending on which features are configured in u-boot). The heap can be set to whatever value you like (subject to your actual memory resources). If you add your own commands and require a large heap, you can increase this. Many boards set this to 128 KB -- a good empirical starting point. Set the global data area to 128 -- the global data area is currently less than this ... and is very unlikely to change. The stack simply grows downward -- so it's a bad idea to tftpboot or loadb into memory just under the u-boot text ;-) The macros (which I agree are not the most readable) are set up so the size of the memory regions can be easily changed ... without changing the relative layout. Regards, --Scott