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.

heap error when establishing messageQ

Other Parts Discussed in Thread: SYSBIOS

In my program on EVMC6678, I established the connection between core0 and core1 by messageQ

by using the simulator, I got successful result with console as follow:

_________________________

[C66xx_0] EVM_init
current_id= 0
[C66xx_1] status_slave_last= 0
slave enter slave_main()
[C66xx_0] status0_last= 0


MCSDK IMAGE PROCESSING DEMONSTRATION

QMSS successfully initialized
CPPI successfully initialized
PA successfully initialized
HeapBufMP_create_Handle=800009a8
MessageQ_registerHeap success
calloc=80001248
MessageQ_alloc=c302c80
MessageQ_alloc=c302d00

TCP/IP Stack 'bmp!' Application


TCP/IP Stack 'bmp!' Application

PASS successfully initialized
Ethernet subsystem successfully initialized
Ethernet eventId : 48 and vectId (Interrupt) : 7
Registration of the EMAC Successful, waiting for link up ..    *****
[C66xx_1] HeapBufMP_open=0
[C66xx_0] Network Added: If-1:192.168.2.100                 
receivemessage_all=800351b0                                 
length=sizeo(saClient)=16                                    
 MessageQ_create_0=8006d9b8                             
slave_queue_name=core1_queue                                  
[C66xx_1] HeapBufMP_open=90000988                             
HeapBufMP_open success
MessageQ_create1=900009f0
number=390
before messageQ_get1
[C66xx_0] MessageQ_open_0 success                     
socket_receivemessage=0x80034b40                       
&length=0x80034540                                   

_________________________

however, while running the project by SPI NOR BOOT, it always get error at the same point, with the console message as follow:

_________________________

[C66xx_1] status_slave_last= 0
slave enter slave_main()
[C66xx_0] status0_last= 0


MCSDK IMAGE PROCESSING DEMONSTRATION

QMSS successfully initialized
CPPI successfully initialized
PA successfully initialized
HeapBufMP_create_Handle=800009a8
MessageQ_registerHeap success
calloc=80001248
MessageQ_alloc=c302c80
MessageQ_alloc=c302d00

TCP/IP Stack 'bmp!' Application


TCP/IP Stack 'bmp!' Application

PASS successfully initialized
Ethernet subsystem successfully initialized
Ethernet eventId : 48 and vectId (Interrupt) : 7
ti.sysbios.heaps.HeapMem: line 307: out of memory: handle=0x10818510, size=1536
Error allocating memory for Rx data buffer
Error allocating Rx free descriptors
Rx setup failed
Error: Unable to register the EMAC
ti.sysbios.heaps.HeapMem: line 307: out of memory: handle=0x10818510, size=88
xdc.runtime.Error.raise: terminating execution
[C66xx_1] HeapBufMP_open=0

_________________________

here is my platform setting

____

var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0x8000000;
heapMemParams.sectionName = "systemHeapMaster";
Program.global.heap0 = HeapMem.create(heapMemParams);
Memory.defaultHeapInstance = Program.global.heap0;

Memory.defaultHeapSize = 0x1000000;
Program.heap = 0x1000000;

Program.sectMap["systemHeapMaster"]     = "DDR3";

____

the above is all the relative heap setting in the .cfg file of core0

since the project is modified based on the MCSDK demo, i can't get fully understand of all these settings

and the reason why the handle is at the address of L2SRAM

thank for the notice and help

  • Have you tried to modify/increase the heap memory the following parameter in *.cfg file ?
    heapMemParams.size = 0x8000000;


    In my program on EVMC6678, I established the connection between core0 and core1 by messageQ

    by using the simulator, I got successful result with console as follow:

    Simulator or emulator ?

    I presume that you succeed with emulator and not using simulator.


    Also, what are the steps and configurations you have done while creating booting binaries ?

    How did you configure the DDR3 (how much size) in your code ?
  • Hi user458229,

    Would you please let us know the steps you followed to convert the image processing demo into the bootable images and the steps followed to flash the images into SPI-NOR??
  • Hi, Shankari G

    I download a LED test demo from Chinese TI forum
    www.deyisupport.com/.../8065.aspx

    convert steps:
    it basically involves
    /hex6x.exe .out+.rmd -> .btbl
    /mergebtbl.exe .btbl *n -> .btbl
    /AddDdrTable6678.exe .btbl -> .i2c
    /b2i2c_ex.exe .i2c -> .ccs
    /qfparse.exe(romsparse.exe) ->
    /modify.exe .ccs -> .dat
    it finally comes out as .dat file.

    write step:
    I put .dat into(installed path)\mcsdk\tools\writer\nor\evmc6678l\bin
    modify .txt as follow:
    file_name = spirom_le.dat
    start_addr = 0x80000000
    and load it to memory before running the project

    modify SW3~SW6 to:1011 0000 0010 1000

    finally the LED project runs correctly.

    to use the method above to write the image processing demo( with RTSC or SYS/BIOS)
    I place the c_int00 in specific place in .cfg file:
    Program.sectMap[".myboot { boot.ae66< boot.oe66> (.text) }"] = "BOOT_CORE0";(BOOT_CORE0 is at 0x10800000 length = 0xc0)
    and copy the code of writing boot magic address and ipc interrupt

    as I test it on SPI mode, both cores can run to the beginning of main()
    int main(void)
    {
    volatile int flag = 1;
    while(flag){};
    ...
    }

    as I modify "flag" through emulator by "load symbol", the console come out as above

    .....after typing so much letters, I think it's not the boot problem :(

  • Hi Titusrathinaraj Stalin

    1.heapMemParams.size = 0x8000000 is already in my .cfg file
    2.Simulator or emulator ?
    emulator.... it's my mistake
    3.Also, what are the steps and configurations you have done while creating booting binaries ?
    same as my reply above
    4.How did you configure the DDR3 (how much size) in your code ?
    I can't understand the meaning of "configure"
    if you mean the address table, I've use the AddDdrTable6678.exe
    the setting about DDR in .cfg file of core0 is as follow:


    /* Create a Heap. */
    var heapMemParams = new HeapMem.Params();
    heapMemParams.size = 0x8000000;//0x8000000;
    heapMemParams.sectionName = "systemHeapMaster";
    Program.global.heap0 = HeapMem.create(heapMemParams);
    Memory.defaultHeapInstance = Program.global.heap0;

    Program.sectMap["systemHeapMaster"] = "DDR3";

    DDR3 is set on platform with 0x1000 0000 length
    setting in core1 is similar with it

  • Hi user,

    Looking at the steps you used to convert for flashing, not sure which user guide you followed.

    When I looked into the MCSDK userguide below, for Image processing demo, it gives different steps for converting into bootable binary using MAD utility.

    1. BiosMulticoreSDK_2.1_UserGuide.pdf under "~\ti\mcsdk_2_01_02_06\docs" or

    2.Would you please try those steps given in the userguide and get back to us on which step you were not able to pass through?? and plus the screenshots of them.

    Also, as an altenate suggestion, Would you please try increasing the size of the heap ?? and check once...

  • Hi, Shankari G
    my steps are similiar with this reply:
    e2e.ti.com/.../1608382
    and i have modified the .cfg file, so is it still useful to use the mad for img_processing demo?
    (In BiosMulticoreSDK_2.1_UserGuide.pdf I can only find some introduction of files, but not specific steps)
  • Hi Shihao Lee,

    As you are able to run the MCSDK image demonstration using emulator and facing problem only after flashing and booting the example, looping in Bootloader experts to look into it.

    Thanks for your patience,

    ------------
  • Hi Shihao Lee,

    I think, the error is due to DDR controller is not initialized. During the emulator booting, the gel file initializes the DDR controller and memory.

    Please have a look at the below SPI boot(DDR) example,

    /cfs-file/__key/communityserver-discussions-components-files/791/6153.1738.SPIboot_5F00_ddr.zip

    Thank you.

  • Hi Rajasekaran K,

    I think it is not the problem of initialization of DDR3

    First, I have tested the LED test project with the (.text) part allocated on DDR3,  while the LED flashed correctly.

    .cmd file of LED project is like this

    ______

    MEMORY

    {

    DDR3 : o = 0x80000000,   l = 0x01000000

           ...

    }

    SECTIONS

    {

    .text > DDR3

           ...

    }

    ______

    Second, in the process of changing the .out into .dat file, I have used the AddDDrTable.exe

    the .cpp of this program is in the accessory

    AddDDrTable.cpp

    However,

    After I examine the .map file of the project, I found

    10818510    00000018     image_processing_evmc6678l_master_pe66.oe66 (.fardata:ti_sysbios_heaps_HeapMem_Object__table__V)

    It is included in (.fardata.2), and the ERROR infomation shows that the handle is at 0x10818510

    would it be useful if I move this part to DDR3 by adding

    image_processing_evmc6678l_master_pe66.oe66 (.fardata:ti_sysbios_heaps_HeapMem_Object__table__V) }"] = "DDR3";

    looking forward to your reply

    thanks