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.

Example/guideline for SYS/BIOS migration

Other Parts Discussed in Thread: SYSBIOS

Hi, there.

Are there any examples or guidelines to migrate a non-OS CCS project to SYS/BIOS?

Thanks and regards,

Zhaohong

  • There is not a straight-forward process. What version of CCS are you using? What version of SYS/BIOS? What device?

    Todd

  • Tod,

    Thanks for the reply.

    I installed tirtos_tivac_2_00_02_36. It comes with bios_6_40_02_27. The CCS version 6.0.1. I am trying to migrate a TM4C194 project. It is a working one without OS. I would like to first migrate to sys/bios then I can add other HWI/SWI/TASKs. To minimize the work/risk, I would like to change my ISRs to SWI posted by HWIs and change my mainloop to a task without changing the existing software modules except for breaking ISR to HWI and SWI. It seems that the interrupt vector table and link command file will be generated by sys/bios. I am also not how the system tick will be generated. Is it generated by the clock module and I have to assign a timer for it?

    I appreciate any hints you can provide.

    Thanks and regards,

    Zhaohong
  • Hi Zhaohong,

    You hit the major highlights for moving to an non-OS application to TI-RTOS. Here's a few details

    Interrupts

    TI-RTOS manages the interrupts for you. You can create the interrupts in the .cfg or during runtime. One key thing to note is that the signature of the interrupt function changes. Do not use the "interrupt" keyword. Also the function takes a parameter ("arg"). "arg" is specified in the parameters in Hwi.create (in the .cfg) or in the Hwi_create (during runtime). Please refer to the ti.sysbios.hal.Hwi module for more details.

    Clock

    The TI-RTOS kernel, by default, takes one timer to drive its clock. You can tell the kernel to not use a timer and instead the application can drive the clock by calling Clock_tick. Let's assume you let the kernel own a timer. You can configure which timer it uses via the Clock timerId. You can also configure the period for that timer. The kernel allows you to plug in Clock functions that will be executed at a specified period or just once in the future. This allows the kernel timer to be essentially multiplexed. Here's an example. Assume  the period of the kernel timer was 1ms. You could plug in a function that is executed every 50ms and another that executes every 60 ms. You can also schedule a one-shot clock function that will execute in 20ms. Note: all of these have to be a multiple of 1ms since the timer's period is 1ms. As noted before, you can change this period if desired. For more specific details, please refer to the ti.sysbios.knl.Clock module.

    If the Clock function is not sufficent, you can still use a different timer. For instance, you need something that will run in 250microseconds. Instead of changing the kernel timer's period to 250us (and paying an extra overhead for the things the kernel does when the tick happens), you can create and use a different timer. Please refer to the ti.sysbios.hal.Timer module for more details.

    Todd

  • Todd,

    Thanks. I got my application working with sys/bios by converting interrupts to HWIs and the mainloop to a task. I also set up a 1 ms system tick to call the task. Thanks again for your support.