aboutsummaryrefslogtreecommitdiff
path: root/test6.c
blob: c07bcc65e01a7b64bc7fd8bb9b357a889cd30d5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Test unrecoverable exception
 */
#include "armv7m.h"

static
void hard(void)
{
    puts("In HardFault\noops...\n");
    abort();
}

void main(void)
{
    run_table.hard = &hard;
    CPSID(if);
    puts("Faulting...\n");
    /* Trigger a UsageFault, which will escalate to unrecoverable
     * since FAULTMASK is set
     */
    __asm__ volatile (".word 0xffff");
    puts("Oops, I shouldn't be here...\n");
}