[SOLVED] Setting one location to a specific value

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

  • [SOLVED] Setting one location to a specific value

    I'm using SES to develop some code on the ADuCM410. The m410 requires that location 0x1FFC be set to either 0xFFFFFFFF or to the checksum for page 0. This post is to leave breadcrumbs for other people who stumble across this problem, and to ask if someone has better solutions.

    This should be a fairly straightforward process, and I eventually was able to set it to 0xFFFFFFFF, albeit in a rather inelegant manner. I ran into some interesting holes in the documentation.

    I was able to find articles on the linker, and was eventually able to find determine that the linker files are named .icf, and from that narrow down which of the .icf file that had been created in my attempts to learn SES that actually applied to this project. It would be very nice if the documentation explicitly mentioned these things, and how to find the location of the linker file from within the SES project.

    It would also be nice to find better documentation on how to explicitly set a particular location to a particular value. Or, if this has been done, some easy to find collection of pointer to example configurations.

    FWIW this was my solution, but it seems to leave post of Page 0 blank. The m410 has a page0 checksum baked into the hardware and without it being disabled with all 1s, or a valid checksum, the J-link was not even able to talk to the eval board until I used something else to erase the flash entirely.
    If someone else wrestling with the m410 runs across this issue, if I manually wrote FFs into the 4 bytes using the memory tool before I ran code, then the system would not lock out.


    //
    // Combined regions per memory type
    //
    define region FLASH = FLASH1;
    define region RAM = RAM1;
    define region PAGE0_CHECKSUM = [from 0x1ffc size 4];


    Also:
    //
    // Explicit placement in FLASHn
    //
    place in FLASH1 { section .FLASH1, section .FLASH1.*, section .page0_checksum };
    //
    // FLASH Placement
    //
    //
    // Explicit placement of page 0 checksum
    //


    place in PAGE0_CHECKSUM { symbol page0_checksum };


    place at start of FLASH { block vectors }; // Vector table section
    //place at address 0x1ffc { section .page0_checksum }; // must be 0xFFFFFFFF or checksum
    place in FLASH with minimum size order { block tdata_load, // Thread-local-storage load image
    block exidx, // ARM exception unwinding block
    block ctors, // Constructors block
    block dtors, // Destructors block
    readonly, // Catch-all for readonly data (e.g. .rodata, .srodata)
    readexec // Catch-all for (readonly) executable code (e.g. .text)
    };
  • Hello,

    Thank you for your inquiry.
    Also thank you for the documentation feedback on the linker. I agree that it could be better explained where to find which filename is used by SEGGER Linker and how to access it easily within Embedded Studio.
    For completion, to easily navigate to your linker script file simply right click your project in the Embedded Studio project explorer and select "Edit Linker Script".

    A general documentation of the SEGGER Linker can be found here:
    segger.com/doc/UM20005_Linker.html

    More specific use cases can be found on our Wiki:
    wiki.segger.com/Embedded_Studio

    There you will find the following article which explains how to place a checksum by using Embedded Studios built in integrity check capabilities:
    wiki.segger.com/Integrity_chec…_Studio_and_SEGGER_Linker

    However this is only one way to achieve this. You can of course also do what you were doing. Just as an additional pointer we recommend to give the symbol a keep property for the linker, otherwise the linker may have the choice to optimize away the page0_checksum as it is not used in code anywhere.

    Another way of achieving this is to place the symbol in a section that is placed at a specific address instead of using regions. But in the end it comes down to what fits your usecase best.


    lcolen wrote:

    FWIW this was my solution, but it seems to leave post of Page 0 blank. The m410 has a page0 checksum baked into the hardware and without it being disabled with all 1s, or a valid checksum, the J-link was not even able to talk to the eval board until I used something else to erase the flash entirely.
    This is not known to us and should of course not happen.
    Curious how Analog did not notify us about this danger. Either way we will investigate this and see if this can be improved on J-Link side.

    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.