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.

BIOS object in a non-BIOS project

Other Parts Discussed in Thread: SYSBIOS, OMAPL138

I'm very new to embedded development and have practically no experience with SYSBIOS.  Apologies if any of this sounds elementary.

I'm working on porting an audio loopback application that currently runs using Starterware code to use SYSBIOS. The Starterware based application runs as expected on an OMAP L138 EVM.  As a first step in moving to SYSBIOS I started compiling this application using a SYSBIOS compatible build setup (cfg file, xdc tools, rtsc etc.) and I'm seeing issues even when SYSBIOS is not used.  Stay with me, more details below.

1.  Starterware application 

This application configures the AIC3106, McASP and EDMA engines and is able to get audio to loopback on the system.  The application is interrupt driven and all interrupts have been configured correctly and work as expected.

2.  Move to SYSBIOS: check that everything builds when using the SYSBIOS build framework

As a first step I rebuilt the application using the build procedure required for sysbios applications but without any changes to the code i.e. SYSBIOS is not used.  Effectively this meant re-compiling the application and using a cfg file that includes the modules shown below.

/*use modules*/
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');

In this case, the code builds and runs as expected.

3.  Move to SYSBIOS: add BIOS module to cfg file

The next step had just one change; I included the BIOS module in the cfg file as shown below. 

/*use modules*/
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');

Note that although I add this in the cfg file I do not use anything related to SYSBIOS in my application.  It is the same Staterware based application as used in steps 1 & 2.  However, this simple, seemingly innocuous change prevents audio from looping through the system.  All the initialization code runs correctly. The clocks have been configured correctly and the interface between the ADC/DAC and the McASP is active.  Interrupts are being received at the intervals expected but the only thing I hear at the output are pops and clicks...my vague suspicion is that something is out of sync or the locations being read from and written to are not what I think they are.

Things I've looked at so far:

  • Clocks and interfaces have been configured correctly.
  • EDMA interrupts are received from Tx and Rx channels, Tx and Rx buffer addresses are updated correctly.
  • Audio interface shows active clocks and data.
The SYSBIOS documentation mentions some subtle differences between the various types of SYS/BIOS libraries.  I tried using Instrumented, Non-instrumented and Custom with no luck.
And finally, my questions:
- Does it sound logical that simply including the BIOS module can cause this? 
- Is there a way to find out exactly what is run before running my application code?
- Any other suggestions, SYSBIOS wisdom or embedded wisdom you may have is much appreciated.
Thanks,
Dinesh
  • Hi Dinesh,

    You also need to call BIOS_start() at the end of main(). Having said that, when you bring in ti.sysbios.BIOS, you are bringing in the Hwi module which manages interrupts. How are you doing interrupts now? You need to plug your ISR into the Hwi module by (via graphically/textually in the .cfg file or by the runtime Hwi_create call). Note also, by default, BIOS grabs a timer that it plugs into Clock module. So this "innocuous" :) does alot.

    You might want to build one of the SYS/BIOS examples and run it. You can look at Tools->ROV to see the interrupts in Hwi and Timer. This might help see what is happening.

    Todd

  • Hi Todd,

    Thanks for your response.  

    All the code used in this particular project is based on Starterware.  I map interrupts using the appropriate Starterware functions.

    Indeed, even simply creating the BIOS object is not as innocuous as it seems :) .  With some assistance from my colleagues we managed to figure out that including the BIOS object in the project enables the cache in system.  This was causing the buffers to be read incorrectly.  And you mention that BIOS also grabs a timer for use with a Clock module.  I'm trying to understand a little more exactly what happens when these objects are created and linked into a program and the sequence of operations that run when BIOS is started.  Can you please point me to some documentation or tutorials that detail this process?

    And here are links to a couple of other related topics that I've posted on the forums.  

    http://e2e.ti.com/support/embedded/bios/f/355/t/235211.aspx

    http://e2e.ti.com/support/embedded/bios/f/355/t/235208.aspx

    On a related note, where is the interrupt vector table used by HWIs located.

    Thanks,

    Dinesh

  • Dinesh,

    I see that you have several other threads with questions about SYS/BIOS. Are there any questions in this post that are unresolved?

    Todd

  • I'm still reading through the documentation referenced in my other posts.  I haven't yet uncovered the answer to the specific question addressed in this post.

    Where is the interrupt vector table used by HWIs located?

    Thanks,

    Dinesh

  • An easy way to determine this is to open the mapfile and look for the .vecs section. I built the Log example for the DSP on the OMAPL138 and here is the .vecs section from the mapfile.

    .vecs      0    c3015c00    00000200     
                      c3015c00    00000200     log_p674.o674 (.vecs)

    Todd