Executing Flash programmed application

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

Executing Flash programmed application

Jump to solution
1,455 Views
vishalannigeri
Contributor I

Hi,

I have created the flash program which contains multiple elfs. When I select execute from Target Task, program is getting loaded and verified. However I don't see anything on the debug window, the way it works loading and running an application from project window. Am I missing anything, could you please help.

 

Thanks.

Labels (1)
0 Kudos
1 Solution
784 Views
marius_grigoras
NXP Employee
NXP Employee

Hi Vishal,

My comments step-by-step are:

1) 2) 3) - are ok

4) This is normal because at the previous steps you used the explication downloaded in a volatile memory (RAM). When a ROM launch is used this will attach to the target and you can  debug an application who just boot up from a flash device (non-volatile memory).

5) Flash Programmer cannot run using a ROM configuration. For running the FP you'll need a memory already initialized, that's why is mandatory to use SRAM or RAM Download launches.

6) You can program any application, but before that make sure you erased the desired zone from flash.

7) Just after you'll flash the application using FP + RAM target, you'll be able to debug it using next steps:

a. attach using ROM target

b. Reset using CW

c. You're now at the entry_point of your app (with PC = 0xffff_fffc).

Another mandatory step - note that an application which is running from RAM memory will not run just as it is from flash! There are different reasons:

1. There are some specific initialization flows for every specific memory: flash vs RAM

2. The memory addresses from elf need to be different/ specific per memory where you want to execute your app.

3. Depends by your application this can be relocated to RAM (all the code + data (like the u-boot) or only the data) - please take a look in our ROM app from stationary project to see the differences between it and the RAM on.

Thank you,

Marius

View solution in original post

0 Kudos
10 Replies
784 Views
vishalannigeri
Contributor I

Hi Marius,

  Thanks a lot for the suggestion. Today, I was able to test and execute the application from ROM based on above suggestion. I could not respond last week as I was not able to test due to my system issue. 

Thanks,

-Vishal

0 Kudos
785 Views
marius_grigoras
NXP Employee
NXP Employee

Hi Vishal,

My comments step-by-step are:

1) 2) 3) - are ok

4) This is normal because at the previous steps you used the explication downloaded in a volatile memory (RAM). When a ROM launch is used this will attach to the target and you can  debug an application who just boot up from a flash device (non-volatile memory).

5) Flash Programmer cannot run using a ROM configuration. For running the FP you'll need a memory already initialized, that's why is mandatory to use SRAM or RAM Download launches.

6) You can program any application, but before that make sure you erased the desired zone from flash.

7) Just after you'll flash the application using FP + RAM target, you'll be able to debug it using next steps:

a. attach using ROM target

b. Reset using CW

c. You're now at the entry_point of your app (with PC = 0xffff_fffc).

Another mandatory step - note that an application which is running from RAM memory will not run just as it is from flash! There are different reasons:

1. There are some specific initialization flows for every specific memory: flash vs RAM

2. The memory addresses from elf need to be different/ specific per memory where you want to execute your app.

3. Depends by your application this can be relocated to RAM (all the code + data (like the u-boot) or only the data) - please take a look in our ROM app from stationary project to see the differences between it and the RAM on.

Thank you,

Marius

0 Kudos
784 Views
vishalannigeri
Contributor I

Hi,

I tried below steps:

1) I am using elf which is outside of CW.

2) In the debug configuration, I have selected RAM p2020 Download mode and pointed the elf for loading.

3) After loading the elf to target P2020, on the debugger window execution stopped at the entry point of main. From this point onwards, I was able to perform step by step debugging and was able to monitor data on the serial port.

4) When I selected any other configuration other than above, I dont see program being executed or not able to perform debug step by step.

5) In target tasks, Added task with "run configuration" as ROM attach. K9NBG08U5M-eLBC device selected for flash programming with target RAM address 0x00400000, size 0x00020000

6) For flash programmer actions, selected the elf(which was successfully executed earlier) with Program.Saved target task.

7) Execution of flash program, programmed the elf however I dont see anything running.

Am I missing any step? Please help.

Thanks,

-Vishal.

0 Kudos
784 Views
vishalannigeri
Contributor I

Hi Marius,

  Thanks for the suggestions. I will check this and respond.

Thanks,

-Vishal.

0 Kudos
784 Views
marius_grigoras
NXP Employee
NXP Employee

Hi Vishal,

After you make the flash programming stuff, you should make a ROM  download debug (make sure your project uses the elf flashed previously for having all the debug capabilities in place).

Use the ROM launch, reset the board using the reset from CW. Being with PC at reset address (0xFFFFFFFC) you can continue with debugging your elf. An example can be seen using the ROM target from our stationary P2020DS project).

Regards,

Marius

0 Kudos
784 Views
vishalannigeri
Contributor I

Hi Lunmin and Marius,

  I am trying to execute an application which consists of multiple elf. I found an approach at  Flash two .elf files using CodeWarrior 10.6 . Steps followed as below:

1) Created empty project for debugging purposes.

2) Created new target task for adding elfs to flash.

3) Selected K9NBG08U5M-eLBC as flash device( I found similar kind of flash device supports p2020ds).
4) Added three elfs which is already created and added action as program verify(One of the elf which I have loaded using download mode, I was able to perform step by step debug).

5) When I have executed the new target task, I observed that program being updated and verified.

I was expecting, execution of application in debug window and was planning to do step by step execution. However I did not find anything running on debug window.

Thanks a lot for your help!.

-Vishal.

0 Kudos
784 Views
lunminliang
NXP Employee
NXP Employee

Hello Vishal Annigeri,

Could you please describe clearly what would you like to do?

Did you try to use flash programmer in CodeWarrior? Or do you want to use yourself elf to execute on target and program the flash?

Plese kindly provide your steps and your purpose.

Regards

Lunmin

0 Kudos
784 Views
marius_grigoras
NXP Employee
NXP Employee

Hi Vishal,

Your applications are based on our ROM example? This is mandatory and also is needed  to write the elf in the last part of the flash (is the device is a NOR).

Thank you,

Marius

0 Kudos
784 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

to solve your problem, we need to know:

1.  the MCU part number.

2. your CW version.

3. your code is downloaded to target and it can run normally,  correct?

4. what do you expect to see in debug window?


Have a great day,
Jennie Zhang

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

0 Kudos
784 Views
vishalannigeri
Contributor I

Hi Jennie,

   Thanks for responding to my query.

I am using P2020DS board and Code warrior version 10.5.1. I have selected Flash devices as K9NBG08U5M-eLBC(when I searched, I found similar flash device supported for p2020ds).

  Code is loaded correctly, however not sure whether it is running correctly as I don't see anything. When I have loaded just one elf in debug mode, execution control reached to main function call and from there I was able to executed function by function. I was hoping something similar would occur when I load three elfs using Flash Programmer.

Thanks,

-Vishal.

0 Kudos