I am using CCS v4.2 and trying to build SYS/BIOS project. I know about XGCONF editor and how you can edit CFG files with it. I am trying to set up a "periodic task" to run, like you could with the "PRD" option in TCF files used in DSP/BIOS version 5. Version 6 seems to be very different. There is a tab for "task" (under ti.sysbios.knl.Task), where I am assuming you specify the function to run "fxn" under "Create Args". Then there are options like arguments to the function and task priority, but I don't see anywhere where you can specify that the function should run "continuously" or give the interval at which it should execute. Is there a different way of doing it in SYS/BIOS? Maybe some combination of settings for clock, SWI, and task?
Audrey,
In SYS/BIOS 6 You can set up a single periodic or one-shot function using the Timer module, or you can set up multiple functions using the Clock module. The Clock module basically configures the Timer module to post a Swi that will execute the clock functions. Let me know if that's enough detail to get you started.
David, thanks for your reply. I tried adding a new "clock", then changed the value of "clockFxn" (it's under "Create Args" tab) to the name of the function I wanted to run. When I try to run the program, I can see that it executes "main", but then an error saying "unhandled event loop exception" appears. As a side note, I have tried putting this function under "Swi" and "Task" before, with the same result.
Also, do you know if the function name has to be underlined? It used to be, in TCF files, when you specified the function name under "PRD".
Andrey,
The error "unhandled event loop exception" is generated by the Eclipse framework (which is what Code Composer Studio is) when one of its plug-ins generates an exception that is not handled. I would consider this a bug, as the exception should at least be handled by the plug-in rather than having it propagate all the up to the highest level. Anything you can do to help us reproduce the problem would be welcome.
It's not clear to me whether this is your main problem. It sounds like the BIOS scheduler is not starting properly? The way that you created the Clock instance seems right, but one thing I should warn you about is that you should probably set startFlag=TRUE so that the clock will immediately start running when the BIOS scheduler starts up. If you leave this to FALSE, your app will need to explicitly start it by calling Clock_start().
I don't see enough information in your description to provide further help, so any additional details at this point would be welcome.
The "unhandled event loop exception" message comes from Eclipse, but it doesn't tell much about the root cause. Can you please send the Java stack backtrace from the error?
To do this, in the CCS "Error Log" view, double-click on the error to bring up the "Event Details" dialog, shown below. Click the "Copy Event Details to Clipboard" button, save the clipboard to a text file, and attach to your reply post. You can add the file as an attachment using the "Options" link of the reply post editor.
thanks a lot,Jon
The 'clock' example, provided with the product and available via the File->new project wizard might be a good reference for you.
Thanks for your replies.
OK, I set the "startFlag" to "true" for the new Clock instance... the error appeared again. There is no stack trace from that error, the precise message in "event details" is
An exception stack trace is not available.
However, I noteced there is another error, immediately before that one. It said "Failed to execute runnable (java.lang.NullPointerException)". This one has a stack trace, which I am reproducing here.
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:3374)
at org.eclipse.swt.SWT.error(SWT.java:3297)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:97)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:996)
at org.eclipse.core.launcher.Main.main(Main.java:971)
Caused by: java.lang.NullPointerException
at com.ti.dvt.rta.DataViewSessionHandler$LoggerBuffContribution.rebuildCombo(DataViewSessionHandler.java:205)
at com.ti.dvt.rta.DataViewSessionHandler$LoggerBuffContribution.createControl(DataViewSessionHandler.java:185)
at org.eclipse.jface.action.ControlContribution.fill(ControlContribution.java:97)
at org.eclipse.jface.action.SubContributionItem.fill(SubContributionItem.java:75)
at org.eclipse.jface.action.ToolBarManager.update(ToolBarManager.java:317)
at org.eclipse.ui.internal.ViewPane.updateActionBars(ViewPane.java:443)
at org.eclipse.ui.internal.ViewActionBars.updateActionBars(ViewActionBars.java:59)
at com.ti.dvt.ui.multipageview.MultiPageView.showPageInfo(MultiPageView.java:809)
at com.ti.dvt.ui.multipageview.MultiPageView.activatePageContext(MultiPageView.java:459)
at com.ti.dvt.rta.DataViewSessionHandler.activateReferenceView(DataViewSessionHandler.java:84)
at com.ti.dvt.rta.DataViewSessionHandler.updateView(DataViewSessionHandler.java:132)
at com.ti.dvt.rta.DataViewSessionHandler$2.run(DataViewSessionHandler.java:110)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
... 20 more
(I don' t know how to get those "20 more" to display.)
One other thing I should mention, I saw that one of the sample projects provided for SYS/BIOS uses a BIOS_start() function at the end of main. I tried adding it to my project, too, it compiles, but fails at linking stage with "undefined symbol".
There seems to be a couple issues here. Can we try to separate them?
(1) Please close all "RTA" and "ROV" tools. The above errors look related to the RTA tools. What version of CCSv4.2 are you using? Are you using a pre-release? Or did you recently download the release candidate?
(2) To fix the "undefined symbol" you probably need to add "xdc.useModule('ti.sysbios.BIOS');" to your .cfg file (or compile the project for debug instead of whole_program).
(3) Build and run your app and see if you are getting your periodic interrupt.
After that, we can debug the RTA/ROV tool problem.
I would suggest starting with one of the provided examples. What board are you using? What processor? Is it a standard EVM? If so, you can attach you .c and .cfg files to this post and we can review and comment.
Regards,-Karl-
Jon, Karl-
I'm helping Andrey. Some answers:
1) Yes we downloaded the release candidate (v4.2.0.10007).
2) We're using C6472 EVM.
Also some additional notes / questions:
1) We made some progress. Andrey is able to build a SYS/BIOS project now using shared mem. Our next step is to run code on different cores and verify they can cooperate via use of shared mem.
2) When we use a data section pragma to locate a variable into shared memory, as follows:
#pragma DATA_SECTION(var, "SL2RAM")int var[1024];
then we get a warning message "Creating Output Section SL2RAM without a SECTIONS specification". We can see SL2RAM defined in the RTSC Platform Edit/View Device Memory Map, and we can see "var" correctly located in the output .map file. How do we remove this warning?
3) Is there away to get the RTSC Platform Edit/View dialog to 'remember' the package path? Every time we go in there, we have to manually browse/enter the path. The default path (value shown upon entry) has nothing to do with platform packages.
4) Andrey will continue to work on the periodic function issue, by editing the .cfg file. I think I know the answer, but just to double-check, there is no way to add a periodic functions using the RTSC Platform Edit/View? We can see how to add mem segments in that way... I'm an old TI developer so I'm a bit nostalgic for the GUI method of defining tasks, memory, interrupts, etc. Hopefully it returns to CCS at some point.
-Jeff
Jeff Brower 2) When we use a data section pragma to locate a variable into shared memory, as follows: #pragma DATA_SECTION(var, "SL2RAM")int var[1024]; then we get a warning message "Creating Output Section SL2RAM without a SECTIONS specification". We can see SL2RAM defined in the RTSC Platform Edit/View Device Memory Map, and we can see "var" correctly located in the output .map file. How do we remove this warning?
I think you are confusing data section and memory segments. The linker memory table has a "segment" named SL2RAM. Typically you place "sections" (like .text, .far, etc.) into these segments.
Can you try something like this in your .c file:
#pragma DATA_SECTION(var, "myvars")int var[1024];
And then add this to your .cfg file
Program.sectMap["myvars"] = "SL2RAM"
Check the updated Chapter 5 of the latest SYS/BIOS User's Guide for more info on this. (I see a typo in section 5.3.1 that I'll file a bug and get fixed). The IRAM should be in quotes:
Program.sectMap[".foo"] = "IRAM";
Jeff Brower 3) Is there away to get the RTSC Platform Edit/View dialog to 'remember' the package path? Every time we go in there, we have to manually browse/enter the path. The default path (value shown upon entry) has nothing to do with platform packages. 4) Andrey will continue to work on the periodic function issue, by editing the .cfg file. I think I know the answer, but just to double-check, there is no way to add a periodic functions using the RTSC Platform Edit/View? We can see how to add mem segments in that way... I'm an old TI developer so I'm a bit nostalgic for the GUI method of defining tasks, memory, interrupts, etc. Hopefully it returns to CCS at some point.
Amit will have to comment on #3.
On #4, have you tried the configuration tool? The memory map is specified via platform wizard (edit/view), but you can open the .cfg file with graphical tool and update module state and such. They are now 2 steps and activities. Idea is that multiple apps can share common memory map and that you'd do this "once" for a new board. And then multiple apps would use this common memory configuration.
one more thing ...
If you are doing multi-core, I think you should review the IPC product and docs and examples. We provide source for both BIOS and IPC in the latest releases. And we include multicore example for evm6472.
If SL2RAM is a memory segment, i.e., defined under the MEMORY portion of a memory map, then your DATA_SECTION macro won't work. You'll need a sections specification in your .cfg file such as:
var dataSection = new Program.SectionSpec; dataSection.loadSegment = "SL2RAM"; Program.sectMap[".my_data"] = dataSection; and, I've found I still need to assign this in the .cmd file as:
var dataSection = new Program.SectionSpec;
dataSection.loadSegment = "SL2RAM";
Program.sectMap[".my_data"] = dataSection;
and, I've found I still need to assign this in the .cmd file as:
SECTIONS
{
.my_data : > SL2RAM, PAGE = 1 } and in your code: #pragma DATA_SECTION(var, ".my_data"); Mark
.my_data : > SL2RAM, PAGE = 1
}
and in your code:
#pragma DATA_SECTION(var, ".my_data");
Mark
Jeff Brower 3) Is there away to get the RTSC Platform Edit/View dialog to 'remember' the package path? Every time we go in there, we have to manually browse/enter the path. The default path (value shown upon entry) has nothing to do with platform packages.
Jeff,
If you are trying to create new platforms we recommend using the default area. A typical workflow will be to create a platform using Tools -> RTSC Tools -> Platform -> New in the default area - <USERDIR>\myRepository\packages. Then when you want to modify/view your platform you use Tools -> RTSC Tools -> Platform -> Edit/View
Modifying the platforms delivered with XDCtools in place is not recommended.
Note that the tool does not have 'memory' - it does not remember the repository selected in a previous invocation. I think this will be a useful feature to add to the tool.
Thanks
Amit
-------------------------
Don't forget to verify answers to your forum questions by using the green "Verify Answer" button.
Karl-
> And then add this to your .cfg file > Program.sectMap["myvars"] = "SL2RAM" For now, I created a .cmd file for the project and added a SECTIONS directive. This killed the warning. Sorry if I used the old-fashioned way :-) -Jeff
> Program.sectMap["myvars"] = "SL2RAM"
For now, I created a .cmd file for the project and added a SECTIONS directive. This killed the warning. Sorry if I used the old-fashioned way :-)
Mark-
Thanks. Just the .cmd file directive and DATA_SECTION pragma change seemed to be enough. The warning disappeared and the var is located correctly in SL2RAM.