KB: Tips for saving power consumption by using Flash Overlay and Loop Cache

Tips for saving power consumption by using Flash Overlay and Loop Cache

1. RSL10 has Flash Overlay Zone.

  • Flash memory overlay can be used for executing the Bluetooth low energy software stack and the user application.

  • Flash memory overlay (like PRAM0 through PRAM3 memory) can serve a purpose similar to that of a program cache, where commonly-used functions or routines are placed.

  • The memories are primarily used for mirroring the real-time functions of the Bluetooth stack and the application stored in the flash memory.

  • The advantage of using PRAM rather than flash memory is that it minimizes the number of flash memory accesses in order to lower the overall power consumption.

How to use this in code:

/* Enable Flash overlay. */

memcpy((uint8_t *)PRAM0_BASE, (uint8_t *)FLASH_MAIN_BASE, PRAM0_SIZE);
memcpy((uint8_t *)PRAM1_BASE, (uint8_t *)(FLASH_MAIN_BASE + PRAM0_SIZE),
memcpy((uint8_t *)PRAM2_BASE,
       (uint8_t *)(FLASH_MAIN_BASE + PRAM0_SIZE + PRAM1_SIZE),
memcpy((uint8_t *)PRAM3_BASE,
       (uint8_t *)(FLASH_MAIN_BASE + PRAM0_SIZE + PRAM1_SIZE + PRAM2_SIZE),

2. RSL10 can use a loop cache to save power consumption.

To reduce the current consumption from fetching instructions, the Arm Cortex-M3 processor is supported by a 32-instruction loop cache that can be used to cover a continuous block of reads.

To enable this cache, set the CSS_LOOP_CACHE_ENABLE bit from the SYSCTRL_CSS_LOOP_CACHE_CFG register.

For example:

/* Enable CM3 loop cache. */

1 Like