Synchronize Application and Network Core

I have created a barebones blinky example as a way to start developing for the dual cores on the nRF53, but I can't seem to synchronize them. The code on both cores is nearly identical. My main core releases the NETWORK.FORCEOFF flag and uses SysTick as the timing source (I've also tried a few other clocks). They start out in sync, but the network core gradually drifts out of phase.

Am I missing something? Could the issue be related to simultaneous memory access?

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdbool.h>
#include <stdint.h>
#include "nrf.h"
#include "nrf_gpio.h"
#define APPLICATION_LED 28
#define NETWORK_LED 31
static volatile uint32_t time = 0;
void SysTick_Handler(void)
{
time++;
}
void SysTick_Init(void)
{
SysTick->LOAD = (64000 - 1); // 1 ms interval (64MHz / 1000)
SysTick->VAL = 0; // Clear current value
SysTick->CTRL = SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_CLKSOURCE_Msk;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX