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.

question about using MAD on linux kernel

Hi, all:
  I succeeded in running the MAD's (Multiple Application Deployment) examples
on our board. The two apps (app_1 & app_2) can now run on the 8 cores of 6678.
Now I tried to run linux on core0 and SYS/BIOS app on the other 7 cores, so
I copied the linux relevant files (vmlinux or vmlinux.bin) to the app_1\build
directory, and run the following command:
python maptool.py  config-files/maptoolCfg_C6678_bypass_prelink.json bypass-prelink
but this can't work, the following error appears:
(when using vmlinux)
MAP tool executing in prelink bypass mode
error: Non-TI vendor  used to create file ./images/appImages/app1 is not
   supported by this tool.

error: failed to read "./tmp/strippedImages/app1.strip"
Traceback (most recent call last):
  File "maptool.py", line 2688, in <module>
    if a.processElf(globalLibList) != 0:
  File "maptool.py", line 1538, in processElf
    if self.elfFile.parse() != 0:
  File "maptool.py", line 2285, in parse
    eHdr = elfHdr(int(e_phnum, 16), int(e_shnum, 16))
UnboundLocalError: local variable 'e_phnum' referenced before assignment

(
when using vmlinux.bin which is created by the following command:
c6x-uclinux-objcopy -O binary ../product/vmlinux-shore ../product/vmlinux.bin
)
MAP tool executing in prelink bypass mode
error: errors occurred while reading ./images/appImages/app1

error: failed to read "./tmp/strippedImages/app1.strip"
Traceback (most recent call last):
  File "maptool.py", line 2688, in <module>
    if a.processElf(globalLibList) != 0:
  File "maptool.py", line 1538, in processElf
    if self.elfFile.parse() != 0:
  File "maptool.py", line 2285, in parse
    eHdr = elfHdr(int(e_phnum, 16), int(e_shnum, 16))
UnboundLocalError: local variable 'e_phnum' referenced before assignment

In the 1st case, the python reports that it can't process the linux kernel file by
printing "Non-TI vendor  used to create file", how to overcome it?

It seems the MAD-utils can't directly support the linux kernel file to be combined
with the bios program. Can anyone give some advice on this problem?
the following is my deployment_template_C6678_bypass_prelink.json file:

{
 "deviceName" : "C6678",
 
 "partitions" : [
  {
   "name"   : "load-partition",
   "vaddr"   : "0x9e000000",
   "size"   : "0x2000000",
   "loadPartition" : true
  }
 ],
 
 "applications" : [
  {
   "name"    : "app1",
   "fileName"       : "../mad-loader/examples/app_1/build/vmlinux.bin",
   "allowedCores"   : [0,1,2,3,4,5,6,7]
  },
  {
   "name"    : "app2",
   "fileName"       : "../mad-loader/examples/app_2/build/app_2.exe",
   "allowedCores"   : [0,1,2,3,4,5,6,7]
  }

 ],
 
 "appDeployment" : [
  "app1",
  "app2",
  "",
  "",
  "",
  "",
  "",
  ""  
 ]
}

  • Hi Murat,

    Is it possible for you to convert the vmlinux.bin to .elf and try it with MAD?

    I have not tried such configurations with MAD tool. Please check weather below link helps to solve the issue?

    Thank you.

  • Thanks, Raja:

      Thanks for your reply.

      The JSON file I posted in the first post use the "vmlinux.bin". In fact, I also tried the "vmlinux" file.

    (the "vmlinux" format is ELF). Then the python reports the error:

    MAP tool executing in prelink bypass mode
    error: Non-TI vendor  used to create file ./images/appImages/app1 is not
       supported by this tool.

    error: failed to read "./tmp/strippedImages/app1.strip"
    Traceback (most recent call last):
      File "maptool.py", line 2688, in <module>
        if a.processElf(globalLibList) != 0:
      File "maptool.py", line 1538, in processElf
        if self.elfFile.parse() != 0:
      File "maptool.py", line 2285, in parse
        eHdr = elfHdr(int(e_phnum, 16), int(e_shnum, 16))
    UnboundLocalError: local variable 'e_phnum' referenced before assignment

    I think the "vmlinux" is already an ELF format file which is generated by kernel compiler, so I don't have to covert

    the "vmlinux.bin" which is generated based on "vmlinux" using the following command:

    c6x-uclinux-objcopy -O binary ../product/vmlinux ../product/vmlinux.bin

    The log shown above says the "vmlinux" is "Non-TI vendor  used to create file".

    How can I remove this error?

    Thanks!

  • The MAD utilities expects image to be created using C6000 compiler tools is the Linux uImage that you are using also been built using TI compiler?

    Also is there a map file you can provide for the uImage binary.

    Thank you.
  • Hi, Raja:
    I also noticed that TI's compiler program can't recognize my linux kernel, although
    my linux kernel file is an ELF file. The linux kernel file is generated by gcc compiler.

    In more detail, when running belowing program:
     #!/bin/sh strip6x -o=./tmp/strippedImages/app1.strip ./images/appImages/app1
    the "strip6x" will report the following error:
    error: Non-TI vendor  used to create file ./images/appImages/app1 is not
       supported by this tool.

    Now I plan to modify my linux kernel file, just some bytes. I think the TI compiler
    "strip6x" will read some bytes of the linux kernel file to judge if it is the bins
    created by TI compiler. So if I change only some bytes, the "strip6x" will be cheated
    and will think the kernel file is a normal TI ELF file. So can I get some ELF infomation
    about TI's format? Then I can manage to change my linux kernel file.

    Again, thanks for patient reply, Raja.
    Regards.

  • Hi, Murat,

    MAD utility wasn't developed to run on Linux. It meant for multi-DSP cores. Linux-c6x (embedded linux on C66x) uses mcoreloader to load executable onto DSP cores. There are examples in "syslink for c6x" in the ecosystem page of linux-c6x.org which load the prebuilt executable to DSP cores and send messages between Linux and DSP cores on C6678.

    The Ecosystem page: http://linux-c6x.org/wiki/index.php/Software_Ecosystem_Features

    You can take a look at the script file in linux-c6x-project/scripts/syslink/procmgr_load_notifyapp_8_core.sh after you clone the linux-c6x project following instructions in linux-c6x.org.

    Rex

  • Hi Murat,
    Please check the instructions posted by Rex helps to solve the issue.

    Hi Rex,
    Thank you very much for your input.
  • Hi, Raja & Rex:
    I succeeded in using mcoreloader to load a small app into core 1, and this app
    works.
    I'll read through the portions that Rex gave.
    Thanks!
  • Thank you for the update.