Thank you, I've seen that the source file rpc.c was missing.
Have you tried the last version of uVisor, I don't know which board you are using, but if you are using K64F you won't have any problem. if you are using another one, can you tell how you set up the page heap SECTION in the linker script? especially the alignment, I did this (as shown in vmpu_armv7m.c) but it's not working :
/* ... */
__uvisor_bss_end = .;
} > RAM
/* Heap space for the page allocator */
.page_heap (NOLOAD) :
{
. = ALIGN(32);
__uvisor_page_start = .;
KEEP(*(.keep.uvisor.page_heap))
. = ALIGN((1 << LOG2CEIL(LENGTH(RAM)) / 8));
__uvisor_page_end = .;
} > RAM
/* ... */
I don't know why but I feel like the (1 << LOG2CEIL(LENGTH(RAM))/8) = 0 which is wrong, it must be > 0 when LENGHT(RAM) > 0 !!!!
Hi,
When I try to use the RPC API in uvisor, i'm getting this error while building my project:
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) { 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 :
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.