What should I do if the Preloader bin size is too large to report an error? preloadersize
Because more emcp, mcp, and discrete dram are required, and modifications to the preloader code due to new requirements may increase the preloader bin size, in this case, a build error may occur in the build preloader phase, and the following error message will be reported in the log: ================================== Building Fail ========================== =========== img rom Size: 101340 bytes> 100828 bytes !! WARNING: Reduce your code size first then compile again !! ========================================================== ====================== The above error log is reported by the mediatek/platform // preloader/check_size.sh script, the script compares the values of the built preloader bin and PL_MAX_ROM_SIZE. If the build preloader bin size exceeds this value, an error is reported. You will find that this value is usually set very small and will not exceed kb. Maybe you are wondering why the limit is so small. Please refer to the description in [SOLUTION. The value of PL_MAX_ROM_SIZE is relatively small because the external dram has not been initialized at startup, BROM will take the preloader bin from flash (emmc or nand) as a whole) load to the shared sram in chip. Because the size of shared sram in chip is usually very small, the typical size is 128KB (MT6572/71/82/92, etc.), MT6595 is 256KB, therefore, the size of preloader bin cannot exceed the size of internal shared sram. At the same time, we also need to deduct the ram space occupied by Header, GFH, rum time BSS segments, and stack, and leave the space reserved for the real preloader bin to be smaller than the internal shared sram size. Therefore, when the preloader bin size is too large, do not increase the value of PL_MAX_ROM_SIZE by yourself. Although this can be done through build, it may cause strange problems such as failure to boot, and it is not easy to debug. For the JB version, the only solution is to strictly control the number of compatible emcp, mcp, and discrete dram, and avoid adding new feature to the preloader, if you want to customize the new feature, it is recommended to move it to lk for implementation. For related FAQs, see "[FAQ07839] [Storage] compatible Number of eMMC and NAND Flash" for the KK version, the Preloader adds support for LPDDR3, therefore, default may not be able to configure 10 Gbit/s compatible mcp/emcp/discrete dram. You need to modify the code according to the following statement, and reduce the size used by the debug code generator. * For MT6589/72/71 platforms, modify the alps \ mediatek \ platform \ $ PLATFORM \ preloader \ src \ drivers \ inc \ mt_pmic_wrap_init.h file * MT6582/92 platforms, modify the code in the alps \ mediatek \ platform \ $ PLATFORM \ preloader \ src \ drivers \ inc \ pmic_wrap_init.h file in the same way: (1) # define PMIC_WRAP_DEBUG // comment out this line (2) # define PWRAPERR (fmt, arg ...) printf (PWRAPTAG "ERROR, line = % d" fmt, _ LINE __, # arg) to: # define PWRAPERR (fmt, arg ...) printf (PWRAPTAG "ERROR, line = % d ", _ LINE _) In addition, the check_size.sh script of JB3.MP MT6572 has a bug, and the size check mechanism will fail. If you find that PL_MAX_ROM_SIZE is defined in this script as follows, therefore, you do not need to apply for the patch from e-service. # Keep ROM size smaller than 90KB PL_MAX_ROM_SIZE = (95*1024)