Skip to content

Commit 02b3427

Browse files
committed
rpc: WORKAROUND: disable metal_mutex
Enabling them crashes the m7 fw with this stacktrace #0 HardFault_Handler () at src/stm32h7xx_it.c:47 #1 <signal handler called> #2 0x08004770 in __metal_mutex_acquire (mutex=0x24003318 <rvdev+88>) at libraries/openamp_arduino/src/metal/system/generic/mutex.h:60 #3 metal_mutex_acquire (mutex=0x24003318 <rvdev+88>) at libraries/openamp_arduino/src/metal/mutex.h:59 #4 rpmsg_virtio_rx_callback (vq=0x240070d0) at libraries/openamp_arduino/src/rpmsg_virtio.c:548 #5 0x080041da in rproc_virtio_notified (vdev=0x24007058, notifyid=notifyid@entry=0) at libraries/openamp_arduino/src/remoteproc_virtio.c:341 #6 0x08003b48 in MAILBOX_Poll (vdev=<optimized out>) at libraries/openamp_arduino/src/mailbox_hsem_if.c:122 #7 0x08003d1e in OPENAMP_check_for_message () at libraries/openamp_arduino/src/openamp.c:166 #8 0x080013e2 in HSEM1_IRQHandler () at src/rpc.c:116 #9 <signal handler called> #10 0x080013a8 in serial_rpc_ready () at src/rpc.c:97 #11 0x08003596 in try_execute_m4_app () at src/m4_util.c:74 #12 0x0800088a in main () at src/main.c:124 Investigate a proper fix
1 parent 55489e8 commit 02b3427

File tree

1 file changed

+9
-0
lines changed
  • libraries/openamp_arduino/src/metal/system/generic

1 file changed

+9
-0
lines changed

libraries/openamp_arduino/src/metal/system/generic/mutex.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ typedef struct {
2929
};
3030
} metal_mutex_t;
3131

32+
#define __metal_mutex_acquire(x)
33+
#define __metal_mutex_try_acquire(x) 0
34+
#define __metal_mutex_release(x)
35+
#define __metal_mutex_is_acquired(x) 0
36+
#define __metal_mutex_init(x)
37+
#define __metal_mutex_deinit(x)
38+
39+
#if 0
3240
/*
3341
* METAL_MUTEX_INIT - used for initializing an mutex elmenet in a static struct
3442
* or global
@@ -71,6 +79,7 @@ static inline int __metal_mutex_is_acquired(metal_mutex_t *mutex)
7179
{
7280
return atomic_load(&mutex->v);
7381
}
82+
#endif
7483

7584
#ifdef __cplusplus
7685
}

0 commit comments

Comments
 (0)