Monday, December 11th 2017, 10:11am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

markuskrug

Beginner

Date of registration: Oct 19th 2016

Posts: 11

1

Friday, November 10th 2017, 3:36pm

SAME70 TCM setting

Dear all,

anyone already tried to setup a TCM segment in the linker file and modified the startup code accordingly?

Best Regards
Markus

gpontis

Beginner

Date of registration: Dec 18th 2007

Posts: 44

Location: California

2

Friday, November 10th 2017, 4:58pm

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

markuskrug

Beginner

Date of registration: Oct 19th 2016

Posts: 11

3

Saturday, November 11th 2017, 1:35am

Dear George,

you approach sounds quite sophisticated. It would be great if you can share some ideas and snippets.

Best Regards
Markus

gpontis

Beginner

Date of registration: Dec 18th 2007

Posts: 44

Location: California

4

Wednesday, November 15th 2017, 4:52pm

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
gpontis has attached the following file:
  • tcm handling.zip (2.39 kB - 19 times downloaded - Last download: Dec 9th 2017, 12:17am)

markuskrug

Beginner

Date of registration: Oct 19th 2016

Posts: 11

5

Wednesday, November 22nd 2017, 9:57am

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