This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF52 and MWU

Hi,

I've been debugging my code and would like to use the Memory Watch Unit (MWU). I use SDK version 11, s132, and NRF52.

Could you point to an example of using MWU with SoftDevice enabled? Or any kind of example as I've not been able to find any... with or without the SD.

I've tried to use the NRF_MWU->REGION members 0 and 1, but I get an application fault 0x1001. Is there somewhere in the documentation that the SD is using these? Or is this something else?

If I use the regions 2 and 3, I get an application fault 1. I added the following to my main function, but it did not help.

uint32_t result = sd_softdevice_vector_table_base_set( ApplicationAddress );
APP_ERROR_CHECK( result );

sd_nvic_SetPriority( MWU_IRQn, APP_IRQ_PRIORITY_THREAD );
sd_nvic_ClearPendingIRQ( MWU_IRQn );
sd_nvic_EnableIRQ( MWU_IRQn );

To start the memory watching:

NRF_MWU->REGION[2].START = (uint32_t) <start address>
NRF_MWU->REGION[2].END   = (uint32_t) <end address>
NRF_MWU->INTENSET    = MWU_INTENSET_REGION2WA_Enabled << MWU_INTENSET_REGION2WA_Pos;
NRF_MWU->REGIONENSET = MWU_REGIONENSET_RGN2WA_Enabled << MWU_REGIONENSET_RGN2WA_Pos;

And I have an IRQ handler function:

void MWU_IRQHandler( void )
{
	.. code ...
}

Ideas would be appreciated,

Kai

Parents Reply
  • The reason why the peripheral is "restricted" and not "blocked" is more technical, and has to do with how the SoftDevice enforces access restrictions on the peripheral. The SoftDevice is not designed with application MWU usage in mind. If you try it out you may see that it appears to be working, but there are no guarantees for anything. There is not sufficient information in the SDS regarding MWU usage restrictions, and the existing information is somewhat misleading. I will add a request to update the information. I would not recommend trying to use the MWU when the SoftDevice is enabled. Sorry for the inconvenience

Children
No Data
Related