add to testing:
I have checked ACL registers and all are containing 0's values which means no memory protection.
Hi
Have you checked what address you try to write to? If you try to write to an address occupied by the SoftDevice an error like this is likely to occur. What SDK are you using for development? The SoftDevice takes up flash up until ~0x26000. This varies depending on what SDK version you're using.
Best regards,
Simon
Hi Simon,
sure, it is a precaution to check the address. I have divided the memory in a custom linker file and i am accessing 0xf4000.
here is memory partitions:
_TOTAL_MEMORY_SIZE = 1024K;
_SOFT_DEVICE_MEMORY_START = 0x00000000;
_SOFT_DEVICE_MEMORY_LENGTH = 156K;
_SOFT_DEVICE_END = _SOFT_DEVICE_MEMORY_START + _SOFT_DEVICE_MEMORY_LENGTH;
_APP_MEMORY_START = _SOFT_DEVICE_END;
_APP_MEMORY_SIZE = 400K;
_APP_MEMORY_END = _APP_MEMORY_START + _APP_MEMORY_SIZE;
_APP_FDS_START = _APP_MEMORY_END;
_APP_FDS_SIZE = 28K;
_APP_FDS_END = _APP_FDS_START + _APP_FDS_SIZE;
_FUOTA_IMAGE_START = _APP_FDS_END;
_FUOTA_IMAGE_SIZE = 392k;
_FUOTA_IMAGE_END = _FUOTA_IMAGE_START + _FUOTA_IMAGE_SIZE;
_APP_DATA_START = _FUOTA_IMAGE_END;
_APP_DATA_SIZE = 20K;
_APP_DATA_END = _APP_DATA_START + _APP_DATA_SIZE;
_BOOTLOADER_MEMORY_START = _APP_DATA_END;
_BOOTLOADER_LENGTH = 28K;
_BOOT_ONLY_BOOTLOADER_MEMORY_END = _BOOTLOADER_MEMORY_START + _BOOTLOADER_LENGTH;
_FLASH_MEMORY_END = _SOFT_DEVICE_MEMORY_START + _TOTAL_MEMORY_SIZE;
MEMORY
{
FLASH (rx) : ORIGIN = _APP_MEMORY_START, LENGTH = _APP_MEMORY_SIZE
RAM (rwx) : ORIGIN = 0x20002A48, LENGTH = 0x3D5B8
CODE_RAM (rwx) : ORIGIN = 0x800000, LENGTH = 0x40000
/*EXTFLASH (rx) : ORIGIN = 0x12000000, LENGTH = 0x8000000*/
}
- SDK 17.0.2
Hi
Are you able to see any error message from the "thrown" exception? Since the address is in the SoftDevice I would assume there is an sd_() function returning an error in your application that might shed some light on what exactly is happening.
Best regards,
Simon
Hi,
Partially, I solved this problem and i am planning to post it here, may help some body else.
Now I have internal error event when doing flash operation inside interrupt function like GPIO handler?.
I am using interrupt sdh dispatch model , I tried appsch_SDH_dispatch and got the same result.
BTW, return code is NRF_SUCCESS, so function call is fine
I think it is because GPIO handler is calling SVC by calling SD operation, so is there any way to work around without making a lot of changes?
regards