This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Multiple BUGS in MAD loader

Hello.
Your code in mcsdk_2_01_02_06/tools/boot_loader/mad-utils/mad-loader/mal/malLib/malApis/mal_lib_file_utils.c
have huge bug.

If I have deloyment.json for 8 cores with this config for each:
        {
            "name"             : "coreN",
            "fileName"       : "core_N.out",
            "allowedCores"   : [0,1,2,3,4,5,6,7]
        }

than I have 8 entries for all cores in your romfs, with 8 "arCore0cor" for each core. It's 72 in total.
Plus 5 items for ".", "..", "nml", "mal_app" and "appdep". It's 77 in total.

But you make #define MAX_FILENODES    50
and mal_app exit by error from mal_lib_file_utils.c:248     if (next_node_idx == MAX_FILENODES)         return -20;

What the *** is that? Did you hear something about dynamic memory allocation?
Why romfs contain all 64 entries if no more than 8 can be in use??


  • Hi Alex,

    I do not understand your question however we don't need 8 entries for each core. Please refer deployment_template_C6678.json file available in MCSDK(..\mcsdk_2_01_02_06\tools\boot_loader\mad-utils\map-tool\config-files).

    "applications" : [
    
    {
    
    "name" : "app1",
    
    "fileName"       : "../mad-loader/examples/app_1/build/app_1.exe",
    
    "libPath"        : "../mad-loader/examples/shlibs/build",
    
    "allowedCores"   : [0,1,2,3,4,5,6,7]
    
    },
    
    {
    
    "name" : "app2",
    
    "fileName"       : "../mad-loader/examples/app_2/build/app_2.exe",
    
    "libPath"        : "../mad-loader/examples/shlibs/build",
    
    "allowedCores"   : [0,1,2,3,4,5,6,7]
    
    }
    
    ],
    
    "appDeployment" : [
    
    "app1",
    
    "app2",
    
    "app1",
    
    "app2",
    
    "app1",
    
    "app2",
    
    "app1",
    
    "app2"
    
    ]
    


    Thank you.

  • Raja said:
    "allowedCores" : [0,1,2,3,4,5,6,7]


    THIS IS 8 ACTIVATION RECORDS FOR EACH CORE

  • Hi Alex,

    By any chance you browsed through, processors.wiki.ti.com/.../MAD_Utils_User_Guide

    Not an expert in this utitlity but thought of pointing you this link.

    --
  • Shankari G said:
    Hi Alex,
    By any chance you browsed through, processors.wiki.ti.com/.../MAD_Utils_User_Guide
    Not an expert in this utitlity but thought of pointing you this link.

    I told that code have a bug, but you send me to User Guide. Are you ok?
    So which of you is expert in this code and must to support it??

    MCSDK has wrong example, and it's work only with 2 cores!!
    Yet one error, for example, in maptool.py:

    ----------------------------------------------------------
    maptool.py:547
    def genArRecords(aList, coreList, fsDir, dev, loadImageFs, bypassPrelink):
    	__arFileList = []
    	for a in aList:
    		coreSet = a.getAllowedCoreSet()             # = a.allowedCores
    		for c in coreSet:                           # each c in a.allowedCores
    			__arCmdList = []
    			__arCmdListBin = []
    			__CoreArCmdList = []
    			__CoreArCmdListBin = []
    			__AppArCmdList = []
    			__AppArCmdListBin = []
    			if bypassPrelink:
    				# Generate APP specific activation record
    				(__AppArCmd, __AppArCmdBin) = a.genAr(c, loadImageFs)
    ----------------------------------------------------------
    maptool.py:1621
    	def genAr(self, coreId, fsObj):
    		appName = self.getName()
    		if self.isCoreAllowed(coreId) != True:                              # if c in a.allowedCores
    			print 'application:', self.name, 'can not run on core', coreId  # UNREACHEABLE CODE, WRONG LOGIC
    			return (None, None)                                             # UNREACHEABLE CODE, WRONG LOGIC
    ------------------------------------------------------------
    maptool.py:1569
    	def isCoreAllowed(self, core):
    		if core in self.allowedCores:
    			return True
    		else:
    			return False
    

  • Hi Alex,

    Apologize for the delay.

    I am working on to re-produce the issue reported. Please provide below information,

    1. Is this prelink bypass mode or prelinker mode? 

    2. Is this issue observed with an example included in MCSDK or is the custom application project  deploy across 8 cores.?

    3. If this is with custom application, provide the binary and map file to reproduce the issue. We need all files like deployment.json, .py which were modified by you and build instructions If this is an issue specific to the your application.

    I am working with factory team on malLib source and will get back to you as soon as hear back from them.

    Thank you for your patience.

  • 1. bypass-prelink mode
    2. this issue observed in unmodified maptool.py which have cfg file with strange settings and generates wrong mal_app.
    I gave you all necessary detailed info.
    I found workaround for this issue and don't want waste time on it anymore.
    Thanks for help.