SAME70 TCM setting

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

  • Hi Markus,
    I did this and am developing an application based on it. It took some effort, which would have been less effort if the process of generating a linker command file was better documented. Or better yet, when Segger rolls out their own linker to replace gnu ld. In any case, I was going for a design that would always start up no matter how the GPNVM bits were programmed. I wrote C code that looks at linker defined symbols to determine how much TCM is required by the application. If the existing GPNVM configuration does not match, it reprograms the GPNVM bits as needed and restarts. I had to modify the startup code to ensure that a valid stack would always be available when the call to the GPNVM checking / programming is done. I've not put any code into the ITCM yet, but I do put all the task stacks and other data into the DTCM. I can post some code snippets later if you are interested.
    George
  • Hi Markus,
    Here is the code that I used. It has not been much tested but does appear to work properly in my environment. In particular it adjusts the top of the stack downward, if necessary, to ensure that the firmware can always start up enough to call into a C function, no matter how the GPNVM bits are set. It would be easiest to post my thumb_crt0.s file but am not doing so due to copyright. Instead I posted my additions and some notes that I think are sufficient to see what is being done, and duplicate it if desired.
    George
    Files
    • tcm handling.zip

      (2.39 kB, downloaded 460 times, last: )
  • Dear George,

    sorry for the late reply. I was a few days off.
    Thanks for the example. I will have a closer look and try to adopt it to my project tomorrow and Friday. I will let you know what happens.

    Best Regards
    Markus