8000 Merge pull request #9160 from tannewt/fix_nrf_safe_mode · brushmate/circuitpython@f9a18fb · GitHub
[go: up one dir, main page]

Skip to content

Commit f9a18fb

Browse files
authored
Merge pull request adafruit#9160 from tannewt/fix_nrf_safe_mode
Move the nRF saved word
2 parents c0bbe26 + bcae6ae commit f9a18fb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ports/nordic/supervisor/port.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,16 @@ uint32_t *port_stack_get_top(void) {
283283
return &_estack;
284284
}
285285

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

292294
uint32_t port_get_saved_word(void) {
293-
return _saved_word;
295+
return *SAVED_WORD;
294296
}
295297

296298
uint64_t port_get_raw_ticks(uint8_t *subticks) {

0 commit comments

Comments
 (0)
0