Skip to content

Commit de4b24e

Browse files
committed
Fix memory usage for this app
* Reduce pages-backed memory, which is not needed by this example. * Increase memory where needed to make sure threads have enough buffer space for printf.
1 parent 9b3c312 commit de4b24e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

source/client_a.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static void client_a_main(const void *);
3333
* This box has a smaller interrupt and main thread stack sizes as we do nothing
3434
* special in them. */
3535
UVISOR_BOX_NAMESPACE("client_a");
36-
UVISOR_BOX_HEAPSIZE(3072);
36+
UVISOR_BOX_HEAPSIZE(4096);
3737
UVISOR_BOX_MAIN(client_a_main, osPriorityNormal, 768);
3838
UVISOR_BOX_CONFIG(secure_number_client_a, acl, 512, box_context);
3939

source/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
MAIN_ACL(g_main_acl);
2727
/* Enable uVisor. */
2828
UVISOR_SET_MODE_ACL(UVISOR_ENABLED, g_main_acl);
29-
UVISOR_SET_PAGE_HEAP(8 * 1024, 5);
29+
UVISOR_SET_PAGE_HEAP(1 * 1024, 1);
3030

3131
DigitalOut led_red(LED1);
3232
DigitalOut led_green(LED2);

source/secure_number.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ static int set_number(uint32_t number);
3636
/* Box configuration */
3737
UVISOR_BOX_NAMESPACE(NULL);
3838
UVISOR_BOX_HEAPSIZE(3072);
39-
UVISOR_BOX_MAIN(number_store_main, osPriorityNormal, UVISOR_BOX_STACK_SIZE);
40-
UVISOR_BOX_CONFIG(box_number_store, acl, UVISOR_BOX_STACK_SIZE, box_context);
39+
UVISOR_BOX_MAIN(number_store_main, osPriorityNormal, 1024);
40+
UVISOR_BOX_CONFIG(box_number_store, acl, 512, box_context);
4141

4242
#define uvisor_ctx ((box_context *) __uvisor_ctx)
4343

0 commit comments

Comments
 (0)