MCUXpresso IDE v11.6.1 binary output vs MCUXpresso IDE v11.2.1 binary output

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

MCUXpresso IDE v11.6.1 binary output vs MCUXpresso IDE v11.2.1 binary output

5,093 次查看
bomba82
Contributor I

I recently downloaded MCUXpresso IDE v11.6.1. I have been using LPCXpresso since 2013, then I am quite familiar with the IDE. Despite this I have to ask for information that will appear as a neophyte. I can't understand why I get different binary outputs when building my project in v11.6.1 and in v11.2.1.

Actually, gcc compiler version is different, then it may make sense that I get different outputs. On v11.6.1 I have gcc version 10.3.1, whilst on v11.2.1 I have gcc version 9.2.1. What does not make sense to me is tha fact that I can successfully use IAP programming using the one compiled with older IDE and I cannot with latest IDE. I already lost a lot of time to find out that the issue didn't come from my C code, but from the build itself. Now I want to understand how to make latest version work for me. I checked the preferences in both environments and I can't see any clue. 

Any suggestions so far?

I attach the preferences exported from both versions. (changed epf to txt, since not accepted by the forum)

I also attach the .hex files, where you can see that the output of the very same project is totally different. 

(changed hex to txt, since not accepted by the forum)

 

0 项奖励
回复
6 回复数

5,078 次查看
jay_heng
NXP Employee
NXP Employee

It doesn't make sense to compare two binaries from different version of compilers.

Can you debug you project under MCUX v11.6.1? Where does the code fail?

0 项奖励
回复

5,067 次查看
bomba82
Contributor I

I can debug the project and the code does not fail. I mean, the result of Chip_IAP_* functions is IAP_CMD_SUCCESS. Even the "Chip_IAP_Compare" returns IAP_CMD_SUCCESS. But, if I check the content of memory right after, I read 0xFFFFFFFF on any location that should have been written. 

Here are the lines of code I refer to:

__disable_irq();
if (Chip_IAP_PreSectorForReadWrite(APP_START_SECTOR, APP_END_SECTOR) == IAP_CMD_SUCCESS)
{
	if (Chip_IAP_CopyRamToFlash(flashAddress, (uint32_t *)pu8Data, u16Len) == IAP_CMD_SUCCESS)
	{
		//Check that the write was successful
		if (Chip_IAP_Compare(flashAddress, (uint32_t)pu8Data, u16Len) == IAP_CMD_SUCCESS)
		{
			//Write was successful
			retCode = 1;
		}
	}
}
__enable_irq();

 

0 项奖励
回复

5,060 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

How did you  read 0xFFFFFFFF on any location ?

How about  reading flash address directly, not using IDE memory view.

 

 

BR

Alice

0 项奖励
回复

5,057 次查看
bomba82
Contributor I

Hello,

my application is a custom bootloader and it is limited to address location 0x0000 - 0x3FFF. Using the IDE memory view, I can see all locations starting from 0x4000 read 0xFFFFFFFF, despite having programmed my final application starting from that memory location. I also have the option to use my bootloader to read content from memory, and it returns 0xFF for every byte starting from 0x4000. This is happening if I use IDE v11.6.1. Everything works properly using v11.2.1: both IDE memory view or asking to read data using my own bootloader returns the binary data of my target application.

BR,

Alberto

0 项奖励
回复

5,051 次查看
ErichStyger
Specialist I

Hi Alberto,

how did you program the file to your target? Using the GUI Flash Tool (https://mcuoneclipse.com/2017/05/06/using-eclipse-to-program-binary-files-to-an-embedded-target/)?

Keep in mind you would have to provide an offset if using a bin file.

 

I hope this helps,

Erich

0 项奖励
回复

5,025 次查看
bomba82
Contributor I

Hi Erich,

I checked again my board before replying.

This is what I have:

1) A custom bootloader: Addr. 0x00000, 0x03FFF

2) A "target application": Addr. 0x04000, 0x70000

uC is LPC1768, with 512kB Flash. I use 0x70000 to 0x7FFFF for Flash based non-volatile storage 

Each time I program a bootloader, on either IDE version, I run a mass erase, to start each time from same situation, that is memory content is all 0xFF, from 0x00000 to 0x7FFFF.

With version 11.2.1, I can:

1) Program bootloader using GUI Flash Tool

2) Program my target application via my custom bootloader: everything goes on like everything is fine, but actually the content of memory does not change

3) Verifying the content of memory I get the right data both using my custom bootloader or using the IDE Debug and Memory view

With version 11.6.1, I can:

1) Program bootloader using GUI Flash Tool

2) Program my target application via my custom bootloader ()

3) Checking the content of memory gives me all 0xFF

4) If I program my target application using GUI Flash Tool, then I can read back the right data, both using my custom bootloader or using the IDE Debug and Memory view

 

As per what I can understand writing FLASH using Chip_IAP_* functions fails, although each call returns success. From LPC176x-5x User Manual, chapter 32.3.2.8: "Flash programming commands use the top 32 bytes of on-chip RAM. The maximum stack usage in the user allocated stack space is 128 bytes and it grows downwards.". I reserved RAM for IAP functions, on both environments. As mentioned before, everything is the same, except the binary output and the mulfunction only when building in 11.6.1.

 

@ErichStyger: I am a reader of your blog. Nice to "meet" you. I am in Switzerland too

0 项奖励
回复