Skip to content

Add DISCO_F429ZI to this example #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mbed_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"K64F": {
"target.features_add": ["UVISOR"],
"target.extra_labels_add": ["UVISOR_SUPPORTED"]
},
"DISCO_F429ZI": {
"target.features_add": ["UVISOR"],
"target.extra_labels_add": ["UVISOR_SUPPORTED"]
}
},
"macros": [
Expand Down
2 changes: 1 addition & 1 deletion source/led.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static const UvisorBoxAclItem acl[] = {
static void my_box_main(const void *);

UVISOR_BOX_NAMESPACE(NULL);
UVISOR_BOX_HEAPSIZE(8192);
UVISOR_BOX_HEAPSIZE(2048);
UVISOR_BOX_MAIN(my_box_main, osPriorityNormal, UVISOR_BOX_STACK_SIZE);
UVISOR_BOX_CONFIG(my_box, acl, UVISOR_BOX_STACK_SIZE, my_box_context);

Expand Down
31 changes: 28 additions & 3 deletions source/main-hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,37 @@
#define LED_ON false
#define LED_OFF true

#define MAIN_LED LED_BLUE
#define SECURE_LED LED_RED

#define MAIN_BTN SW2
#define MAIN_BTN_PUPD PullUp

#if defined (TARGET_DISCO_F429ZI)
#define MAIN_BTN USER_BUTTON
#define SW2 USER_BUTTON
#define MAIN_LED LED3
#define MAIN_ACL(acl_list_name) \
static const UvisorBoxAclItem acl_list_name[] = { \
{GPIOA, sizeof(*GPIOA), UVISOR_TACLDEF_PERIPH}, \
{GPIOB, sizeof(*GPIOB), UVISOR_TACLDEF_PERIPH}, \
{GPIOC, sizeof(*GPIOC), UVISOR_TACLDEF_PERIPH}, \
{GPIOD, sizeof(*GPIOD), UVISOR_TACLDEF_PERIPH}, \
{GPIOE, sizeof(*GPIOE), UVISOR_TACLDEF_PERIPH}, \
{RTC, sizeof(*RTC), UVISOR_TACLDEF_PERIPH}, \
{TIM5, sizeof(*TIM5), UVISOR_TACLDEF_PERIPH}, \
{USART1, sizeof(*USART1), UVISOR_TACLDEF_PERIPH}, \
{I2C1, sizeof(*I2C1), UVISOR_TACLDEF_PERIPH}, \
{SPI1, sizeof(*SPI1), UVISOR_TACLDEF_PERIPH}, \
{RCC, sizeof(*RCC), UVISOR_TACLDEF_PERIPH}, \
{FLASH, sizeof(*FLASH), UVISOR_TACLDEF_PERIPH}, \
{PWR, sizeof(*PWR), UVISOR_TACLDEF_PERIPH}, \
{EXTI, sizeof(*EXTI), UVISOR_TACLDEF_PERIPH}, \
{GPIOG, sizeof(*GPIOG), UVISOR_TACLDEF_PERIPH}, \
{SYSCFG, sizeof(*SYSCFG), UVISOR_TACLDEF_PERIPH}, \
{(void *) 0x42000000, 0x01000000, UVISOR_TACLDEF_PERIPH}, \
}
#else
#define MAIN_BTN SW2
#define MAIN_LED LED_BLUE
#define MAIN_ACL(acl_list_name) \
static const UvisorBoxAclItem acl_list_name[] = { \
{SIM, sizeof(*SIM), UVISOR_TACLDEF_PERIPH}, \
Expand All @@ -47,5 +72,5 @@
{I2C0, sizeof(*I2C0), UVISOR_TACLDEF_PERIPH}, \
{SPI0, sizeof(*SPI0), UVISOR_TACLDEF_PERIPH}, \
}

#endif
#endif /* __UVISOR_HELLOWORLD_MAIN_HW_H__ */
2 changes: 1 addition & 1 deletion source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ MAIN_ACL(g_main_acl);

/* Enable uVisor. */
UVISOR_SET_MODE_ACL(UVISOR_ENABLED, g_main_acl);
UVISOR_SET_PAGE_HEAP(8*1024, 5);
UVISOR_SET_PAGE_HEAP(4*1024, 5);

int main(void)
{
Expand Down