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.

MAD Utils for User Application

Hi,

I am working on MAD Utilities for 6678 EVM. I have done with the example. Now I am trying to load an application downloaded from net to demonstrate the multicore loading. I have created the ".out" for the application and also tested the application by porting on all 8 cores. The output on console is as follows

[C66xx_0] Core 0 start...
[C66xx_0] Core 0: master go...
[C66xx_0] Core 0 terminate
[C66xx_1] Core 1 start...
[C66xx_1] Core 1 wait...
[C66xx_1] Core 1: sum(a)=4950
[C66xx_1] Core 1 terminate
.......
[C66xx_7] Core 7 start...
[C66xx_7] Core 7 wait...
[C66xx_7] Core 7: sum(a)=5550
[C66xx_7] Core 7 terminate


I executed the python script in bypass-prelink mode and created the image c6678-le.bin for the application and flashed into NAND. I made the dip switches to boot from NAND.
The IBL is fetching the entry point from the NAND but the application is not getting executed as I couldn't observe any output on the terminal.

3404.Project.rar


  • Can we run this in individual cores. I want you to try with only one core and MAD utilities and see if you can execute. Please let me know what you get.

    Thanks,

    Arun.

  • Hi Senthil,

    I took a look at the code you provided and it looks like you are printing to the CCS terminal. This would not work with MAD since you are booting off NAND and not using CCS debug. The basic printf you are using will require the emulator to be connected to the cores.

    I would suggest you to print messages via UART instead. Our platform library has a set of tools for printing out messages via UART that you can override the basic printf function with. Please take a look at the platform library in the pdk_C6678_w_x_y_z/packages/ti/platform/evmc6678l folder.

    Would you also let us know what version of MCSDK and C6000 Code Generation Tools you are working with? We can help you further debug the MAD tool once you have UART communication set up.

    -Ivan

  • Hi,

    I have modified the project by including the platform libs to print messages to UART. But still i didn't get any messages on UART or console. I have tested by loading on Core 0 alone. But still i couldn't confirm it has executed. From Memory browser I could only observe Mad app is loaded on addr 0x9e000000 which is configured as VADDR in configuration file.
    I have tested the .out by loading through CCS it is working as expected on all cores.

    MCSDK Version: mcsdk_2_00_06_18
    Compilation : MINGW32, C6000 (TI Compiler)

    With Regards,

    Senthil G

    0116.Mod_Project.zip

  • Senthil,

    Great! With UART messages, we can see if the application is loaded correctly via MAD. I took a look at your updated files, and your project and json files look good to me. I tested your c6678-le.bin and it caused my EVM to hang. The good news is that I remade the .bin file using the latest set of tools on my system and I was able to see "Hello World.." on my UART terminal.

    I am using BIOS-MCSDK 2.1.0.3, C6000 Code Generation Tools 7.4.1, and Python 2.7.3. Would you mind trying again with this set of tools? There were some updates to the MAD tool with the CGT change. I will retest with your set of tools to see if I can recreate the error.

    -Ivan

  • Senthil,

    Update: after some digging and experiments, I believe the root cause is the compiler change. This is a bug in BIOS-MCSDK 2.0.6.18, which is the first BIOS-MCSDK version to advertise the use of CGT 7.3.1. I was able to use your .out and .json files to generate a working .bin file after I recompiled the MAD loader tools (mal_app.exe and nml.exe) with CGT 7.2.4. The newer compilers had some updates to optimization and mapping, which caused errors in this version of MAD util. This is caught and fixed in later BIOS-MCSDK versions.

    Instead of grabbing the old compiler, I would suggest you to move to our latest set of tools. Please refer to this download page: http://software-dl.ti.com/sdoemb/sdoemb_public_sw/bios_mcsdk/latest/index_FDS.html

    Let me know if this works.

    -Ivan

  • Hi Ivan,

    It's nice to hear from you the application is working fine at your end with updated tools.  

    I have taken the MAD-Utils from the MCSDK 2.1.0.2 and created "mal_app.exe" and "nml.exe" by using CGT 7.4.1. I used Python 2.7.3 to create c6678-le.bin for the hello.out. I am using the IBL compiled with mcsdk_2_00_06_18. After doing all this i couldn't get the application loaded and execute.

    Could you share me the  "mal_app.exe", "nml.exe", Hello.out and C6678-le.bin you experimented to get application working. This will helpful for me to trace out where i am making the mistake.

    Thanks

    Senthil Kumar

  • Hi Senthil,

    I have attached the files I used.

    Can you try loading your .bin file in CCS to see if it works? Follow section 3.4 in the MAD Utils User Guide: http://processors.wiki.ti.com/index.php/MAD_Utils_User_Guide

    If it does not work, then the MAD image is not created properly (assuming the Hello.out works).

    Let me know your progress on this.

    -Ivan

    7457.mad_hello_example.zip

  • Hi Ivan,

    I did as you said. I loaded the .bin and executed by changing the PC. Able to see "Hello World .." message on uart. So the image is working right.

    The Hello.out too tested and its working fine.

    The same image burnt to Nand and boot the IBL to execute the Nand image its not working.

    Thanks

    Senthil Kumar

  • Senthil,

    That is a good sign. We can isolate the problem to the IBL NAND boot. Here is a small checklist to double-check:

    1. Did you remember to configure the IBL nandBoot settings? bootFormat should be ibl_BOOT_FORMAT_BBLOB, startAddress should be 0x9E000000, and branchAddress should be 0x9E001040. 
    2. Do you see any UART messages? IBL should give some information should as version # or "Booting from NAND..." etc.
    3. Are you able to connect to core 0 after a failed NAND boot? If so, check where in memory it is.
    Lastly, I would recommend you to use the IBL from our latest release. There has been some updates since the one from BIOS-MCSDK 2.0.6.18. I have also tested the image on NAND boot with the latest IBL:
    Let me know if this helps. We can debug the NAND boot if you are still unable to boot.
    -Ivan
  • Hi Ivan,

    I kept IBL image same and burnt the .bin image you shared with us. Then i can able to see the application is up and printing "Hello World .." on Uart. Then i used mad-utils folder you shared with us (Version 01.00.01.01). With this i have created my image and burnt into Nand. Application is up and executed on Core-0 and printed "Hello World .." on Uart.

    So, now the Mad-utils version made the difference. Thanks for sorting out the issue.

    Now, i have modified the Hello.c to print messages from all cores and burnt into Nand. But it is able to print only from Core-0 and remaining cores keep looping in "platform_uart_write" function. I have ensured application on all cores are up and executing by removing print messages.

    I have tested hello.out using CCS, the application on all cores are able to print messages on Uart. This happens only when i added some delay in form of for loop while printing messages on Uart. But same application burnt into Nand it is not able print messages on Uart except core-0.

    Uart is shared between all cores. I ensured the uart is accessed one by one.

    3223.Project.zip

    With Regards

    Senthil Kumar

  • Hi Senthil,

    Good to know that the MAD image flashing and booting is okay.

    I took a look at your new code and ran it on CCS on my system. I un-commented the prints for all cores, but only core 0 prints to UART. This could be due to the fact that "platform_uart_write" is not multicore safe - multiple cores cannot access the UART at the same time. I see in your code you did try to ensure access one-by-one, but I am not 100% certain that works.

    One thing I can recommend is putting semaphore locks between prints. Take a look at our CSL layer, specifically csl_semAux.h for CSL_semAcquireDirect and CSL_semReleaseSemaphore. 

    I will have to spend some time to take a closer look at your code. In the meantime, you may want to start a different thread to discuss further on multicore programming. It will be hard to debug the MAD image before we have a multicore-safe application ready.

    -Ivan

  • Hi,
    This is Nithin. I am working on mad utilities. I was able to use image processing demo and regenerate .bin file using bypass prelink json file and was able to see the results (ip address) on UART terminal. I followed inputs from this link and was able to generate .bin file for helloworld using bypass prelink json file . This bin also displayed helloworld in uart terminal. But I have used application in only one core. Now when I loaded application in multiple cores, the bin file was generated but it could not display any results in UART terminal. How to display helloworld from different cores. Have you been able to boot the helloworld application from multiple cores?

    Thanks and Regards, Nithin B