Set different Memory configuration according the "Build Configuration"

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

Set different Memory configuration according the "Build Configuration"

跳至解决方案
1,854 次查看
arnogir
Senior Contributor II

Hello

 

I'm using MCUXpresso v11.6 with an MKL33Z256.

 

I have two "Build configuration":

- Debug

-Release (=Debug but with code optimization)

 

I would also modify the Memory mapping between Debug and Release configuration. Because the Debug is run alone (start at 0x0), and in build release, it will load by a Bootloader. Then the application code not start at 0x0( because it will be the Bootloader) but at another address (The boot will jump to the application and set the offset value of the Vector table)

 

But into MCUXpresso, the memory configuration seem not be configurable for each "Build configuration".

 

I have a way to resolve this problem?

 

Regards

0 项奖励
1 解答
1,848 次查看
ErichStyger
Senior Contributor V

Hi @arnogir ,

Yes, the memory configuration is bound to the project and not to the build configuration (this is still a pending feature request from my side).

I faced a similar situation as you, and needed to have different memory/linking map. What my solution was is using the built-in FreeMarker scripts, and wrote about it here:

https://mcuoneclipse.com/2019/10/06/linking-bootloader-applications-with-eclipse-and-freemarker-scri...

Maybe this would work for you too?

I hope this helps,

Erich

在原帖中查看解决方案

0 项奖励
5 回复数
1,820 次查看
scott_thompson
Contributor III

I have just experience the same issue--ported a huge IAR project over to MCUXpresso only to find that after creating my bootloader suddenly my FW application wouldn't fit into the memory needed by the bootloader.  I was not expecting the MCU memory regions to be global and not attached to a build configuration--this is bad practice and I can't believe we're on V11 of MCUXpresso and this issue remains.

The work-around provided will probably work, but mine will be to simply export the memory region for the bootloader, capture the managed script with its customized locations (which DOES work with build configurations!), then repeat for the FW application and re-generate the memory region for it, export for prosperity, etc.  

Let me know how to submit this (ahem) "feature" request--what a vast oversight this should be built into the build configuration from the start.  Fail.

0 项奖励
1,838 次查看
arnogir
Senior Contributor II

Hello,

I see your topic.

I must evaluate this, but to resume, It would be easier if MCUXpresso could have different memory maping according configuration.

 

Thank for your help and your detailed topic.

 

0 项奖励
1,837 次查看
arnogir
Senior Contributor II

Hello,

 

I can't make the check today and I will test tomorow,

 

But maybe this "Offset" is the solution?:

arnogir_0-1663143075026.png

 

0 项奖励
1,834 次查看
ErichStyger
Senior Contributor V

that offset is added to the symbols you load. This is useful if you have linked the binary to a given address, but then in memory you load it to an offset of this. That way the debugger can correlate addresses with symbols.

0 项奖励
1,849 次查看
ErichStyger
Senior Contributor V

Hi @arnogir ,

Yes, the memory configuration is bound to the project and not to the build configuration (this is still a pending feature request from my side).

I faced a similar situation as you, and needed to have different memory/linking map. What my solution was is using the built-in FreeMarker scripts, and wrote about it here:

https://mcuoneclipse.com/2019/10/06/linking-bootloader-applications-with-eclipse-and-freemarker-scri...

Maybe this would work for you too?

I hope this helps,

Erich

0 项奖励