MCAPI lib is on top of the ICC driver. Please refer to build kernel with ICC support for detail kernel configuration for ICC.
Check following setting before build kernel:
Configure libmcapi in buildroot:
Package Selection for the target --->
Libraries --->
Other --->
[*] libmcapi
Miscellaneous --->
[*] bfin inter-core communication support
ICC cpu type (BF609) --->
Configure libmcapi in uClinux:
Library Configuration ---> [*] Build libmcapi Blackfin app programs ---> [*] BF561 ICC utils
Go to MCAPI library folder:
For buildroot
make libmcapi
For uClinux
make lib/libmcapi_only
On coreb side, mcapi test task is on top of icc layer, and statically link with coreb side libmcapi.a. Mcapi test task will also be loaded by icc_loader on coreb, and will excute from entry point icc_task_init as icc task. To write a mcapi test task, you must include mcapi head files and call mcapi api to communicate with some endpoint on linux side.
A sample mcapi test task:
#include <mcapi.h>
#include <mcapi_datatypes.h>
#include <mcapi_test.h>
...
void icc_task_init(int argc, char *argv[]) {
mcapi_status_t status;
mcapi_version_t version;
mcapi_endpoint_t ep1,ep2;
int i;
mcapi_uint_t avail;
/* create a node */
mcapi_initialize(SLAVE_NODE_NUM,&version,&status);
if (status != MCAPI_SUCCESS) { WRONG }
/* create endpoints */
ep1 = mcapi_create_endpoint (SLAVE_PORT_NUM1,&status);
if (status != MCAPI_SUCCESS) { WRONG }
while(1) {
if (icc_wait())
mcapi_msg_recv_i(recv,buffer,BUFF_SIZE,&request1,&status);
if (status != exp_status) { WRONG}
}
mcapi_finalize(&status);
coreb_msg(" Test PASSED\n");
return;
}
to build coreb icc utils, libmcapi_coreb and mcapi test task, just:
For buildroot
cd blackfin-linux-dist make packages/icc_utils_only
For uClinux
cd blackfin-linux-dist make user/blkfin-apps/icc_utils_only
you can find libmcapi_coreb under icc_utils folder
ls icc_utils/ example icc_core icc_loader include libmcapi_coreb
there are some simple test task for mcapi msg, pktchan and sclchan transfer modes.
ls icc_utils/example/task/mcapi* mcapi_msg1 mcapi_msg1.c mcapi_msg1.o mcapi_pkt1 mcapi_pkt1.c mcapi_pkt1.o mcapi_scl1 mcapi_scl1.c mcapi_scl1.o
After Linux boots up, loader icc bare metal stub to coreb.
root:/> icc_loader -l bin/icc
loader mcapi test task on coreb
root:/> icc_loader -e bin/mcapi_msg1
begin mcapi test, run mcapi test app on linux side, create a mcapi endpoint and communicate with coreb side loaded mcapi test task
root:/> msg1
example mcapi project path: C:\Analog Devices\CrossCore Embedded Studio 1.0.0\Blackfin\Examples\services\mcapi\BF609_MCAPI_msg\BF609_MCAPI_msg_Core1
customize app_cplbtab.c for core1 application to use sdram, select “Permit alteration of CPLB table entries” in the Startup Code/LDF tab
add sdram cplb entries to startup_ldr/app_cplbtab.c
/* SDRAM Memory */
{0x0, (ENUM_DCPLB_DATA_64MB | CPLB_DNOCACHE)},
{0x4000000, (ENUM_DCPLB_DATA_64MB | CPLB_DNOCACHE)},
build project Project → build project
Blackfin bootrom allows to load 1 LDR image into memory and run on both cores after reset. You can pack core1 MCAPI dxe binary and core 0 uboot elf binary into one LDR image by bfin-elf-ldr utility and run MCAPI application on core1 at the very begining of uboot init.
~$ cd u-boot ~/u-boot$ vi include/configs/bf609-ezkit.h #define CONFIG_CORE1_RUN 1 :wq ~/u-boot$ make bf609-ezkit
~/u-boot$ cp /analogdevices/cces/BF609_MCAPI_msg_CORE1 . ~/u-boot$ bfin-elf-ldr -T bf609-0.0 -c DualCoreTest_uboot.ldr u-boot BF609_MCAPI_msg_CORE1.dxe --bmode PARA --use-vmas --initcode arch/blackfin/cpu/initcode.o -J --punchit $((0x8000)):$((0x8000)):env-ldr.o
Linux ICC utility icc_loader also support to load CCES executable binary. User can load CCES MCAPI application to coreb multiple times under Linux.
Just load by:
icc_loader -l BF609_MCAPI_msg_CORE1.dxe
run cces_msg1 in libmcapi test, test interoperability with core1 mcapi msg application
cces_msg1
Complete Table of Contents/Topics

