Failure access to internal flash when enabling Soft device

Good day Nordic people, 
I am facing a problem when erasing or writing to internal flash memory after enabling softdevice. here the details and tests:

Setup:
- GCC, arm toolchain, make files under linux OS. Visual studio code for editing.

Exact problem:
- when trying to erase or write to internal flash, it throw an exception at PC address 0x15074. sure this after SD enable.

Testing and Tries:
- Am using SD flash APIs.
- I tried to access sd flash function directly and within fstorage APIs.
- I tried Segger Fstorage example and it was working fine so i moved this example to my setup but no luck.
- i tried to disable softdevice before Flash operation and enable after finishing, it is working sometimes... in all cases i don't recommend this way of solving this problem.
- before enabling softdevice, I was able to master flash operation without any problem.
- I tried many configuration for sofdevice lf_clock, RC, XTAL and SYNTH

I think, there is a missed configuration is done by IDE like Segger, I didn't use it. But what is this configuration, i don't know.

best regards
Hossam

Parents
  • 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

Reply
  • 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

Children
No Data
Related