U-Boot crash when loading larger binaries into Cortex-M7 ITCM

  • When attempting to load a binary of roughly ~80kb (still well below 128kb) onto the Cortex-M7 core at address 0x7e0000 from U-Boot, an error along the lines of the following occurs


    The error occurs when running cp.b ${loadaddr} 0x7e0000 80000 after having loaded the binary from mmc 2:2 into ${loadaddr} with ext4load


    I can circumvent the error initially by loading the binary in chunks with the following:

    Code
    1. setenv chunks 'setexpr chunks ${m7image_size} / ${chunk_size}; if test ${m7image_size} % ${chunk_size}; then setexpr chunks ${chunks} + 1; fi'
    2. setenv copy_chunks 'for chunk in ${chunks}; do setexpr offset ${chunk} * ${chunk_size}; cp.b ${loadaddr}+${offset} 0x7e0000+${offset} ${chunk_size}; done'

    Although this does not appear to solve the problem, as nothing seems to happen after running bootaux 0x7e0000.


    PicoCoreMX8MPr2 Rev 1.10

    U-Boot SPL 2021.04-nboot-fsimx8mp-2023.09


  • Hello,


    any special reason you give the size value of the binary not as a hex value? I think the cp command interprets always as hex so 0x80000 would be far to much for the ITCM


    Please try the following

    cp.b ${loadaddr} 0x7e0000 0x13880


    Also, after using the load command, the environment variable $filesize is automatically set to the filesize loaded in hex. So you could also run


    cp.b ${loadaddr} 0x7e0000 ${filesize}


    Your F&S Support Team