This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

"Failed to write memory" when using Segger Embedded Studio and nRF Connect SDK

I am using NCS v1.7.0 and have found that SES is not being configured properly for debugging/flashing.  When I open the project in SES, building works fine, but when I try to debug or flash, I get the error "Failed to write memory".  I am using an external JLINK programmer.

After investigating the SES project options, I found that Debugger-> Target Device is set to $(Target:).  The problem is resolved by updating this field to match my target processor (nrf52805_xxaa in this case).  This works fine to resolve the flashing issue, but every time I run cmake or change the project options, the Target Device gets reset back to $(Target:) and I need to re-configure the project.

Is there a way to configure my project such that this field is properly passed to SES from the CmakeLists.txt or prj.conf?

Parents
  • Hello,

    I see the same when I try to build for the nrf52805, but not sure why. I have to do some more investigation and get back to you, unfortunately.

    Another alternative is to take a look at our newly released VS code extension (https://nordicplayground.github.io/vscode-nrf-connect/)

    Best regards,

    Vidar

  • I found the problem, the create_nordic_project.py script in \v1.7.0\toolchain\segger_embedded_studio\html\ is missing an entry for the nRF52805 like we have for or other ICs, and that is why the target device name does not become set.

    We will have to address this in the next release. For now, please add the following lines to patch the script:

    diff --git a/create_nordic_project.py b/create_nordic_project.py
    index 4789929..aab1af4 100644
    --- a/create_nordic_project.py
    +++ b/create_nordic_project.py
    @@ -267,6 +267,11 @@ def createProject(
                     segments = ("FLASH RX 0x00000000 0x00080000;"
                                 "RAM RWX 0x20000000 0x00004000")
                     svdFile = "nrf51.svd"
    +            elif device == "nrf52805_caaa":
    +                deviceName = "nRF52805_xxAA"
    +                segments = ("FLASH RX 0x00000000 0x00030000;"
    +                            "RAM RWX 0x20000000 0x00006000")
    +                svdFile = "nrf52805.svd"
                 elif device == "nrf52810_qfaa":
                     deviceName = "nRF52810_xxAA"
                     segments = ("FLASH RX 0x00000000 0x00030000;"

Reply
  • I found the problem, the create_nordic_project.py script in \v1.7.0\toolchain\segger_embedded_studio\html\ is missing an entry for the nRF52805 like we have for or other ICs, and that is why the target device name does not become set.

    We will have to address this in the next release. For now, please add the following lines to patch the script:

    diff --git a/create_nordic_project.py b/create_nordic_project.py
    index 4789929..aab1af4 100644
    --- a/create_nordic_project.py
    +++ b/create_nordic_project.py
    @@ -267,6 +267,11 @@ def createProject(
                     segments = ("FLASH RX 0x00000000 0x00080000;"
                                 "RAM RWX 0x20000000 0x00004000")
                     svdFile = "nrf51.svd"
    +            elif device == "nrf52805_caaa":
    +                deviceName = "nRF52805_xxAA"
    +                segments = ("FLASH RX 0x00000000 0x00030000;"
    +                            "RAM RWX 0x20000000 0x00006000")
    +                svdFile = "nrf52805.svd"
                 elif device == "nrf52810_qfaa":
                     deviceName = "nRF52810_xxAA"
                     segments = ("FLASH RX 0x00000000 0x00030000;"

Children
No Data
Related