iMX RT1062 Data only written to memory when stepping in the debugger

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

iMX RT1062 Data only written to memory when stepping in the debugger

186 Views
expertsleepers
Contributor III

I have an issue where data is apparently only being written to memory when the code is stepped in the disassembly view of the debugger.

It feels like a cache coherency thing, but I can't imagine how, since I'm not using any DMA etc. The CPU is simply reading and writing the on-chip memory.

The code simply looks like this:

memset( check, 0, sizeof check ); 
flash::read( flash::ADDR_SERIAL_NUMBER, check, sizeof check );

Inside read() it's just

uint8_t* dst = (uint8_t*)data; dst[rxi] = rx;

If I step through that in the disassembly, I can see the strb instruction write the data. But if I just let it run over the whole read(), nothing is written to check[]. It's not incorrect data; it's whatever data is there before the function call.

This seems to happen more when the amount of data read is small, which again feels like a cache thing (larger reads knocking out cache lines).

I've experienced the same with the data array in SRAM_DTC and in SRAM_OC2. The fact that it happens with tightly-coupled memory is extremely baffling.

Any suggestions welcome.

 

Labels (1)
0 Kudos
4 Replies

123 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @expertsleepers ,

 

May I have the IDE version used with the board? I guess the board is an EVK board, right? Please kindly clarify.

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

120 Views
expertsleepers
Contributor III

MCUXpresso IDE v11.9.0 [Build 2144] [2024-01-05]

I'm not working with an EVK board - it's our production hardware design.

 

0 Kudos

49 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @expertsleepers ,

 

Is it possible to share your code for a review? I will try to reproduce this issue here.

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

39 Views
expertsleepers
Contributor III

I can't share the whole project, but the function in question is attached.

 

0 Kudos