RAM or FLASH target?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RAM or FLASH target?

Jump to solution
1,050 Views
santoshs
Contributor II

Hi,

I want to know how to switch between RAM & FLASH for loading program while debugging in Kinetis Design Studio. I know one way by using Processor Expert. What is the other way i.e. by not using Processor Expert?

Thank you.

Santosh

1 Solution
718 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Santosh.

understand. You mean Generator_Configurations feature of processor expert.

In processor expert Generator_Configurations, choose RAM or FLASH result corresponds with different memory allocation in "build options" , thus after generating code, processor expert will generates different linker file *.ld.

one of the most important function is memory allocation.

pastedImage_2.png

However if don't use processor expert, KDS itself doesn't have exact feature. (CodeWarrior 10 has this feature but KDS not)

If user wants it, user can manually create a RAM based ld file. ( usually the default ld file is FALSH based). then create a new configuration for RAM. then switch the build configuration as I suggested in my initial response.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

5 Replies
718 Views
santoshs
Contributor II

Thanks Jennie for responding to my question. Actually, you are saying how to change build configuration for a project i.e. either Debug or Release as indicated in the image below, right?

Untitled-1.jpg

But, I want to change the target where I can load my code i.e. either RAM or FLASH. I can do this by using Processor Expert. The image below shows the same.

Untitled-2.jpg

As you can see in the Components window under Generator_Configurations we can select RAM or FLASH target for the code to load. So, my question was can I do the same without using Processor Expert?

Thanking you,

Santosh

0 Kudos
719 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Santosh.

understand. You mean Generator_Configurations feature of processor expert.

In processor expert Generator_Configurations, choose RAM or FLASH result corresponds with different memory allocation in "build options" , thus after generating code, processor expert will generates different linker file *.ld.

one of the most important function is memory allocation.

pastedImage_2.png

However if don't use processor expert, KDS itself doesn't have exact feature. (CodeWarrior 10 has this feature but KDS not)

If user wants it, user can manually create a RAM based ld file. ( usually the default ld file is FALSH based). then create a new configuration for RAM. then switch the build configuration as I suggested in my initial response.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

718 Views
santoshs
Contributor II

Thanks Jennie.

Then to prepare a RAM.ld file, what modifications can I do to the FLASH.ld file which has already been created while creating the project so that my code will directly load into RAM instead of FLASH?

What I tried out is;

  • At first, I created a project using processor expert and selected RAM target.
  • Then I created a project without using processor expert.
  • Then I replaced the contents of this project's Flash.ld file with that of the processorexpert.ld file.
  • Then when I built the project, I couldn't find any error.
  • But while debugging, the flow control goes into the HardFault_Handler.

I have no idea how to overcome this.

Thanking you,

Santosh

0 Kudos
718 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Santosh,

I don't suggest you use processor expert generated RAM based ld file to non-processor-expert project. sometimes the structure is a bit different. But you can refer the how it allocate memory with it.

I suggest you create a new project with project wizard to generate a FLASH based project, thus you can get a ld file from this project.

Now you can modify the generated ld file. revise code allocation from flash to ram. If you are not confident enough, you can check the memory allocation in processor expert generated ld file as reference.

Best Regards.

Jennie Zhang

718 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Santosh.

Normally if your project includes two configurations: RAM, FLASH. This two configurations are corresponding the different linker file.

To switch to the other configuration, we can right click on the project name in "Project Explore" window, then "Build Configurations", "set active..." to set the right configuration you want.

Hope this helps.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos