Author Topic: Cortex-M7 vs ARM926EJ-S: which is more useful?  (Read 12550 times)

0 Members and 1 Guest are viewing this topic.

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Cortex-M7 vs ARM926EJ-S: which is more useful?
« Reply #25 on: April 17, 2017, 11:55:02 pm »
Then how do I write the linker scripts to put code in ITCM? I can memcpy code over but the pointers needs to be fixed.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11263
  • Country: us
    • Personal site
Re: Cortex-M7 vs ARM926EJ-S: which is more useful?
« Reply #26 on: April 17, 2017, 11:57:33 pm »
Then how do I write the linker scripts to put code in ITCM? I can memcpy code over but the pointers needs to be fixed.
In a linker script you specify where your code will be located (address within ITCM). This will make linker put correct addresses for that memory, but they will obviously be wrong for the flash. But that code will never be executed from flash, so it is fine.

Then, you just do memcpy(), after you set up ITCM.
Alex
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Cortex-M7 vs ARM926EJ-S: which is more useful?
« Reply #27 on: April 18, 2017, 12:12:49 am »
What if the thing I want to put in ITCM is the entire program? Write a stub to copy the bulk of the code over?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11263
  • Country: us
    • Personal site
Re: Cortex-M7 vs ARM926EJ-S: which is more useful?
« Reply #28 on: April 18, 2017, 12:14:13 am »
What if the thing I want to put in ITCM is the entire program? Write a stub to copy the bulk of the code over?
Yes. Your startup code will have to be in flash.
Alex
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Cortex-M7 vs ARM926EJ-S: which is more useful?
« Reply #29 on: April 18, 2017, 12:31:31 am »
What if the thing I want to put in ITCM is the entire program? Write a stub to copy the bulk of the code over?
Yes. Your startup code will have to be in flash.
So I basically need to create a bootloader that copies code over to ITCM and jump into it? What else should I do inside this bootloader?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11263
  • Country: us
    • Personal site
Re: Cortex-M7 vs ARM926EJ-S: which is more useful?
« Reply #30 on: April 18, 2017, 12:34:33 am »
It is not really a bootlaoder, it is your normal startup code (reset vector). It should what any other startup code does - initialize DATA and BSS segments, relocate vector table and stack pointer, and then jump to main.

Optionally, you can initialize some other hardware, but it all can be done from main().
Alex
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Cortex-M7 vs ARM926EJ-S: which is more useful?
« Reply #31 on: April 18, 2017, 12:44:35 am »
My usual startup code sets up the clocks, copies data segment over to the RAM locations, zeros BSS, and calls libc _start(). Now how do I do that with ITCM involved?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11263
  • Country: us
    • Personal site
Re: Cortex-M7 vs ARM926EJ-S: which is more useful?
« Reply #32 on: April 18, 2017, 01:12:35 am »
My usual startup code sets up the clocks, copies data segment over to the RAM locations, zeros BSS, and calls libc _start(). Now how do I do that with ITCM involved?
Add ITCM initialization and in addition to data segment, copy the code. The same exact way as you do for data.

IC vendors have application notes on this. Atmel does for sure, I just don't remember the number.
Alex
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf