• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » BIOS » BIOS forum » memory model problem when linking Driverlib with SYSBIOS
Share
BIOS
  • Forum
  • Announcements
Options
  • Subscribe via RSS

memory model problem when linking Driverlib with SYSBIOS

memory model problem when linking Driverlib with SYSBIOS

This question is answered
Amit Bhorania1
Posted by Amit Bhorania1
on Dec 27 2012 07:44 AM
Intellectual255 points

I am trying to link Driver library with SYSBIOS. I have created a SYSBIOS project with given minimal template and modified the main.c file and .cfg file as per my requirement.

In project properties, I have set include path as MSP430ware path and added driverlib.lib in "File Search path".
and In Processor options, I have set Data memory model = large.

after that, I build the project and getting error that driverlib needs large data memory model but restricted large data memory model is provided.

I checked makefile (Path: <project>/Debug/makefile) and found that --data_model = large. It is proper.

I checked makefile (Path: <project>/src/sysbios/makefile) and found that --data_model = restricted is there even though i have set large data memory model in processor option. I replaced "restricted" with "large" and save & Build again.

After building, In makefile(Path: <project>/src/sysbios/makefile) --data_model = restricted was there even though i have replaced it with "large".

In Conclusion, "--data_model = restricted" comes by default even if i set it as large. What will be the problem for that? and How to solve Data memory model error.

I have added compilation output here


**** Build of configuration Debug for project sysbios_memory_model_issue3 ****

/opt/ti/ccsv5/utils/bin/gmake -k all
making ../src/sysbios.a430X ...
cl430X /opt/ti/bios_6_34_02_18/packages/ti/sysbios/BIOS.c ...
asm430X /opt/ti/bios_6_34_02_18/packages/ti/sysbios/family/msp430/TaskSupport_asm.asm ...
asm430X /opt/ti/bios_6_34_02_18/packages/ti/sysbios/family/msp430/Hwi_switch_asm.asm ...
ar430X BIOS.obj msp430_TaskSupport_asm.obj msp430_Hwi_switch_asm.obj ...
Building file: ../app.cfg
Invoking: XDCtools
"/opt/ti/xdctools_3_24_05_48/xs" --xdcpath="/opt/ti/bios_6_34_02_18/packages;/opt/ti/ccsv5/ccs_base/msp430/msp430ware_1_25_00_30/packages;/opt/ti/ccsv5/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.msp430.MSP430X -p ti.platforms.msp430:MSP430F5438 -r release -c "/opt/ti/ccsv5/tools/compiler/msp430_4.1.2" --compileOptions "-g --optimize_with_debug" "../app.cfg"
making package.mak (because of package.bld) ...
generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
configuring app.x430X from package/cfg/app_p430X.cfg ...
warning: ti.sysbios.BIOS: "/opt/ti/bios_6_34_02_18/packages/ti/sysbios/BIOS.xs", line 195: ti.targets.msp430.MSP430X : Support for the MSP430 COFF targets will be eliminated in future SYS/BIOS releases. Please switch to building with the corresponding ti.targets.msp430.elf MSP430 target.
generating custom ti.sysbios library makefile ...
generating custom ti.sysbios.family.msp430 Hwi stubs ...
Starting build of library sources ...
making /root/workspace/sysbios_memory_model_issue3/src/sysbios.a430X ...
Build of libraries done.
cl430X package/cfg/app_p430X.c ...
Finished building: ../app.cfg

Building file: ../main.c
Invoking: MSP430 Compiler
"/opt/ti/ccsv5/tools/compiler/msp430_4.1.2/bin/cl430" -vmspx --abi=coffabi --data_model=large -g --include_path="/opt/ti/ccsv5/ccs_base/msp430/include" --include_path="/opt/ti/ccsv5/ccs_base/msp430/msp430ware_1_25_00_30" --include_path="/opt/ti/ccsv5/tools/compiler/msp430_4.1.2/include" --advice:power=all --define=__MSP430F5438__ --diag_warning=225 --display_error_number --diag_wrap=off --silicon_errata=CPU15 --silicon_errata=CPU18 --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU23 --silicon_errata=CPU40 --printf_support=minimal --preproc_with_compile --preproc_dependency="main.pp" --cmd_file="./configPkg/compiler.opt" "../main.c"
"../main.c", line 54: remark #1530-D: (ULP 5.1) Detected modulo operation(s). Recommend moving them to RAM during run time or not using as these are processing/power intensive
"../main.c", line 67: remark #1530-D: (ULP 5.1) Detected modulo operation(s). Recommend moving them to RAM during run time or not using as these are processing/power intensive
Finished building: ../main.c

Building target: sysbios_memory_model_issue3.out
Invoking: MSP430 Linker
"/opt/ti/ccsv5/tools/compiler/msp430_4.1.2/bin/cl430" -vmspx --abi=coffabi --data_model=large -g --advice:power=all --define=__MSP430F5438__ --diag_warning=225 --display_error_number --diag_wrap=off --silicon_errata=CPU15 --silicon_errata=CPU18 --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU23 --silicon_errata=CPU40 --printf_support=minimal -z --stack_size=160 -m"sysbios_memory_model_issue3.map" --heap_size=160 --use_hw_mpy=F5 -i"/opt/ti/ccsv5/ccs_base/msp430/include" -i"/opt/ti/ccsv5/tools/compiler/msp430_4.1.2/lib" -i"/opt/ti/ccsv5/tools/compiler/msp430_4.1.2/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --rom_model -o "sysbios_memory_model_issue3.out" -l"./configPkg/linker.cmd" "./main.obj" -l"libc.a" -l/opt/ti/ccsv5/ccs_base/msp430/msp430ware_1_25_00_30/driverlib/5xx_6xx/CCS/driverlib.lib "../lnk_msp430f5438.cmd"
<Linking>
error #16019-D: file "/opt/ti/ccsv5/ccs_base/msp430/msp430ware_1_25_00_30/driverlib/5xx_6xx/CCS/driverlib.lib<gpio.o>" specifies large data memory model, which is not compatible with restricted large data memory model specified in a previous file or on the command line
error #16019-D: file "/opt/ti/ccsv5/ccs_base/msp430/msp430ware_1_25_00_30/driverlib/5xx_6xx/CCS/driverlib.lib<wdt.o>" specifies large data memory model, which is not compatible with restricted large data memory model specified in a previous file or on the command line
error #10010: errors encountered during linking; "sysbios_memory_model_issue3.out" not built
remark #10372-D: (ULP 4.1) Detected uninitialized Port A in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
remark #10372-D: (ULP 4.1) Detected uninitialized Port B in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
remark #10372-D: (ULP 4.1) Detected uninitialized Port C in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
remark #10372-D: (ULP 4.1) Detected uninitialized Port D in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
remark #10372-D: (ULP 4.1) Detected uninitialized Port E in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
remark #10372-D: (ULP 4.1) Detected uninitialized Port F in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.

>> Compilation failure
gmake: *** [sysbios_memory_model_issue3.out] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Sasha Slijepcevic
    Posted by Sasha Slijepcevic
    on Dec 27 2012 12:06 PM
    Genius15070 points

    Amit,
    the options in src/sysbios/makefile are determined by the target selection in the configuro command line. The option -t ti.targets.msp430.MSP430X selects the target with the restricted data model. Unfortunately, there is no RTSC target that supports the large data model. The only difference between the large and the restricted model is that in the restricted model you can't have arrays larger than 64K. If you don't have such arrays I would recommend you to change data model to Restricted in your project.

     

    If my reply answers your question please mark the thread as answered.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Amit Bhorania1
    Posted by Amit Bhorania1
    on Dec 28 2012 00:06 AM
    Intellectual255 points

    Hi Sasha Slijepcevic,

    Thanks for your reply.

    You have mentioned about array of size < 64K. Here array means simple C array or anything else ?

    I don't need to use any C array but I want to use Driver library provided in MSP430Ware.

    SYSBIOS provides driverlib package but when i included that and used driverlib APIs then it cant be resolved by compiler. therefore I included Driver library(Path: ccsv5/ ccs_base/ msp430/ msp430ware_1_25_00_30/ driverlib/ 5xx_6xx/ CCS/ driverlib.lib) in Project Properties-> MSP430 Linker-> File Search Path-> include library path then APIs get resolved by compiler but driver library needs large data memory model and i am getting error for that.

    What is solution of this problem? Can i change data memory model of driver library?

    Is there any way to use APIs of Driver library provided by SYSBIOS?

    Thanks,
    Amit Bhorania 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Amit Bhorania1
    Posted by Amit Bhorania1
    on Dec 28 2012 00:48 AM
    Intellectual255 points

    Hi Sasha Slijepcevic,

    I have described my problem of data memory model in last post. I tried a new approach and I have presented its result

    My Application + SYSBIOS + Driver library --> gives Data memory model mismatch problem

    but I tried My Application + Driver libray --> No error
    I removed SYS BIOS and included only Driver library then it needs Large Data memory model. and when i set  data memory model = large then it compiled successfully.
    This Time there is no <project>/ src  Directory in my project and there is only one makefile in <project>/ Debug/ Directory . and it contains Data memory model = large.

    This is just for checking and posted it thinking that it might help you to identify the problem in my case.

    I need to use both SYSBIOS & Driver library in my project.

    Thanks,
    Amit Bhorania 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Sasha Slijepcevic
    Posted by Sasha Slijepcevic
    on Dec 28 2012 13:28 PM
    Verified Answer
    Verified by Amit Bhorania1
    Genius15070 points

    Amit,
    I can see that driverlib ships with the sources, and I see there are CCS project files in the directory CCS, so I am guessing that you can rebuild it. There is also a User's Guide in doc/driverlib, which should contain instructions for rebuilding driverlib. Once you rebuild driverlib for the restricted data model, you'll be able to link with SYS/BIOS libraries.

    If my reply answers your question please mark the thread as answered.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Amit Bhorania1
    Posted by Amit Bhorania1
    on Dec 31 2012 01:04 AM
    Intellectual255 points

     Hi Sasha Slijepcevic,

                                           Thanks for your reply. I have rebuild the driver library with restricted data memory model and its working fine with SYSBIOS. It solved my problem. Two things I can't understand is that
    1. what is difference between "large" and "restricted" Data memory model ?
    2. Why I am not able to use Inbuilt SYSBIOS's Driver library package?

    Thanks,
    Amit Bhorania 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Sasha Slijepcevic
    Posted by Sasha Slijepcevic
    on Jan 02 2013 14:46 PM
    Genius15070 points

    Amit,
    the first question could be probably answered better in the compiler forum, but as far as I know the difference between "large" and "restricted" data model is in the instructions that the compiler generates for accessing arrays. In "restricted" data model, only arrays of up to 64K can be accessed. Because of that you can't mix that code with object files where there are no restrictions on array sizes.

    As for the second question, are you asking why Driverlib is prebuilt for "large" data model? Driverlib can be used without SYS/BIOS, and there are users who can use it without rebuilding. I hope this answers your question. 

    If my reply answers your question please mark the thread as answered.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Amit Bhorania1
    Posted by Amit Bhorania1
    on Jan 02 2013 23:41 PM
    Intellectual255 points

    Hi Sasha Slijepcevic,

                                         I got my answers but for my second question, I have already used driverlib without SYSBIOS and without rebuilding it. but when you open any SYSBIOS Project in CCS, you have .cfg file and in that we can add driverlib module in a same way we use Hwi, Task, Timer module in SYSBIOS.

                                         By my question, I mean that I dont want to include driverlib.lib file in " project properties-> MSP430 Linker -> File search Path" for SYSBIOS Project. But I want to use inbuilt driverlib module found in SYSBIOS .cfg file. Is there any way to use this module?

    Thanks,
    Amit Bhorania 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Sasha Slijepcevic
    Posted by Sasha Slijepcevic
    on Jan 03 2013 18:06 PM
    Genius15070 points

    Amit,
    I am not aware of any SYS/BIOS module that includes driverlib. You may be talking about the module DriverLib that is delivered with msp430ware, and when you use that module, the following line is added to your script:

    var DriverLib = xdc.useModule('ti.mcu.msp430.drivers.product.DriverLib');

    Is that the module you are talking about? As far as I can tell, that module does not add driverlib.lib into the list of libraries that are linked in your app automatically, the way the SYS/BIOS libraries are added. However, you don't need to change File search path. You can right-click on the project->Add Files, and then find driverlib.lib in the file browser. When you click OK, you'll be asked if you want to link driverlib.lib to your project or copy it. You can choose which one of those works for you.

    If my reply answers your question please mark the thread as answered.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Amit Bhorania1
    Posted by Amit Bhorania1
    on Jan 03 2013 23:22 PM
    Intellectual255 points

    Yes. I was talking about this module. Thanks for your precious help and instant replies.

    Thanks,
    Amit Bhorania 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mohammed Lokhandwala
    Posted by Mohammed Lokhandwala
    on Apr 12 2013 03:40 AM
    Prodigy230 points

    Despite changing the data model to 'restricted' via project settings, it keeps creating the driverlib.lib and all obj files with the large data model. I have changed the setting for debug and release configurations. 

    I get the following error

    Description Resource Path Location Type

    #16019-D file "C:\ti\ccsv5\ccs_base\msp430\msp430ware_1_25_00_30\driverlib\5xx_6xx\CCS\driverlib.lib<adc12.obj>" specifies large data memory model, which is not compatible with restricted large data memory model specified in a previous file or on the command ....

    I am using MSP430F5324 MCU with SysBIOS  and driverlib.

    Compiler version is TI v4.1.2 and outputformat is eabi(ELF)

    Silicon version is mspx

    Code model is undefined

    What data must be near is undefined

    In the target application, driverlib is included as "${workspace_loc:/driverlib/Debug/driverlib.lib}"

    Ofcourse I have cleaned and rebuilt many times. I have also given physical path to the lib instead of workspace reference.

    Am I supposed to change anything else ?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Amit Bhorania1
    Posted by Amit Bhorania1
    on Apr 12 2013 04:45 AM
    Intellectual255 points

    Hi Mohammed Lokhandwala,

                                                           I think you should delete the other files except the source file for driverlib project and rebuild it. After that link generated driverlib with of your application project. Next compile your application project and check the result. Let me know your results.

    Thanks,
    Amit Bhorania

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mohammed Lokhandwala
    Posted by Mohammed Lokhandwala
    on Apr 12 2013 04:57 AM
    Prodigy230 points

    Amit, No luck.

    I deleted the Debug folder completely. Deleted all the .o and .nfo outside of Debug folder leaving only the source files and the project files. Rebuilt driverlib, still same issue. Really can't figure the cause. 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Amit Bhorania1
    Posted by Amit Bhorania1
    on Apr 12 2013 05:03 AM
    Intellectual255 points

    Hi Mohammed Lokhandwala,

                                                          Have u check all the settings of driverlib project. Try to generate a driverlib with new name. In Compiler options-> Basic options-> uncheck use large data memory model option.

    Thanks,
    Amit Bhorania

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mohammed Lokhandwala
    Posted by Mohammed Lokhandwala
    on Apr 12 2013 05:23 AM
    Prodigy230 points

    The summary of flags shows large memory model

    -vmspx --abi=eabi --data_model=restricted -O0 -g --include_path="C:/ti/ccsv5/ccs_base/msp430/include" --include_path="C:/ti/ccsv5/ccs_base/msp430/msp430ware_1_25_00_30" --include_path="C:/ti/ccsv5/tools/compiler/msp430_4.1.2/include" --define=__MSP430F5324__ --diag_warning=225 --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU23 --silicon_errata=CPU40 --large_memory_model --printf_support=minimal

    I don't know where that comes from exactly or if it is a problem because restricted is also large actually.

    Here are my "Processor Options"

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Amit Bhorania1
    Posted by Amit Bhorania1
    on Apr 12 2013 05:39 AM
    Intellectual255 points

    This processor options are of your driverlib project or your application project ?

    list the setting of your driverlib project......

    Thanks,
    Amit Bhorania

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
12
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use