allocate global variable and local variable during bf609 compile

Hi, Adi's experts

     I'm learning bf609-EZboard, I have some question about bf609 need you help.

    

     1. About allocate memory. In my program, I define some variable (globle variable and local variable), and I print out their address, I find their addr is 0x05xxxxxx, but this address belongs to the core B, then what should I do to specify CORE A  assigned  address global variable or a local variable in his own bank.

     2. About use other libraries. In my program, I may use QT or OPENCV, but want should I do to link these libraries during my program compile. my program in libmcapi-2.0/tests/ directory.

  • First there are actually two questions, next time could you split them into two topics?

    1) On Linux core A, you only need to reserve the memory for core A and core B from kernel boot args only, the loader will handle this correctly if you have append the kernel args correctly.

    2)You can include the the libmcapi header file in your QT main program, and link against the mcapi lib.

  • hi, aaron,

         Thank you for your apply, However, I am still very confused, I want CORE A global variables and local variables are all allocated in the CORE A on the bank of SDRAM (0x00000000 ~ 0x40000000), I still do not know how to set the boot args,hope your help !

         I paste my boot args in here.

     

         ramargs=root=/dev/mtdblock0 rw clkin_hz=30000000 earlyprintk=serial ,uart0,57600 console=ttyBF0,57600 mem=124M max_mem=128M icc_l2_mem=0x8000

  • You have set the bootargs correctly. This arg setting means: board has total 128M RAM, 0~124M is taken up by the kernel, and 124~128M reserved for other usage, the Linux core B loader will load your core B code into 124~128 and run.

  • Correctly ? But I defined variable (either global variables or local variables) in CORE A, are assigned to the SDRM

    bank of CORE B, namely: 0x40000000 ~ 0x80000000 address space, what causes it?

  • I don't know how you get the address of 0x40000000 ~ 0x80000000, from the spec, BF609 has DRAM address range of 256MB from 0x0 ~ 0x10000000, on the ezkit board the first 128MB is used. I really have no idea how you run into 0x40000000 ~ 0x80000000. If you can not figure it out, I would suggest you to start from checking the ADI default test code.