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.

SysBios Project Boot up probelm

Other Parts Discussed in Thread: SYSBIOS, TMS320F28035

Hi 

I am using CCS 6.12 with SysBios 6.45.1.29. The platform is a custom board using TMS320F28035 and debugger pod is XDS100V2.

I am trying to port an existing non bios application to sysbios. I used an existing project for F28035 that uses semaphores and added my code and files to it. The code compiles and loads but upon run, it stops at ESTOP0 in the Rom area. 

Very rarely it executes and runs beyond boot, thus running the LCD and rest of code.

What should I look for, or how to debug. Flash and Memory utilization is about 50 and 70 percent. The problem is only in this project. Other example projects of sysbios run fine. 

I want to know and debug the problem bec otherwise i will not learn and will fall into the same pit some other time.

Regards

Jawwad

  • Hi Jawwad,

    I'm assuming the existing project was working before you added your code.

    Are you playing around with interrupts in your non-bios code? For example, enabling/disabling/creating/defining/etc. If you are, you need to use the BIOS Hwi APIs instead of working directly with the interrupts.

    Todd

  • Hi Todd,
    Yes the project worked before I added my code. The initial errors were with xdc/std.h and Project Headers in include files. I resolved those problems by commenting out unsigned int definition in control suite headers that my code uses. The program compiled and ran but crashed due to interrupts that as u mentioned were being enabled by my code. I commented all those lines so that the base gpio and non interrupt code runs. I did that so that I could debug and enable things step by step.
    After doing so the code ran but crashed with Int 19, i.e. is not defined in C28. Its os generated error interrupt as per some e2e previous msgs.
    After further reduction of code, the program now gets stuck at boot. It is minimal code. The code stop at ESTOP0. I tried both enabling and disabling startup module of sysbios but to no effect.

    Regards
    Jawwad
  • Hi Jawwad,

    Can you please provide some more details about your application?  How many Task functions are you creating in your application?

    Which SYS/BIOS example did you use as a starting point?

    When you added your code, did you add it all at once?  Or incrementally add things, verifying that the application still worked (didn't have the issue you are seeing now) with each new piece that was added?  If you did things incrementally, which parts did you add that you are sure worked and did not cause any problem?  Tracking this will help you narrow down what might be causing this.

    (if you did not add your code incrementally like this, you may want to retry and do it that way, if possible, so you will have confidence with the pieces you add and know that they work).

    Jawwad Hafeez said:
    After further reduction of code, the program now gets stuck at boot. It is minimal code. The code stop at ESTOP0. I tried both enabling and disabling startup module of sysbios but to no effect.

    Related to what I wrote just before this, what's the difference between the SYS/BIOS example that you started with (that worked), and this updated version?  (what's changed here?  What was added that could have caused it to stop working?)

    Again, it sounds like what you did was add all (or a large quantity) of your code to an existing (working) BIOS example, and you are working backwards from there.  I think it may be better to try the opposite - starting with the working example, slowly add your code into it, and verify it all still works as you move forward.

    Jawwad Hafeez said:
    The initial errors were with xdc/std.h and Project Headers in include files. I resolved those problems by commenting out unsigned int definition in control suite headers that my code uses.

    Can you provide some details on this?  What were (some) of the errors?  What is the "unsigned int definition" you had to comment out?

    Jawwad Hafeez said:
    I commented all those lines so that the base gpio and non interrupt code runs.

    Is there a driver package that you are using?

    Jawwad Hafeez said:
    ts os generated error interrupt as per some e2e previous msgs.

    What was the error you saw?  Can you please point me to these posts?


    Steve

  • Hi Steve,

    I spent last week, taking time off from my main stream development and worked on the issue. Here is what I have done so far

    The example that I used as base is “typical_TMS320F28035”. It creates two tasks and a clock. The clock function periodically posts two semaphores every 1000usec. Each task pends/blocks on its semaphore. It runs when its semaphore is posted and updates a dummy counter. After given number of runs, task2 exits by calling BIOS_exit. I made some changes in the original code of the project and it runs without issues.

    To resolve the boot up problem, I started the project from scratch again and added my files to it. Boot problem was resolved.

    After experimenting with the graphical cfg editor by adding, removing and changing parameters to optimize code size and ram usage, I started getting different problems e.g. compilation errors , os not working at all e.g. u run the example code and the clock function isnever called, neither the tasks. The os keeps running the idle code. I copied the cfg from reference project and it worked again. That means the graphical cfg editor is not very clean and may change the cfg file in a way that makes the project unusable.

    I started adding my code, making sure that none of the code enables an interrupt. The added code does:

    1 – Initialize gpio and spi in master mode without interrupts.

    2 - Writes to a lcd display over spi

    3 – Reads and writes to one wire and reads a rtc and id chip.

    4 – creates a clock object, and two tasks

    5 – Runs BIOS_start();  

    All that works fine but now the idle tasks stack overflows. Register view of CCS show IER with only Interrupt 13 and 14 enabled. Both are used by Bios.

    I get this error on console

    “ti.sysbios.hal.Hwi: line 174: E_stackOverflow: ISR stack overflow. xdc.runtime.Error.raise: terminating execution”.

    The code is sequential. After initializing the lcd and one wire devices, the code creates the clock, tasks and executes bios os. So only the clock and tasks are running apart from bios os.

     

  • Hi Steve,

    I increased program stack size and now it works. ROV shows that:

    The .stack is 50% at 1024 out of 2048 Words. Ram is at 84%, 6943 out of 8k words. 

    ROV Task Details shows:

    fxn: Idle Loop,   stackPeak:104;  stackSize:1024

    fxn: task1: ,       stackPeak:150, stackSize:512

    fxn:task2, stackPeak:104, stackSize:512

    All these values are well within limits. But I cannot use any recursive function e.g. sprintf of stdio.h. How much stack is used by each function call. Whats the way forward. not using string functions of stdio.h and writing own functions is too much of repetitive work. Any directions plz.

    Thanking you in anticipation

    Jawwad

  • You can use System_sprintf instead of sprintf.
  • Thanks ToddMullanix. It works now. 

    Also learned a lot about sysbios now.

    Thanks to you and Steve who generously helped. Just great