Hello!
I have a question about the work of nRF52 with memory, why does it work so crookedly?
The first situation.
We have a static void nus_data_handler (ble_nus_evt_t * p_evt) function that takes a buffer. I have a structure for the buffer, I declare an instance
ble_buffer *received_data;
Then miracles begin. If I copy the buffer like this
received_data = p_evt->params.rx_data.p_data;
then everything works well, but on this line I get a warning:
assignment to 'ble_buffer *' {aka 'struct <anonymous> *'} from incompatible pointer type 'const uint8_t *' {aka 'const unsigned char *'} [-Wincompatible-pointer-types]
If I copy the buffer to my struct instance otherwise
memcpy(&received_data,p_evt->params.rx_data.p_data,p_evt->params.rx_data.length);
Then I fall out:
------------------------------------------------------------------------
The second situation.
uint32_t addr;
addr = 0xFFFFFFFF & NRF_FICR->DEVICEADDR[0];
And it seems okay, this is how the code works. But if you add next
NRF_LOG_HEXDUMP_DEBUG(addr, sizeof(addr));
Then I fall out again :(
As far as I understand, in both cases the memory access functions conflict with the softdevice policy or am I wrong?