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.

Questions about SYS/BIOS for F28335

Other Parts Discussed in Thread: SYSBIOS

I have some questions regarding SYS/BIOS for F28335. hopefully someone can help me answer these questions here.

  1. For other applications, we use a custom asm routine for codestart. Sys/Bios has its own init (ti_catalog_c2800_init_Boot_init ) function here, but I have not yet been able to figure out exactly what this does. Could you explain this? What would be the appropriate place for us to place the functionality we have in our startup routine (copying ramfuncs, zeroing out ebbs section)?
    In the SYS/BIOS startup configuration, the ti_catalog_c2800_init_Boot_init is listed in “functions called before c runtime initialization”, but I am not able to specify a “reset function 1”. The user reset function, when is this called? Is this the right place to put the startup routine?

  2. Initialization of system (GPIO, peripherals, etc). Where and when should this be done? In a separate task after the BIOS is started, or before the BIOS is started?

  3. Critical sections in application code. Should interrupts be disabled by Hwi_disable()? What happens if __disable_interrupts()is used instead?

  4. Is there any limitations to what SYS/BIOS API can be called before BIOS_Start? Can Hwi_disable be used for instance?
    And what about configuration of application parameters that uses semaphores. If we have an EEPROM using a shared SPI bus via a semaphore, can this be initialized before BIOS_Start is called?

  5. Mailboxes. Is is possible to prioritize messages sent to a mailbox? And is it possible for a task to overwrite replace a message in the mailbox with a new one?
    If we for instance have a HWI taking ADC measurements which should be sent on the CANbus via a dedicated CAN task using a mailbox to share the data to be sent. The ADC sampling time is faster than the frequency of the CAN task. Is it possible for the CANtask to only get the newest message posted by the ADC sampling HWI?

  6. Dynamic vs static creations of tasks/hwi etc. Is there any recommendations to best practice here? Dynamically created tasks, are the stack for these allocated from the heap, so this needs to be scaled based on the application?

  • Hi,

    First of all let me know what version of SYSBIOS you are using.  Now to try to answer your questions:

    1.  The SYSBIOS Boot module for C28 device does a few things like:  disables watchdog, configures the PLL, configures GPIO for XINTF.
         This boot module is run at reset so before cinit is processed.

         As far as your codestart function, do you need it before .cinit is processed or after?  It sounds like you would need it before .cinit is processed right
         since you want to zero out ebss and copy some ram functions?  If this is the case, yes the reset function is the right place to call this.
         You can do something like the following in your .cfg file:

         var Reset = xdc.useModule('xdc.runtime.Reset');
        Reset.fxns[Reset.fxns.length++] = '&your_function_here';

    2.  I think generally before BIOS is started.  So like in main().  Interrupts will be disabled at this point.  If you do it in a Task then note that interrupts will be enabled at that point.

    3.  Yes, you want to use Hwi_disable().   If you don't support zero latency interrupts, you might be okay.  If you support zero latency interrupts, it would not be okay as Hwi_disable is slightly different for supporting zero latency interrupts.

    4.  Yes, there are limitations.  Anything that requires interrupts to be enabled cannot be called before BIOS_start.  Hwi_disable() can be called, but interrupts are already disabled before BIOS_start so its like a nop.  My guess is no to your EEPROM using shared SPI.  This probably has to be done after BIOS_start.

    5.  We do not have a concept of priority messages in mailbox.  Doesn't sound like that's the right usage of mailbox.  A mailbox has a  limited number of messages.  Once there are no more free message slots, the task will block until a free message becomes available.

    6.  There is no recommendation cause its based upon what you app needs are.  Typically people who have tight memory constraints go with static creation while those who don't have memory constraints go dynamic.  Yes, the Task stacks are typically allocated from the heap.

    Judah

     

         

  • Thanks for the reply!

    Currently, I am evaluating SYSBIOS 6.35.04.50. Are there any recommendations for which version should be used? And what is the recommended version of xdc tools?
    We are using code composer 5.5.

    Some followup questions to your answers:

    1. Yes, before cinit is where we would need to place this. However, in my configuration the "functions called before C runtime initialization" are all greyed out in the GUI, so I am not able to add any initialization without typing it manually in the config file. When it is added manually, it shows up as reset function 0, and ti_catalog_c2800_init_Boot_init shows up as reset function 1. Must this be the other way around?

    Must this function be an asm function?


    What if we do not add the Add C28x Boot management and Startup to our configuration? Can we then just use our own asm file to link to codestart?

    3.We would need to be able to use zero-latency interrupts. So this means that if we call Hwi_interrupt disable, the zero latency interrupts are not disabled, but if using the normal interrupt_disable, they are?

    4. Ok, so to be safe here, we would init the SPI EEPROM at the beginning of a task.

    5. Is there any hwi/task signalling method that can be used for this? Meaning prioritizing messages and/or replacing the last sent message with  new?

    New questions:

    8. Nested interrupts. Is this handled automatically by SYSBIOS in Hwis when enabled in the configuration?
    What about in zero latency interrupts, is this supported? Must we open up for nested interrupts in the handler?

    9. You said that GPIO for XINTF is initialized in the boot module. I suppose this would have to be enabled in the configuration for it to happen? Cannot see any configuration for this there?

     

  • 1.  I don't think you can add reset function via GUI.  I think you need to do it via script.
         As far as the order....I think its okay your function is 0 and the Boot module's is 1 since they aren't dependent on each other.
         No, it doesn't have to be an asm function....why do you think it needs to be an asm function?
         I think the Boot module will be brought in no matter what, but you could disable everything such that the Boot_init() function is empty.
         This is also why you don't see GPIO for XINTFs not being initialized in your questions #9.  So if you do this, then you can manage things yourself.

    3.  That is correct.  Zero latency interrupts will not be disabled with Hwi_disable() but they will be with __interrupt_disable().

    5.  Sounds like you should use a Swi but I still do not fully understand what you are trying to do.
         An interrupt happens, you have some data that you want to save away and you want another thread to process that data but
         if another interrupt occurs before that thread is able to process the data, you want to overwrite that data?

    8.  Yes to nested interrupts are automatically enabled by SYSBIOS.  Zero latency interrupts are supported.  You do not need to reenable interrupts for nested interrupts.  SYSBIOS takes care of all this.

    9.  Yes, configuration needs to be enabled.

    Judah