This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

error: assignment of read-only member 'NRF_CCM_Type::MICSTATUS'

This is not an official Nordic library related but I'm hoping someone could help.

I'm using the Radiohead library http://www.airspayce.com/mikem/arduino/RadioHead/

And i got this error. 

.pio/libdeps/nrf52_dk/RadioHead/RH_NRF51.cpp: In member function 'void RH_NRF51::setModeRx()':
.pio/libdeps/nrf52_dk/RadioHead/RH_NRF51.cpp:158:23: error: assignment of read-only member 'NRF_CCM_Type::MICSTATUS'
  NRF_CCM->MICSTATUS = 0;
                       ^
*** [.pio/build/nrf52_dk/lib4c7/RadioHead/RH_NRF51.cpp.o] Error 1

Here is the part of the library that is having a problem.

void RH_NRF51::setModeRx()
{
    if (_mode != RHModeRx)
    {
	setModeIdle(); // Can only start RX from DISABLE state

#if RH_NRF51_HAVE_ENCRYPTION
	// Maybe set the AES CCA module for the correct encryption mode
	if (_encrypting)
	    NRF_CCM->MODE = (CCM_MODE_MODE_Decryption << CCM_MODE_MODE_Pos); // Decrypt
	NRF_CCM->MICSTATUS = 0;	
#endif

	// Radio will transition automatically to Disable state when a message is received
	NRF_RADIO->PACKETPTR = (uint32_t)_buf;
	NRF_RADIO->EVENTS_READY = 0U;
	NRF_RADIO->TASKS_RXEN = 1;
	NRF_RADIO->EVENTS_END = 0U; // So we can detect end of reception
	_mode = RHModeRx;
    }
}

TIA

Related