Skip to content

Commit eab5057

Browse files
committed
[nrf noup] platform: nordic_nrf: make RRAM writes unbuffered
Temporarily set RRAMC.CONFIG.WRITEBUFSIZE to 0 to use unbuffered mode when writing to RRAM in TF-M. This is done to reduce the interrupt latency increases provoked when writing to RRAM. Do not set it permanently so that it remains CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE for when the NS image code writes to RRAM. Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
1 parent a6edd3b commit eab5057

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

  • platform/ext/target/nordic_nrf/common/core/cmsis_drivers

platform/ext/target/nordic_nrf/common/core/cmsis_drivers/Driver_Flash.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,15 @@ static int32_t ARM_Flash_ProgramData(uint32_t addr, const void *data,
165165
#ifdef NRF_NVMC_S
166166
nrfx_nvmc_words_write(addr, data, cnt);
167167
#else
168+
nrf_rramc_config_t rramc_config;
169+
nrf_rramc_config_get(NRF_RRAMC, &rramc_config);
170+
const nrf_rramc_config_t orig_rramc_config = rramc_config;
171+
rramc_config.write_buff_size = 0;
172+
nrf_rramc_config_set(NRF_RRAMC, &rramc_config);
173+
168174
nrfx_rramc_words_write(addr, data, cnt);
169175

170-
/* At time of writing, the Zephyr driver commits writes, but the
171-
* nrfx driver does not, so we commit here using the HAL to align
172-
* Zephyr and TF-M behaviour.
173-
*
174-
* Not committing may cause data loss and/or high power
175-
* consumption.
176-
*/
177-
nrf_rramc_task_trigger(NRF_RRAMC, NRF_RRAMC_TASK_COMMIT_WRITEBUF);
176+
nrf_rramc_config_set(NRF_RRAMC, &orig_rramc_config);
178177
#endif
179178

180179
return cnt;

0 commit comments

Comments
 (0)