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.

No CIO when using SYS/BIOS SysStd tools

Other Parts Discussed in Thread: SYSBIOS

Just installed CCS V6.1 on license. Taking the SYS/BIOS training and attempting to run "hello world" using the System_printf() to engage xdc tools and start the ball rolling. Discovered that a simple "hello world" using the printf() works fine and shows the CIO console option when run Loading the SYS/BIOS version using the xdc operations fails with no CIO console showing. I've tried setting the CFG file options to "System.SupportProxy = xdc.useModule("xdc.runtime.SysStd");" This compiled and built just fine, but got no output again. I traced the code thru to the SysStd_putchar() operation and got an error on the 'ch' variable. It's saying "Cannot read from optimized location". There is no return var on the final putchar() so I don't know if this is failing. Right now I have no stdout from SYS/BIOS OS. Can someone help?

  • Hi Aaron,

    In the default case, the System.SupprotProxy uses SysMin. When using System_printf() with SysMin, the data you want to print out is stored in an internal buffer. To get data out to the console, you need to call System_flush(), which will output the internal buffer to the console. By default, SysMin has flushAtExit defined as true, so when the program ends, the internal buffer will be dumped to the console as is the case in the "hello world" example.

    As for the issue with SysStd, can you make sure that there is no other instance of System.SupportProxy overwriting your assignment?

    Gilbert
  • Hi Gilbert;
    Thanks for getting back to me so fast.
    OK, checked out the duplicate call, not confirmed. No duplicate.
    Tried adding the System_flush() while going back to the SysMin proxy, still fails. however I note that the line following is
    SysMin.outputFxn = null; Is this a problem?
    Tried going to the TI compiler, won't compile. However I note that the optimizer asks for a newer version of GNU. Is this a problem? Maybe a pun?
    Any other suggestions?
    Thanks,
    Aaron
  • It shouldn't be an issue for the outputFxn to be null. Are you building one of the examples provided by the Resource Explorer or your own custom one? Which board are you using and which versions of TIRTOS and SYSBIOS are you using?

    Gilbert
  • Hi Gilbert;

        Just trying the example programs from the SYS/BIOS install V2.1.1.2 (as listed on the install dir). I thought that the RTOS and SYS/BIOS were the same, but I see a dir here marked 'bios 6_45_00_19' does that sound right? Don't know were to find the GNU version. I found a file marked something like GNU build 8.5.0.201409172108.

    Thanks again for your help,

    Aaron

  • SYSBIOS is the kernel we use for our RTOS. The bios_6_45_00_19 does sound like something I'd expect, but it is an older version of SYSBIOS than what we are using for the latest version of TIRTOS.

    In CCS, if you go to View -> Resource Explorer (Examples), you should see something similar to the screenshot below:

    If you do not see anything related to TIRTOS, you either don't have TIRTOS installed or CCS can't find it.

    In the former case, you can go to View -> CCS App Center, and go through the CCS Add-ons to find the appropriate TIRTOS installation for you.

    In the latter case, you should make sure that your TIRTOS installation is in the same directory as your ccv6 directory (default should be C:\ti).

    If you do see your the correct TIRTOS for your platform, you can go through some of the examples provided there as they have been configured to work for that platform. The "hello world" example is listed under the Kernel Examples, where you can find a few others such as the Memory and Clock examples.

  • Hi Gilbert;
    OK, it looks like CCS View-> resource Explorer is not showing the TI RTOS for the AM437 I had installed nor does it recognize the brand new one I just installed. The old version was 'processor_sdk_rtos_am437x_2_00_01_07' and the one I just installed is 'processor_sdk_rtos_am437x_2_00_02_11' . When I ran the install the CCS recognized I had new resources and asked me if I wanted them. I said OK at the dialog. The CCS presumably incorporated them and restarted. Still not showing any RTOS in the explorer. Obviously something is buggy. Any more clues?
    Thanks,
    Aaron
  • Hi Aaron,

    I apologize. I did not realize you were using a Sitara device. Resource explorer will not show anything as explicit as TIRTOS for Sitara devices. Instead, in Resource Explorer, you should see SYS/BIOS and you could navigate your way to "AM473x - Cortex A8" (which seems to be a typo), where you can find your device and a few examples along with it.

    Gilbert
  • Hi Gilbert;
    Fine, but none of those projects seem to engage the CIO console either which was what this problem started out with. Why doesn't the xdc engage my CIO console? I don't stand a chance of getting any of these examples to work without that. Again my problem was that the final putchar() operation in the SysStd out was faulting in not getting reference to the character to print. See my first post. If you don't know can you please elevate? Other wise I have a pile of junk here.
  • There is a nice FAQ on the SYSBIOS wiki that you can look at which should solve your problem: 

    http://processors.wiki.ti.com/index.php/SYS/BIOS_with_GCC_(CortexA)#Why_is_System_printf.28.29.2Fprintf.28.29_not_working_.3F

    It basically boils down to:

    1. make sure you are using the semihosting module: var SemiHostSupport = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
    2. Change the "nosys" library to "rdimon"
    3. Make sure semihosting is enabled in the program/memory load options

    There is also a semihosting example in the resource explorer that you can look at.

  • Hi Gilbert;

       Well, honestly I thought you had it nailed. But I went and checked out the Property page for the program and found that everything was already set up exactly as the example showed except for the xdc source. I set that up but the version I have is newer than the example, I have 3.31.2.38_core while the example shows 3.25.1.64_eng. Not sure if that makes a difference. I build with only 1 warning, My Linearo is newer than what the example expects. The rest is exactly as expected. semihosting engaged, the var in the .CFG file quotes exactly right.

    Anything else I may be missing?

    Aaron

  • Hi Gilbert;
    Came across a possible problem that may be the reason for this problem. If I go to the property page for the debug version of this project, then go to the General -> Main, I can't choose a target that clears off the errors and I can't leave the window. i.e. for 'Device' if I select Generic Cortex A9 (the closest thing to what I have) doesn't take. The error is "none of the currently selected products supplied the target, try using a pre-3.3 version of the xdc tools". It doesn't seem like I should need to back up my versions, but if I do, where do I get them? By the way, I used the above trick on the hello world example and it worked!
    Thanks,
    Aaron
  • Hi Aaron,

    If you change the device variant, it will clear the Target field in the General->RTSC tab if it can't find one, which seems to be what you are seeing. You would need to fill it in with the closest target available, which I believe is "gnu.targets.arm.A9F", and you would need to choose the closest platform. That should get rid of the error you are seeing.

    Gilbert
  • Hi Gilbert;
    Set up now for EVMAM437X. This looks right foqr my IDK_AM437 card, closest there is anyway. Now there are bizillions of linker command files in the choice list none of which match my target. Also there are a slew of runtime support library file choices as well. These have more cryptic names like librdimon_s.a etc.. Which do I choose?
    Aaron
  • I don't think the linker command file nor the runtime support library are required to build the project, but if you do need them I think you can use AM437x.lds for the linker command file and libc.a for the runtime support library.

    Gilbert
  • Hi Gilbert;

       Well, I played around with the various libraries to see what would build and what wouldn't. Turns out that if I leave it on <automatic> it picks libc.a. That is the only one that works. Otherwise the build has errors. So I thought that maybe the problem is with the libraries that the build chose to use. I noted that in the Project properties-->GNU Linker-> libraries listings under Library search path, the paths all point to some offshoot of starterware. Didn't look right. What do you think? Shouldn't the SYS/BIOS use .....\fpu stuff?

    Aaron

  • Yes, I believe you are correct in that it should be pointing to the fpu libraries. I'm not sure why you are seeing something different.

    Gilbert
  • Hi Gilbert;
    Well, after a good look at the literature, my take is that the CONSOLE UTILITIES inside a task will not use the CIO unless the code is designed as reentrant. A scan through the suppled files produced no source code written that will support that requirement. I would have to re-write the "starterware" code to enable that sort of functionality. That leaves me with only the UART interface thru the serial/USB connection. I have further problems in that I can't seem to find a HOST USB to serial driver that I can use to connect the IDK card to the board. Do you know the procedure for getting this arrangement setup?
    I have to confess that i think this process has been very poorly informed and supplied. The examples leave much to be desired.
    Thanks for any clues,
    Aaron
  • The CIO should work with our examples. Can you zip up your project and post it so we can look over it?

    If you want to use the UART to print out to a console app, you have the option of using SysCallback to your cfg file like so:

    var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
    SysCallback.putchFxn = "&yourCustomUartPrintf_putch"; // your implementation
    SysCallback.flushFxn = "&yourCustomUartPrintf_flush"; // your implementation
    System.SupportProxy = SysCallback;

    This will allow you to still make calls with System_printf(), but it will print our over UART once you implement the two functions.

    As for getting a HOST USB to serial driver, that is a better question for the device forums.

    Gilbert

  • Hi Gilbert;
    Here is the project. Pretty much straight out of the SDK. Remember I am using the IDK_AM437x EVM board. My goal is to use the BiSS bus firmware interface to convert data and stream it out to another system. I'll try to engage the putchar() calls in the CONSOLEUTILS supplied to see if I can get the System_printf() working.
  • After looking over the example, it seems like it is an example made by the Processor SDK group and not one of ours. If you are having issues with the examples provided by the Processor SDK, it would be better to ask in the device forums found here:
    e2e.ti.com/.../791

    One thing I did notice in the project properties is that the the libraries the linker includes has both "nosys" and "rdimon". Try getting rid of the "nosys" library.

    Regards,
    Gilbert
  • Hi Gilbert;

       Well, definitely stranger and stranger. I created a new directory, copied the files over from the old one. Did a binary edit on the new copy to change the project name. re-imported from the new directory with the updated name and voila. I got the stuff working. You're right about the nosys library. But I couldn't get rid of it. Every time I deleted it, it came right back. Never did get CONSOLEUtilities working though. Maybe later.

       So I'm going to change the subject and ask you how to find the "fully qualified name" of my idle thread fxn()? No clear examples in the help.

  • Are you using a custom idle task or are you referring to the SYS/BIOS one? The Idle function that usually runs is called Idle_loop() which can be found in ti/sysbios/knl/Idle.c in your SYS/BIOS install directory. If you want to set a breakpoint there, it's usually looks something like "ti_sysbios_knl_Idle_loop__E". If functions have been added to run during the Idle task, Idle_run() will go through the function list.
  • Hi Gilbert;

        Finally had a chance to check out the Idle function in the idle.c module. Not breaking there at all. I double checked the .CFG file and do have the idle operation engaged. Idle_run() is not executing. How do I find the problem?

  • You can do a quick test to see if the Idle function even executes at all. You can comment out main (or just rename it). You should make sure that the cfg is also not creating any tasks. If it is, you can just comment it out for now. You can make a new main that just calls BIOS_start(). This should be able to verify that the Idle task is running.

    The Idle task should only run when there is nothing else to do. If you program does not reach the Idle task, this means that there is a task (or tasks) that is active and using resources. If the task is not currently needed, you can have the task sleep for a while or block on a semaphore until it is needed again.
  • Hi Gilbert;

       Good news I did get the idle loop processing. It was just the buggy UI to configure the .CFG file again. I note that many of my problems have this as the root cause. I manually edited the file to set the enabletaskidle flag to true and it worked fine.

        Back on the CIO problem with the CONSOLEUtils. I did some further digging. If I simply use the putchar() call directly in line with my code, I can get the char on the stdout console output. Turns out that the starterware library that comes prebuilt with the CSS is built without the 'SEMIHOSTING' compiler flag set. So they are compiled without the semihosting stdout support. I need to re-build the 'utils' lib to make it work properly. There is a proj file at the head directory of the utils tree. Can't get it to load. Can you point me at the procedure to rebuild the supplied libraries?

    Thanks again,

    Aaron

  • If it is from starterware, then it sounds like it's something that was packaged with the Processor SDK. The people at the device forums are better equipped to answer your question about rebuilding the 'utils' libraries:
    e2e.ti.com/.../791

    Does linking in 'librdimon.a' (should already have 'SEMIHOSTING' enabled) as your runtime support library cause issues? I recall that you said that you had errors building with anything that was not 'libc.a'.

    Regards,
    Gilbert