Undefined reference to `rpc_fncall_sync', uVisor


(abdou sen) #1

Hi,

When I try to use the RPC API in uvisor, i'm getting this error while building my project:

[ERROR] c:/program files (x86)/gnu tools arm embedded/5.3 2016q1/bin/../lib/gcc/arm-none-eabi/5.3.1/../../../../arm-none-eabi/bin/ld.exe: Warning: alignment 1 of symbol `__uvisor_ps' in ./mbed-os/features/FEATURE_UVISOR/targets/TARGET_UVISOR_SUPPORTED/TARGET_MAX32550/TARGET_DEBUG/TARGET_M3\libconfiguration_maxim_m3_mq55.a(uvisor-output.o) is smaller than 4 in ./mbed-os/features/FEATURE_UVISOR/targets/TARGET_UVISOR_SUPPORTED/TARGET_MAX32550/TARGET_DEBUG/TARGET_M3\libconfiguration_maxim_m3_mq55.a(disabled.o)
./.build/MAX32550/GCC_ARM/source/box.o: In function `_sgw_sync_print_secret(unsigned long)':
C:\Users\abderrahman.sensaoui\Documents\Code\mbedclitest\toto/.\source/box.cpp:33: undefined reference to `rpc_fncall_sync'
collect2.exe: error: ld returned 1 exit status

my objectif is to make 2 boxes communicate securely using the RPC. here my code :

box1.cpp :

 /* ... */
static void Thread_1(const void *);
void print_secret(void);

/* Secure box configuration */
UVISOR_BOX_NAMESPACE(NULL);                   /* We won't specify a box namespace for this example. */
UVISOR_BOX_HEAPSIZE(4096);                    /* Heap size for the secure box */
UVISOR_BOX_MAIN(Thread_1,    /* Main thread for the secure box */
                osPriorityNormal,             /* Priority of the secure box's main thread */
                1024);                        /* Stack size for the secure box's main thread */
UVISOR_BOX_CONFIG(box1,              /* Name of the secure box */
                  Thread_1_acls,       /* ACLs list for the secure box */
                  1024,                       /* Stack size for the secure box */
                  Contextbox);  /* Private static memory for the secure box. */

UVISOR_BOX_RPC_GATEWAY_SYNC(box1, print_secret_sync, print_secret, void, void);

void print_secret(void)
{
    Serial pc(SERIAL_TX, SERIAL_RX);
  pc.printf("Test print : %d \r\n", uvisor_ctx->nb++);
}

/* Main thread for the secure box */
static void Thread_1(const void *)
{
 
  uvisor_ctx->nb = 0;
  while (1) {
   
    uvisor_ctx->nb++;
    Thread::wait(1000);
  }
}

box1.h :

UVISOR_EXTERN void (*print_secret_sync)(void);

and box2.cpp

/* ... */
static void Thread_2(const void *);
/* Secure box configuration */
UVISOR_BOX_NAMESPACE(NULL);                   /* We won't specify a box namespace for this example. */
UVISOR_BOX_HEAPSIZE(4096);                    /* Heap size for the secure box */
UVISOR_BOX_MAIN(Thread_2,    /* Main thread for the secure box */
                osPriorityNormal,             /* Priority of the secure box's main thread */
                1024);                        /* Stack size for the secure box's main thread */
UVISOR_BOX_CONFIG(box2,              /* Name of the secure box */
                  Thread_2_acls,       /* ACLs list for the secure box */
                  1024,                       /* Stack size for the secure box */
                  Contextbox2);  /* Private static memory for the secure box. */




/* Main thread for the secure box */
static void Thread_2(const void *)
{
  DigitalOut led2(LED2);

  while (1) {
      led2 = !led2;
      print_secret_sync();
      Thread::wait(1000);
  }
}

Thank you for your help.