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.

Using SYS/BIOS with Peripheral Header files...on F28335

Other Parts Discussed in Thread: TMS320F28335, SYSBIOS

All:

I have been asked to explore the use of SYS/BIOS on a product using the F28335. To do that, I have copied the C2000 code examples to a separate directory - so I would not inadvertantly destroy them.

First, I created a base SYS/BIOS system "Typical" template. I was able to build this system without error.

I then started copying files from an existing F28335 example - I used the timed blink example so I could tell at a glance that a compiled system was still working.

The timed blink example has several files that I added into the Bios project, including

DSP2833x_ADC.cal.asm, DSP2833x_usDelay.asm

DSP2833x_CpuTimers.c, DSP2833x_DefaultIsr.c, DSP2833x_GlobalVariableDefs.c, DSP2833x_PieCtrl.c, DSP2833x_PieVect.c, Example_2833xLEDBlink.c

DSP2833x_Headers_BIOS.cmd, TMS320F28335.cmd

I also needed to point at the proper include files for the headers & common, and I added this to the Build Options --> Include settings under C2000 Compiler.

Once I did all of this, I then needed to take care of build errors, and there were a few related to Uint16 being "doubly-defined."

Not sure if I did this right, but I did manage to get a "base Bios" build that would and use the peripheral header files. I ended up commenting out some lines in the xdctools area.

Now that I have a basic design, I plan to use a Bios timer instead of the CpuTimer to control the LED.

I also plan to add several tasks that are in an existing project.

Question: has anyone tried to create a Sys/Bios based project in conjunction with the C2000 header files?

 

  • Todd,

    YES!  This is completely possible and even encouraged.  SYS/BIOS is an excellent RTOS and the team that manages its development works closely with each of the processing groups to ensure it works as efficiently as possible with each of our devices.  Not to mention the tight integration it has with CCS.

    I actually just gave a presentation on this exact subject at the Vancouver Tech Day.  You can download the presentations from here:

    http://www-s.ti.com/sc/techlit/szzp068.zip

    Mine is in the track one folder.  It goes over some of the basics of SYS/BIOS as well as how to integrate a time critical real time control application (ADC + PWM) with lower priority non time critical tasks.  Let me know if you have questions!

    Trey

  • Looking over you C2000 Launchpad and SYSBIOS presentation. Why do you not want to enable portable HWI on the C2000?

  • Steve,

    We are using 0-Latency interrupts for the EPWM so that our control loops don't have to be modified and the 0-Latency interrupts are only available with the C28x specific HWI management.  Basically 0 latency interrupts are normal C28x interrupts, the HWI dispatcher isn't used to dispatch the interrupt, the normal PIE mechanism is.

    Yes this makes your application non-portable to other non C28x platforms, but it makes it very easy for a real time control application to co-exist with a RTOS application.

    Trey

  • So zero latency interrupts are only interoperable with the family specific interrupts. Gotcha. Any idea what the latency difference, a rough generalization will do, between the zero latency interrupts and the non-portable interrupts?

  • I'm honestly not sure.  You'd have to ask the guys over in the BIOS forum.

  • Trey:

    The C2000 multi-day workshop was a session that showed how to add DSP-BIOS to the C2000, including lab material. Do you know if such a module exists for SYS-BIOS?

    I have started converting one of the header file examples, but there is a lot of room for error...

    I can try to glean as much as possible from the 1.5 day material, but because it is a different processor, there may be some (maybe a lot of) info that is not directly applicable, and ther may also be some missing material.

    I know that BIOS_Start( ) needs to be called prior to returning from main( ), but how much other stuff needs to be omitted from the example code when moving to the SYS/BIOS umbrella?

    For instance, Step 1 - Initialize System Control - is this now totally accomplished by SYS/BIOS?

     Step 2 - Initialize GPIO?

    Step 3 - Interrupt initialization - I think this totally accomplished by SYS/BIOS...

    Step 4 - Device peripheral initialization - does any of this need to be done in main( ) or is it all done by SYS/BIOS?

    Step 5 - User Specific code - how much is needed in a BIOS environment?

    Step 6 - I know that we remove the idle loop, replace with BIOS_start( ) and end out of main( ).

    Thanks for the slides, they are very helpful.

     

  • Todd,

    BIOS is only the kernel...it does what you tell it to do.  By default none of the system modules are included and none of this initialization occurs.  By adding modules to your BIOS configuration you start to relieve you application of managing low level system related management.  For instance including the Boot module will take care of setting up the PLL and watchdog (all this is configurable though).  Interrupts will be initialized and handled by BIOS if you include the HWI module.  You'll have to look at each module you plan on including to see what it does and what will need to be taken our of your code.

    Also of note, SYS/BIOS is DSP/BIOS version 6 (dsp/bios is version 5).  They just changed the name to reflect the fact that it runs on more than just DSP's.  I would think that alot of the DSP/BIOS information would still be somewhat applicable.

    Trey

  • Trey:

    Thanks for your response. I started with the SYS/BIOS idle project and I have been merging with the header file timed blink project.

    So far, in my merged project, I have been able to exclude several of the timed-blink files, including the following. I have also been able to take out most of the steps in the Example.c code, replacing with a couple functions from idle.c - all of this in an attempt to get up to speed with SYS/BIOS and be able to introduce it into an existing non-BIOS project.

    DSP2833x_ADC_cal.asm

    DSP2833x_CodeStartBranch.asm

    DSP2833x_CpuTimers.c

    DSP2833x_DefaultIsr.c

     

    DSP2833x_PieCtrl.c

    DSP2833x_PieVect.c

    DSP2833x_SysCtrl.c

    DSP2833x_usDelay.asm

  • Trey:

    One further note - in order to get a clean compile, I needed to comment out several lines associated with typedefs (Uint16) in xdctools_3_23_03_53/packages/xdc/std.h - not sure if this was the best way to go about this, but it was essentially the only way that I initially got a clean compile.