Skip to content

Commit

Permalink
mynewt-core/system_cmac: Suppress a meta-stability issue from raising…
Browse files Browse the repository at this point in the history
… a false error condition towards the controller (mainly observed in GF).
  • Loading branch information
ioannis-karachalios committed May 8, 2023
1 parent 25f6166 commit e110969
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hw/mcu/dialog/cmac/src/system_cmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
#include <ipc_cmac/diag.h>
#include "CMAC.h"

static inline void
set_reg32_bits(uint32_t addr, uint32_t mask, uint32_t val)
{
volatile uint32_t *reg = (volatile uint32_t *)addr;

*reg = (*reg & (~mask)) | (val << __builtin_ctz(mask));
}

void
SystemInit(void)
{
Expand All @@ -51,4 +59,6 @@ SystemInit(void)
CMAC->CM_CTRL_REG |= CMAC_CM_CTRL_REG_CM_BS_ENABLE_Msk;

cmac_timer_init();

set_reg32_bits(0x40000904, 0x0004, 1);
}

0 comments on commit e110969

Please sign in to comment.