Define variables in ITC - values being changed afterwards

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

Define variables in ITC - values being changed afterwards

2,586 Views
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 Kudos
Reply
7 Replies

2,576 Views
Yuri
NXP Employee
NXP Employee

Hello,

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

Regards,
Yuri.

0 Kudos
Reply

2,572 Views
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 Kudos
Reply

2,562 Views
Yuri
NXP Employee
NXP Employee

@ping1 
Hello,

   is FlexSPI XIP applied in Your configuration?

Regards,
Yuri.

Tags (1)
0 Kudos
Reply

2,558 Views
ping1
Contributor V

Hi, Yuri

Thanks for reply!

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

Regards!

Ping

0 Kudos
Reply

2,458 Views
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 Kudos
Reply

2,441 Views
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 Kudos
Reply

2,431 Views
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 Kudos
Reply