Skip to content

Commit

Permalink
Merge pull request #9168 from dhalbert/9.0.x-fix_nrf_safe_mode
Browse files Browse the repository at this point in the history
backport to 9.0.x: Move the nRF saved word
  • Loading branch information
tannewt authored Apr 11, 2024
2 parents 25dd72d + 2637e5b commit 50121d0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ports/nrf/supervisor/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,16 @@ uint32_t *port_stack_get_top(void) {
return &_estack;
}

// Place the word in the uninitialized section so it won't get overwritten.
__attribute__((section(".uninitialized"))) uint32_t _saved_word;
// Place the word in the first 32k of RAM. This is saved by us and the
// bootloader for the soft device. We only use it before the soft device uses
// that memory.
#define SAVED_WORD ((uint32_t *)(0x20008000 - 4))
void port_set_saved_word(uint32_t value) {
_saved_word = value;
*SAVED_WORD = value;
}

uint32_t port_get_saved_word(void) {
return _saved_word;
return *SAVED_WORD;
}

uint64_t port_get_raw_ticks(uint8_t *subticks) {
Expand Down

0 comments on commit 50121d0

Please sign in to comment.