AnsweredAssumed Answered

Putting data on with DATA tag corrupting memory

Question asked by Exequiel Beker on Nov 27, 2017
Latest reply on Jan 25, 2018 by LPCX presso support

Hello everyone! I've been working with my colleagues for a while with the new version of MCUXpresso IDE, founding that the compiler throw us an error asking to put all our non-zero initialized data with the __DATA tag, instead of _BSS, which is the one that we were using until then. 

Once we changed all previous _BSS located variables, the program compiled, but not runned into the board.

After a little debugging session, we found this:

The declaration of this array is as follows:

os_mutex_t g_ssp_mutex[2] = {OS_MUTEX_NULL, OS_MUTEX_NULL};

being OS_MUTEX_NULL = 0xFF.

It's correct value, for both array members, would be 0xFF, as you can see in the next picture:

The difference between both pictures is the pressence of DATA tag in the project (Yes, in the entire project), and the IDE version (v10.1.0 [build 589] vs. v10.0.2 [build 411], which worked for us). 

I supossed that RAM could be the problem, as it's zero-initialized on startup. So, I tried to move the array to another RAM bank (in this case, to bank ram2) with similar results:

 

We are using LPC1768 MCU, with MCUXpresso v10.1.0 & v10.0.2 running on Windows 10 Enterprise x64bits. The MCU RTOS is CoOs.

 

Any idea?

 

Regards,

Exequiel Beker.

Outcomes