HI all,
I'm working on a firmware for the nRF9151. In the development desk all works good. But under release conditions the software crashes cause of locked RAM access.
Details:
I have defined some RAM and IPC sections
.ipc (NOLOAD) : { KEEP(*(.ipc)) } > IPC .rx_buffer (NOLOAD) : { KEEP(*(.rx_buffer)) } > IPC .tls_read (NOLOAD) : { KEEP(*(.tls_read)) } > RAM .tls_write (NOLOAD) : { KEEP(*(.tls_write)) } > RAM .deviceid (NOLOAD) : { KEEP(*(.deviceid)) } > RAM .devicekey (NOLOAD) : { KEEP(*(.devicekey)) } > RAM
my fiirmware works fine and gets access to all memory section if the debugger is connected. I assue the security of the device is disabled for debugging.
After a hard reset (power-cycle) the chip is secured
core: Application
access status: Debug access is currently disabled (status value: All)
erase protection: false
so I do not get debugger access. That is not a big problem, but also some memory sectioins seem to be locked / secured and so my firmware crashes.
I use rust with embassy and I did not activate any security features.
let mut cfg = PeriphConfig::default();
cfg.hfclk_source = HfclkSource::Internal;
cfg.lfclk_source = LfclkSource::InternalRC;
cfg.gpiote_interrupt_priority = Priority::P7;
cfg.time_interrupt_priority = Priority::P7;
cfg.debug = Debug::Allowed;
let p: embassy_nrf::Peripherals = init_peripherals(cfg);
here you can see a example how I can provoke a panic / reboot:
#[link_section = ".rx_buffer"] static RX_BUFFER: Mutex<ThreadModeRawMutex, [u8; 2048]> = Mutex::new([0; 2048]); let mut rx_guard = RX_BUFFER.lock().await; let rx_buf: &mut [u8] = &mut *rx_guard; rx_buf[0] = 0x55;I assume that for some reason a security unit is enabled or the secure boot loader (SBL) protects the device and memory.
My system does not use any bootloader.
Can someone give me some hints or adives to solve my issue?
Thanks in advance and best regards
Marcus