Define variables in ITC - values being changed afterwards

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Define variables in ITC - values being changed afterwards

1,562件の閲覧回数
ping1
Contributor V

Hi, all

I defined a array in ITC by using macro like below: 

__DATA(SRAM_ITC) volatile uint8_t myArray[ARRAY_SIZE];

and it has been allocated to address 0 - beginning of the ITC.

initially works fine, but after running a while the values changed, I wonder why. 

Can I use the ITC region to save my variable at all?

I use RT1024, own target board.

Regards!

Ping

0 件の賞賛
7 返答(返信)

1,552件の閲覧回数
Yuri
NXP Employee
NXP Employee

Hello,

   is it possible to look at linker and (address) map files?

Regards,
Yuri.

0 件の賞賛

1,548件の閲覧回数
ping1
Contributor V

Hi, Yuri

Thanks for reply.

I have attached map files and linker files generated. The variable is called EepromStore[ ], and I can see it is located on line 16781 like below:

*(SORT_BY_ALIGNMENT(.ramfunc.$RAM3))
*(SORT_BY_ALIGNMENT(.ramfunc.$SRAM_ITC))
*(SORT_BY_ALIGNMENT(.data.$RAM3))
.data.$RAM3 0x00000000 0x1400 ./source/GEeIo.o
0x00000000 EepromStore

I put it there as I don't want it to be in cache area.

I also need to change OCRAM to be noncache, as I need to use that area and don't want variables to be changed without my knowledge. Do I need to modify the BOARD_ConfigMPU(void)? It is default as evaluation board.

Regards!

Ping

 

 

0 件の賞賛

1,538件の閲覧回数
Yuri
NXP Employee
NXP Employee

@ping1 
Hello,

   is FlexSPI XIP applied in Your configuration?

Regards,
Yuri.

タグ(1)
0 件の賞賛

1,534件の閲覧回数
ping1
Contributor V

Hi, Yuri

Thanks for reply!

Yes, I use RT1024, and flash XIP is enabled.

Regards!

Ping

0 件の賞賛

1,434件の閲覧回数
Yuri
NXP Employee
NXP Employee

@ping1 
Hello,

  Are interrupts used in the system?
The interrupt vector table and a couple of critical interrupt service routines must be placed in the ITCM.

Regards,
Yuri.

0 件の賞賛

1,417件の閲覧回数
ping1
Contributor V

Thanks Yuri

Yes, there are interrupts used in the system. I think ISRs are located in flash area as I use RT1024 with XIP, I think  IVT is located in flash are too - can be seen from map file. let me know if I am wrong.

Does this mean ITC is free to use for user variables? otherwise what is it used for if all variables are default to be in DTC?

Regards!

Ping

0 件の賞賛

1,407件の閲覧回数
Yuri
NXP Employee
NXP Employee

@ping1 
Hello,

  On system reset, the vector table is at the address configured at implementation, typically 0x00000000. Privileged software can write to the VTOR to relocate the vector table start
address to a different memory location.

  https://developer.arm.com/documentation/dui0646/c/the-cortex-m7-processor/exception-model/vector-tab...

  I think it is good practice to use the DTC for  all variables.

Regards,
Yuri.

0 件の賞賛