Mcuexpresso debug startup

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

Mcuexpresso debug startup

Jump to solution
1,297 Views
rans
Senior Contributor I

Hello,

In MCUXpresso IDE user guide section 16.4 it is said "

MCUXpresso ide startup code copy the code into the first bank of ram"

Is it that this copy is deteemined according to linker configuration  ? And is it not also done in every boot from flash (using the same linker cpnfiguration), or is it that this copy is done only whe we do mcuxpressi debug?

Thank you

Ranran

1 Solution
1,055 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Why do you think the diagram suggests it is something to do with debugging? And just to confirm, which diagram are you actually looking at?

Initialisation of data is a combination of the startup code embedded within your application code using the information that is generated for it to use by the linker (based on the linker scripts that are generated for your project).

Regards,

MCUXpresso IDE Support

View solution in original post

4 Replies
1,056 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Why do you think the diagram suggests it is something to do with debugging? And just to confirm, which diagram are you actually looking at?

Initialisation of data is a combination of the startup code embedded within your application code using the information that is generated for it to use by the linker (based on the linker scripts that are generated for your project).

Regards,

MCUXpresso IDE Support

1,055 Views
rans
Senior Contributor I

Hi,

I refer to figure 16.3, and section 16.4

16.4 Default Image Layout
Code and initial values of initialised data items are placed into first bank of Flash (as show in
memory configuration editor). During startup, MCUXpresso IDE startup code copies the data into
the first bank of RAM (as show in memory configuration editor), and zero initializes the BSS data
directly after this in memory. This process uses a global section table generated into the image
from the linker script.
Other RAM blocks can also have data items placed into them under user control, and the startup
code will also initialize these automatically. See later in this chapter for more details.
Figure 16.3. Default Memory Layout
Note: The above memory layout is simply the default used by the IDE’s managed linker script
mechanism. There are a number of mechanisms that can be used to modify the layout according
to the requirements of your actual project – such as simply editing the order of the RAM banks
in the Memory Configuration Editor. These various methods are described later in this chapter

Anyway, now I understand that the the diagram and explanation is just an example, and the behaviour depens on linker.

Thank you,

ranran

0 Kudos
1,055 Views
lpcxpresso_supp
NXP Employee
NXP Employee

The copying of default values for your data out of flash into RAM has nothing to do with whether you are debugging or not. The startup code is embedded within your application code. So it will run whenever the MCU with that code is flash is reset / powered up.

Regards,

MCUXpresso IDE Support

0 Kudos
1,055 Views
rans
Senior Contributor I

I think the diagram in user guide is a bit confusing, because just as you said, it has nothing to do with debugging (actually nothing to do with MCUXpresso), i.e. it is only a linker issue, and actually if the linker will leave the data in flash, so there will be no copy at all of data to RAM...

Thank you,

ranran

0 Kudos