[SOLVED] SFR display not working for register arrays of nRF52840

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] SFR display not working for register arrays of nRF52840

    Hi,

    I am running Segger Embedded Studio (4.10a) to get used to the Nordic DK for the nRF52840. Now I have found, that the register display seems not to be able to show some of the SFRs. For example, if I activate the UICR group, I get the following registers: UNUSED0, UNUSED1, UNUSED2, UNUSED3, APPROTECT, NFCPINS, DEBUGCTRL and REGOUT0. But there are a lot more registers according the the manual, all missing registers are arrays:
    NRFFW[0]-NRFFW[14], NRFHW[0]-NRFHW[11], CUSTOMER[0]-CUSTOMER[31] and PSELRESET[0]-PSELRESET[1]. The same applies to other SFR groups.
    I have checked for the missing registers in the nrf52840.svd file which is part of the SDK 15.2.0 provided by Nordic, and found for example this entry:
    <register>
    <dim>0xF</dim>
    <dimIncrement>0x4</dimIncrement>
    <name>NRFFW[%s]</name>
    <description>Description collection[n]: Reserved for Nordic firmware design</description>
    <addressOffset>0x014</addressOffset>
    <access>read-write</access>
    <resetValue>0xFFFFFFFF</resetValue>
    <fields>
    <field>
    <name>NRFFW</name>
    <description>Reserved for Nordic firmware design</description>
    <lsb>0</lsb>
    <msb>31</msb>
    </field>
    </fields>
    </register>
    Since I don't know the syntax required for register arrays, I cannot know if this entry is correct and the SES has a bug here or if the register description is in error and how to fix it.

    Regards
    Dirk

    The post was edited 1 time, last by dzabel: Added SDK version number ().

  • Hi Dirk,

    Thank you for your inquiry.
    The Nordic devices package files are provided by Nordic directly. If there is an issue with it we suggest contacting Nordic support.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Nino,
    that was just the question: is it an SES issue or an incorrect SVD file? To decide this, I would need a specification of the supported SVD file format.
    I have now put the very same question to Nordic. I hope they don't redirect me here.
    Regards
    Dirk
  • Hello Dirk,

    Usually the definitions are pulled from the CMSIS svd files which then are created into a Embedded Studio xml format by us. However in this specific case Nordic provides us with the finished CPU support packages. So any target specific files for Nordic devices are supplied to us by Nordic directly. So if there is an issue with this files Nordic is the right contact. Should the files be incorrect indeed Nordic will supply us with an updated version which we will then also update in the ES CPU Support packages and Nordic will most likely update their SDK as well.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Nino,
    Just to give you an update: see here Discussion with Nordic.
    'The register array display works, if I replace hex numbers by decimal numbers in the <dim> and <dimIncrement> elements of the SVD files. According to the Nordic support engineer, they might contact Segger on this topic. For me, the case is solved now :)
    Regards
    Dirk
  • Hi Dirk,

    Thank you for the update.

    Just for clarification, how are you setting the svd file in your emProject file?
    In the project option Register Definition File?
    Are registers displayed correctly in the Nordic SDK example projects e.g. examples\ble_peripheral\ble_app_blinky\pca10040\s132\ses?

    Instead of using the svd format, could you install the Nordic CPU support package and use the nrf52_Registers.xml from it in project option Register definition file instead?
    Does that work?

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Nino,
    I am using the nRF52840 DK hardware. Therefore, I have used the projects for target pca10056 with s140 softdevice. I tried the project ble_app_hrs, ble_app_hrs_freertos, blinky_pca10056 and some more.
    The unmodified setting for the svd file is always "../../../../../../modules/nrfx/mdk/nrf52840.svd". This is in the project option Debug | Debugger | Register definition file setting.
    I had already installed the Nordic CPU support package. This is located in
    %LOCALAPPDATA%\SEGGER\SEGGER Embedded Studio\v3\packages\nRF
    (the "v3" seems strange to me, I have installed the SES v4.10a, but there is no "v4" folder).
    I find various *.xml files below the nRF folder, but NO file named "nrf52_Registers.xml".

    I find, however, the files

    .../nRF/Device/Registers/nrf51.svd

    .../nRF/Device/Registers/nrf52.svd (for nRF52832)
    .../nRF/Device/Registers/nrf52810.svd and
    .../nRF/Device/Registers/nrf52840.svd
    (... as shorthand to %LOCALAPPDATA%\SEGGER\SEGGER Embedded Studio\v3\packages)
    These files are identical to the svd files found in the Nordic SDK (./modules/nrfx/mdk/*.svd) which are used by the example projects.
    I followed your request to use the file from the Nordic CPU support package by changing the setting to
    "$(PackagesDir)/nRF/Device/Registers/nrf52840.svd", and the register arrays (for example in the UICR group) are still missing.

    However, if I use the nrf52.svd file for the nRF52832, the register arrays are displayed correctly.
    The difference (apart from containing register definitions for different MCUs) is that the <dim> and <dimIncremnt> elements in the nrf52.svd file contain decimal numbers, while the corresponding elements in the nrf52840.svd file contain hexadecimal numbers.
    So it is still quite clear for me, that the Embedded Studio simply does not accept hexadecimal numbers for this elements (but for example for addressOffset or size elements, hexadecimal numbers ARE accepted).


    So I changed the hexadecimal numbers in <dim> and <dimIncrement> elements within the nrf52840.svd file contained in the Nordic SDK, and get the correct register array display.


    Regards

    Dirk
  • Hi Dirk,


    dzabel wrote:

    (the "v3" seems strange to me, I have installed the SES v4.10a, but there is no "v4" folder).
    This is due to backwards compatibility as between v3 and v4 there were no changes for package handling so the name was kept to avoid multiple package databases.


    dzabel wrote:

    I find various *.xml files below the nRF folder, but NO file named "nrf52_Registers.xml".
    You should see the file in SEGGER Embedded Studio\v3\packages\nRF\XML
    There are files nrf51_Registers.xml, nrf52_Registers.xml etc.

    It seems that your /nRF folder is a bit different for some reason. Attached you can find how it should look like.

    How did you install the nRF Package? How does your folder look like?



    dzabel wrote:

    The difference (apart from containing register definitions for different MCUs) is that the <dim> and <dimIncremnt> elements in the nrf52.svd file contain decimal numbers, while the corresponding elements in the nrf52840.svd file contain hexadecimal numbers.
    So it is still quite clear for me, that the Embedded Studio simply does not accept hexadecimal numbers for this elements (but for example for addressOffset or size elements, hexadecimal numbers ARE accepted).
    Thank you for clarification. We will discuss this internally with Nordic to see what the best solution would be.

    Best regards,
    Nino
    Images
    • Capture.PNG

      2.17 kB, 216×140, viewed 969 times
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Nino,
    thank you for spending all the time on this issue!
    It seems I had a different version of the nRF CPU Support Package installed. It looked different from your image, for example, it had a subfolder "Registers", but lacked the register files you have mentioned. I selected the package manager from the tools menu, uninstalled the nRF CPU Support Package, re-installed it and now I find the xml-files in question. Unfortunately, I did not manage to save the status before uninstalling, so I cannot say the exact version number of the previous package :( After re-installing, I have now version 1.06
    I have tried now the nRF52_Registers.xml file as well as the nRF52840_Registers.xml, and both work as expected.
    Very nice! I think I even see why they work: they don't use the <dim> and <dimIncrement>. Instead, they just enumerate all the array elements.
    Best regards,
    Dirk
  • Hello Dirk,

    Great to hear that you are up and running again.
    As the initial inquiry has been solved this thread will be closed now.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.