MCU Settings should be configuration dependent and not the same across all configurations

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

MCU Settings should be configuration dependent and not the same across all configurations

1,321 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by linusv on Tue Jul 07 19:25:05 MST 2015
Here is the scenario :

I am building code that caters for code that can be run starting on location 0x0000 when the code is being debugged using the lpcexpresso,
but should also be able to generate code that can be downloaded via a bootloader.

Unfortunately everything I switch between configurations from bootloader code to flash code I have to manually re-enter the MCU settings in particular the start address.

So this could be labeled as a nice to have , but if one considers that this problem is double as I am dealing with a dual-step bootloader process  between two it
does actually become a real nuisance.

I am hoping that I missed the point and that there a way to do this.

Thanks in advance for your help.

lv
0 Kudos
6 Replies

962 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ashgupta28 on Mon Sep 07 23:48:17 MST 2015
Thanks, I have also tried both the projects linked to the common source folder that is outside the project folder but inside the workspace

In this scenario, both the projects asserts shows the complete path of the file making the binary size larger However both the binary are same in size but larger than the binary that can be created if source is inside the project folder.
assert shows at ASSERT at LINE 212 in file C:\Users\Projects\Source\file.c


Is it possible for both buildable projects using common linked references asserts do not show complete path & show just the path in workspace-> ..Source\file.c. that will help me in reducing a lot amount of code size.

Thanks in advance,
Ashish Gupta
0 Kudos

962 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Sep 07 05:39:01 MST 2015
In that case, I would suggest that you put your shared files into a complete separate non-buildable project.

File - New - Project - General - Project


You can then use linked references into this from both of your buildable projects.

Regards,
LPCXpresso Support
0 Kudos

962 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ashgupta28 on Mon Sep 07 00:41:11 MST 2015
Thanks, I also found out while looking out my binary that the difference is with the source path file.

Now how do i make the common source path name for both the projects. Suppose if i am asserting at certain line in same projects.
For project A(source folder is inside Project A folder), assert shows at ASSERT at LINE 212 in file ..Source\file.c
For project B(source folder is outside Project B folder), assert shows at ASSERT at LINE 212 in file C:\Users\Project\Source\file.c

0 Kudos

962 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Sep 03 06:53:17 MST 2015

The.debug_line, .debug_macro, .debug_str, and .debug_info sections are DWARFinformation used by a debugger. Probably the main difference is the path length to the source file. You're only concerned with code/data size, and provided the same tool options are used these should be equivalent.

Thanks and regards,
LPCXpress Support
0 Kudos

962 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ashgupta28 on Thu Sep 03 04:07:59 MST 2015
Hello,

Actually i am trying the same steps to create 2 binaries(Bank A & Bank B) from single source code.
But i am getting different binary sizes for both. The data & bss sections both are same for both binaries but text section is different. While comparing the map files for both the projects, i found out that -debug_macro, .debug_line, .debug_str, .debug_info sizes are different.

Here if source folder is inside Project A folder, binary is different ( text section ) than the binary created from the project B where source folder is outside the project folder. Consider project B is linked to source folder of project A. Here both project are in same workspace.

Please suggest is something is missing from my end. I am using LPCxpresso 7.8 version

Thanks in Advance,
Ashish Gupta
0 Kudos

962 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Jul 08 01:12:00 MST 2015
The best way to handle your requirements is to have two (or more) projects, with the source folder linked to the 'master' project using linked resources. Linked resources allow you to link a folder in one project into a folder in another. This is similar to a linux symbolic link. You can have a many linked folders as you need - there is no limit.

By using two projects and a linked folder, you get a single copy of your sources (editable from both projects) but with different project (and MCU) settings. It is fully compatible with source code control systems, such as Git or SVN. Details on linked resources can be found in the Help (Help->Help Contents and search for Linked Resources).

A simple way to create your 2nd project with a linked folder is as follows:
[list]
  [*] Use the New Project Wizard to create a project with the appropriate settings
  [*] delete the src folder
  [*] Right-click on the project and File->New->Folder
  [*] Enter src into the Folder name
  [*] Press the Advanced>> button
  [*] Click on "Link to alternate location (Linked folder)"
  [*] Press "Variables"
  [*] In the new Dialog, select the WORKSPACE entry
  [*] press the Extend button
  [*] a Browser is shown - browse to the src folder in your 'master' project
  [*] Press OK
  [*] Press FInish
[/list]
You new project will now have a src folder that is linked to the src folder in your master project. You can make changes to your project or MCU settings in the 2nd project to provide different build options, or a different memory map, etc.
0 Kudos