Hi Greg,
I think it's hardfault. And inside hardfault, it calls assert()
I am not sure if sem_wait causes the hardfault. If I don't issue SVCALL inside a signal handler, I don't see a hardfault even I have sem_wait. The combination of "sem_wait" and "issue SVCALL inside a signal handler" cause this hardfault. Below is the data log.
user_main: POSIX timer test
timer_test: Initializing semaphore to 0
timer_test: Unmasking signal 17
timer_test: Registering signal handler
timer_test: oact.sigaction=0 oact.sa_flags=0 oact.sa_mask=0
timer_test: Creating timer
timer_test: Starting timer
timer_test: Waiting on semaphore
up_hardfault: PANIC!!! Hard fault: 40000000
up_assert: Assertion failed at file:armv7-m/up_hardfault.c line: 171
up_dumpstate: sp: 20002e60
up_dumpstate: IRQ stack:
up_dumpstate: base: 20002f00
up_dumpstate: size: 00000800
up_stackdump: 20002e60: 00000000 00000000 20002e70 00021eaf 00000800 20002f00 200055a0 00001fc4
up_stackdump: 20002e80: 200079e0 20002e60 20002e98 00021f8f 000000ab 20002ea8 000000ab 00032cd4
up_stackdump: 20002ea0: 20002ea8 000227e1 20002eb0 00000000 20007704 00000003 00000000 df790001
up_stackdump: 20002ec0: 0002b158 20007704 20002ed0 00022d33 20007704 00000003 00000000 0002277d
up_stackdump: 20002ee0: 20002ee8 00022761 20007704 00000003 00000000 00000000 200077d8 00021fcd
up_dumpstate: sp: 200077d8
up_dumpstate: User stack:
up_dumpstate: base: 200079e0
up_dumpstate: size: 00001fc4
up_stackdump: 200077c0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
up_stackdump: 200077e0: 20003b2c 00000011 00000000 00000000 200055e0 20003b20 200055e8 20003b20
up_stackdump: 20007800: 20007808 00023deb 20004460 200055a0 00000000 00000021 00010001 00000000
up_stackdump: 20007820: 000156e4 00000000 00000004 20003b20 20007838 0002a4cf 20004460 20007928
up_stackdump: 20007840: 00000001 00000000 00000000 00000000 20007928 00000000 00000000 00000000
up_stackdump: 20007860: 00000000 ffffffe9 00000000 00000000 00000000 00000000 00000000 00000000
up_stackdump: 20007880: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
up_stackdump: 200078a0: 00000000 00000000 00000002 20005610 20002f70 20002f70 00989680 00031d4d
up_stackdump: 200078c0: 0002a604 01000000 00000000 00000000 00000000 00000000 00000000 00000000
up_stackdump: 200078e0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
up_stackdump: 20007900: 00000000 00000000 00000000 20007928 00010000 00023d65 00000004 200055a0
up_stackdump: 20007920: 20007928 00031d4d 0502dca3 200055a0 00031331 20002f00 200055a0 010055a0
up_stackdump: 20007940: 20007948 0002d59b 2000795c 20003228 20007968 00000000 200055a0 ffffffff
up_stackdump: 20007960: 20007968 0002b465 061afa4b 20003250 00000002 00000000 00000002 00000000
up_stackdump: 20007980: 00031101 0000002a 00000000 00000000 00000000 0002b211 fffdffff 00000002
up_stackdump: 200079a0: 00020000 0002adf5 00000000 00000000 200079b8 0002adf9 200079e4 00000005
up_stackdump: 200079c0: 200079c8 000232ed 00000000 00000000 200055a0 00000005 00000000 00000000
up_registerdump: R0: 200077f6 20003b2c 00000000 200077f6 00000000 00000000 00000000 200077d8
up_registerdump: R8: 00000000 00000000 00000000 00000000 00989680 200077d8 0002b227 0002b15a
up_registerdump: xPSR: 41000000 PRIMASK: 00000001 CONTROL: 00000000
up_registerdump: EXC_RETURN: ffffffe9