MCX-A346: Core State at Program Start

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MCX-A346: Core State at Program Start

216 次查看
ygrayne
Contributor II

The Cortex-M33 core is not actually documented in the reference manual for the MCX-A346, I assume since we can refer to ARM's corresponding technical ref manual. Fair enough. However, the state of the core as encountered when my program gets control (initial PC value at address 0x4) is different from what is defined as reset state in ARM's manual. Assuming that the core hardware is implemented according to the specs, I suppose it's the boot ROM code that leaves behind the non-conforming state [1].

Is this initial core state documented, and if yes, where? Thanks.

[1] Examples:

1) PRIMASK = 1

2) The FPU is enabled, but worse, CONTROL.FPCA = 1, ie. indicating the use of FPU instructions before my code runs. Now every exception in thread mode is tainted by this flag, resulting in an extended stack frame including the FPU registers even if my code does not use any FPU instructions, which wastes stack memory (thanks to lazy stacking the run-time overhead is minimal).

Of course, both of these issues can be resolved in my initialisation code. It would just be helpful to have this, and possibly other such cases I have yet to "discover", documented.

 

标签 (2)
0 项奖励
回复
2 回复数

74 次查看
Harry_Zhang
NXP Employee
NXP Employee

Hi @ygrayne 

I am not sure if this is what you are looking for, please check the B1.6 chapter in the attached document or the following link.

Arm Cortex-M33 Devices Generic User Guide r0p4

In the MCXA Reference manual we have Table 112 with the User Image Header that also may contain useful information.

Regarding the PC, if you are looking into the address 0x4 this is the initial program counter and always will be loaded after the reset in core PC register, this value is different depending on the MCU and some other variables.

I hope this will help.

BR

Harry

0 项奖励
回复

162 次查看
Harry_Zhang
NXP Employee
NXP Employee

Hi @ygrayne 

Regarding whether the bootrom has changed the states of PRIMASK and CONTROL.FPCA,
I need to confirm with the ROM team.

BR

Harry

0 项奖励
回复