This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
Hi,
I am trying to setup a RTOS program with Driverlib support for the TMS320F28075. I used the given the typical example for the RTOS projects in Code Composer Studio as the base.
However, during the project build I ran into the following issue.
"../TMS320F28075.cmd", line 107: error #10099-D: program will not fit into available memory. placement with alignment/blocking fails for section "codestart" size 0x2 page 0. Available memory ranges:
BEGIN size: 0x2 unused: 0x0 max hole: 0x0
I did not alter the linker command file which was available in the example project. I quite can't get my head around as to how to solve this issue, any help or advice is appreciated.
Thanks in advance.
Nisal
It sounds like both your application and SYS/BIOS are trying to place code at the entry point address. If you have the CodeStartBranch.asm file in your project, you can go ahead and remove it and let SYS/BIOS generate it instead.
Whitney
Hi Whitney,
Thank you very much for the reply. This solved my issue. I have another question regarding the Driverlib.
Since the driverlib.lib file must be included in the project to get driverlib support, I added this file to my project.
However, this warning is displayed,
warning #10207-D: resolving index library "driverlib.lib" to "driverlib_coff.lib", but "driverlib_coff.lib" was not found
What is the difference between driverlib.lib and driverlib_coff.lib, and what should I include in the project.
Thank you
Nisal
driverlib.lib is an index that will redirect to either driverlib_coff.lib and driverlib_eabi.lib depending on which output format you've configured your project to use. Since you're using COFF, it's trying to find driverlib_coff.lib.
When you created your project, did you link to driverlib.lib or did you copy it? If you copied it, it may not be able to find the driverlib_coff.lib because it's in a different location. If you want to copy the library into your project instead of linking, copy driverlib_coff.lib and use it directly instead.
Whitney
Hi Whitney,
I came across another issue. Even though the projects is built without any error, the drivelib functions such as CAN_sendMessage does not get highlighted, which normally is. it was seen that another problem exist, because the CAN_sendMessage runs once and the program breaks. I believe that I have not followed the proper steps to include the drivelib in my project. I followed the F2807x_DEV_USER_GUIDE. I want to know whether the steps are different for a RTOS project. If yes, is it possible to get some advice on this.
Thank you
Nisal
The fact that it builds okay most likely means that you have included the driverlib properly. Can you give me more detail about in what way the program breaks? Is it getting stuck somewhere? Are you getting an ITRAP?
There are some considerations you need to make with the RTOS. You'll want to try to avoid conflicts between the SYS/BIOS device initialization and the code you call in the application--for example, do you want the SYS/BIOS Boot module to configure SYSCLK for you or do you want to use the clock initialization code that is called in Device_init()? Also, SYS/BIOS is going to plug its Hwi dispatcher into the PIE vector table, so you need to make sure your application isn't calling Interrupt_initVectorTable() or Interrupt_register() and overwriting it.
Whitney
Hi Whitney,
I'm using the Device_init() function to setup the TMS320F28075. I have mistakenly left a Interrupt_initVectorTable() function uncommented. After commenting that, the program ran with any breaks. However, in the program I have set to send a couple of CAN messages every 100ms, but when checked with a CAN bus analyzer, is it seen that the messages are sent every 1.2s. Given below is the app.cfg file used in the project.
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Log = xdc.useModule('xdc.runtime.Log');
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory')
var SysMin = xdc.useModule('xdc.runtime.SysMin');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Hwi = xdc.useModule('ti.sysbios.family.c28.Hwi');
var Idle = xdc.useModule('ti.sysbios.knl.Idle');
/*
* Uncomment this line to globally disable Asserts.
* All modules inherit the default from the 'Defaults' module. You
* can override these defaults on a per-module basis using Module.common$.
* Disabling Asserts will save code space and improve runtime performance.
Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
*/
/*
* Uncomment this line to keep module names from being loaded on the target.
* The module name strings are placed in the .const section. Setting this
* parameter to false will save space in the .const section. Error and
* Assert messages will contain an "unknown module" prefix instead
* of the actual module name.
Defaults.common$.namedModule = false;
*/
/*
* Minimize exit handler array in System. The System module includes
* an array of functions that are registered with System_atexit() to be
* called by System_exit().
*/
System.maxAtexitHandlers = 4;
/*
* Uncomment this line to disable the Error print function.
* We lose error information when this is disabled since the errors are
* not printed. Disabling the raiseHook will save some code space if
* your app is not using System_printf() since the Error_print() function
* calls System_printf().
Error.raiseHook = null;
*/
/*
* Uncomment this line to keep Error, Assert, and Log strings from being
* loaded on the target. These strings are placed in the .const section.
* Setting this parameter to false will save space in the .const section.
* Error, Assert and Log message will print raw ids and args instead of
* a formatted message.
Text.isLoaded = false;
*/
/*
* Uncomment this line to disable the output of characters by SysMin
* when the program exits. SysMin writes characters to a circular buffer.
* This buffer can be viewed using the SysMin Output view in ROV.
SysMin.flushAtExit = false;
*/
/*
* The BIOS module will create the default heap for the system.
* Specify the size of this default heap.
*/
BIOS.heapSize = 0x800;
/*
* Build a custom SYS/BIOS library from sources.
*/
BIOS.libType = BIOS.LibType_Custom;
/* System stack size (used by ISRs and Swis) */
Program.stack = 0x100;
/* Circular buffer size for System_printf() */
SysMin.bufSize = 0x200;
/*
* Create and install logger for the whole system
*/
var loggerBufParams = new LoggerBuf.Params();
loggerBufParams.numEntries = 32;
var logger0 = LoggerBuf.create(loggerBufParams);
Defaults.common$.logger = logger0;
Main.common$.diags_INFO = Diags.ALWAYS_ON;
System.SupportProxy = SysMin;
Idle.idleFxns[0] = "&background_fxn";
var hwi0Params = new Hwi.Params();
hwi0Params.instance.name = "cpuTimer0_handle";
Program.global.cpuTimer0_handle = Hwi.create(38, "&cpuTimer0ISR", hwi0Params);
var hwi1Params = new Hwi.Params();
hwi1Params.instance.name = "canA0_handle";
Program.global.canA0_handle = Hwi.create(100, "&canaISR", hwi1Params);
var hwi2Params = new Hwi.Params();
hwi2Params.instance.name = "canB0_handle";
Program.global.canB0_handle = Hwi.create(102, "&canbISR", hwi2Params);
var hwi3Params = new Hwi.Params();
hwi3Params.instance.name = "ecap1_handle";
Program.global.ecap1_handle = Hwi.create(56, "&ecap1ISR", hwi3Params);
Okay, it sounds like maybe there are some clock issues. Using Device_init to set up the clock is fine--just go into the Boot module and make sure it isn't trying to configure the clocks and causing a conflict. It should show up in your cfg file like "Boot.configureClocks = false". Also to make sure the BIOS tick rate is correct, make sure you've given BIOS the actual CPU frequency (it'll be BIOS.cpuFreq.lo in your cfg file).
By default the Clock module should increment every 1ms. Can you use ROV and run the target for 10 seconds? Look at the Clock module in ROV and you should see the increment of 10,000 after 10 seconds.
Whitney
Hi Whitney,
I made the changes and the clock is running properly. Thank you very much.
Nisal