Other Parts Discussed in Thread: CC2650STK
Hi
I have a SensorTag CC2650STK and am using Code Composer Studio.
I managed to write some data to an unused flash page and verify it using the SmartRF FlashProgrammer using the HalFlashWrite function.
Now I'm stuck, however, with reading back the data. When I don't debug the project upon reading the data the SensorTag crashes and when I debug it the read method returns fine, but the data read is just 00 bytes.
Since HalFlashRead has
HAL_ENTER_CRITICAL_SECTION(cs);
in it, which is defined as
st(x = ICall_enterCriticalSection();)
in my case.
Could it be that a deadlock is my problem. I call the HalFlashRead function directly from bleDispatch::processICallUTIL.
Also, I didn't find where FLASH_OAD is defined (to undefine it), which makes the calculation in HalFlashGetAddress dependent on the location of the defined HAL_NV_PAGE_END, whereas the alternative ((uint8*)((pg << 12) + offset)) seems much more applicable to my case of reading and writing an arbitrary flash page.
But even if I create a local copy of the HalFlashRead function and replace the HalFlashGetAddress call with a hardcoded constant address, how does this address point into flash instead of RAM when the read part looks just like
while (cnt--)
{
*buf++ = *ptr++;
}
Cheers