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.

SYS/BIOS example on BeagleBone White -- runtime xdc error raised

Other Parts Discussed in Thread: AM3358, SYSBIOS

Hi all,

First time poster here.  Spent the last several weeks working through all sorts of issues learning StarterWare, CCS, etc.  Finally hit a problem I can't figure out on my own and can't find any answers on the forum here (someone else had a similar problem but no one answered him).

So what I did is, I first learned about using StarterWare and got the gpioLEDBlink example to work on my BeagleBone White (AM3358 core, has JTAG emulator on it, Rev A6).

Then I started learning SYS/BIOS and tried to get the simple helloWorld example going which just starts a task that just printf's to the terminal.  Everything built and I got no runtime errors, but I couldn't find anywhere in CCS that the strings were printed.  I found other examples online looking like strings just printed to the Debug Console output window, and there was nothing there for me.

So, in trying to see if it was just an issue with my printf or something, I thought I would just combine working code from gpioLEDBlink so that instead the task would be created and all it would do is flash the LED.  That would show me things were working right.  But alas that was way too optimistic...

I'm now getting the following runtime error and I need help figuring out what's causing it.  Since both examples worked on their own, I'm not sure where to start.

It builds correctly, connects to the target fine, then I run the AM335xInitialiationScript, which works fine too and the debugger starts paused at main().

When I hit Resume, I get the following:

[CortxA8] 0x44e000ac R8 = 0xffffffff
R1 = 0x00000000 R9 = 0xffffffff
R2 = 0x800062e8 R10 = 0xffffffff
R3 = 0x48200000 R11 = 0xffffffff
R4 = 0xffffffff R12 = 0x6000011f
R5 = 0xffffffff SP(R13) = 0x80010848
R6 = 0xffffffff LR(R14) = 0x800062f8
R7 = 0xffffffff PC(R15) = 0x80005058
PSR = 0x6000019f
DFSR = 0x00000005 IFSR = 0x00000000
DFAR = 0x44e000ac IFAR = 0x00000000
ti.sysbios.family.arm.exc.Exception: line 180: E_dataAbort: pc = 0x80005058, lr = 0x800062f8.
xdc.runtime.Error.raise: terminating execution

There is also a new window that opens and says "Can't find a source file at "c:\users\user\appdata\local\temp\ti93f9~1\src/exit.c""
That example is pointing to Loader_exit() in the debugger window:

          C$$EXIT, loader_exit:
8000872c:   E1A00000 MOV             R0, R0
80008730:   E12FFF1E BX              R14
          abort:
80008734:   E92D4008 STMFD           R13!, {R3, R14}
80008738:   EBFFFFFB BL              loader_exit

Is this some undefined symbol?  Not sure what's calling for it.  There's no function called that in my program.

Not sure where to begin.  Help please!

Here are my settings:
CCS 5.5.0.00077
SYS/BIOS 6.37.5.35
XDC  3.25.6.96
Target: ti.targets.arm.elf.A8Fnv
Platform: ti.platforms.beaglebone
Variant: BeagleBone [Cortex A]
Linker command file: <blank>
RTS lib: Automatic

I've attached main.c and my app.cfg here.  Note: I haven't done anything to the app.cfg, figured it was configured already for the simple task launcher example.  But I am new to SYS/BIOS so perhaps I'm just missing some important step.  It doesn't look like people have done much bare-metal SYS/BIOS stuff with the BeagleBone white on here, or I just can't find it.

Thanks!

7041.main.c

0333.app.cfg

  • I forgot to mention, I also tried to create a custom platform using the RTSC Platform Wizard, following an example by another BeagleBoner (OK, not the best term to invent). :)

    However, when I clicked the "Finish" button to do that step, the Wizard just closes and doesn't create my config at all. Guess this is a separate problem but if anyone's resolved that either, that would be helpful.
  • Joel Wigton said:
    I forgot to mention, I also tried to create a custom platform using the RTSC Platform Wizard, following an example by another BeagleBoner (OK, not the best term to invent). :)

    However, when I clicked the "Finish" button to do that step, the Wizard just closes and doesn't create my config at all. Guess this is a separate problem but if anyone's resolved that either, that would be helpful.

     
    Joel,
    can you post a screenshot of the Platform Wizard dialog just before you click on Finish? Is there any content created in the directory where you wanted the platform to be located?
  • Sasha,

    Here is an image before I hit create.  I copied the exact settings from this other e2e posting here, which seemed to work for them.

    Also, I knew I shouldn't have asked another question in the same thread or it might detract from my original post... has anyone seen the first issue I wrote about?  I don't even really have to get the custom platform question resolved if the existing TI BeagleBone config can be working for me!

    Thanks

  • Hi Joel,

    I will try to reproduce the issue. I will get back to you tomorrow after I install the products you mentioned above.

    Regards,
    -- Emmanuel
  • Hi Joel,

    I am unfamiliar with AM335x StarterWare so I will try to get your SYS/BIOS example working. I was able to install the CCS & SYS/BIOS versions mentioned above and tried the Hello world example. Unfortunately, I could not reproduce the error you are receiving (I saw output on the console). Can you upload your project so that I can test it on my setup? What compiler tools are you using (TI/GCC)?

    Regards,

    -- Emmanuel
  • Emmanuel,

    Many thanks for trying to help.  

    I am using the TI v5.1.1 compiler.

    If you just try the Hello World example, that may work for you.  What I'm trying to do however is run a SYS/BIOS simple example that simply creates one Task, calls it, and never returns.  Instead of printing inside that task, however, I instead inserted code from a AM335x StarterWare example, that just toggles the LED.  Even if you are unfamiliar with StarterWare, the example is pretty simple if you look at main.c.  The code was just copied/pasted from a NON-sys/bios example that did work to flash the LED.

    So it seems to be the combination of the two that is causing some issue.

    I wasn't sure what files you need so I zipped up the whole project.  Please let me know what happens.  Also, can you please let me know what settings you are using, for example, Target/Platform/what .gel file used, etc., if you can get it to work?  If you can get it to work, you might be able to zip yours and send it back and I can do a folder diff with Beyond Compare and see what is different in mine breaking it.

    Many thanks,

    Joel

    7522.mutex_ex.zip

  • Hi Joel,

    Sorry for the delay.  Looking at your hello.cfg, I noticed that the MMU was not configured to disable caching of peripheral registers.  The code snippet below is an example of how to do this:

    var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');

    Mmu.enableMMU = true;

    /* Force peripheral section to be NON cacheable */ var peripheralAttrs = { type : Mmu.FirstLevelDesc_SECTION, /* SECTION descriptor */ bufferable : false, cacheable : false, shareable : false, noexecute : true, }; /* Define the base addresses in which the peripherals reside. */ /* Clock Module, GPIO0, UART0, I2C0 */ var peripheral0BaseAddr = 0x44E00000 /* GPIO1, UART1, UART2, I2C1, McSPI0, McASP0 CFG, McASP1 CFG */ var peripheral1BaseAddr = 0x48000000 /* GPIO2, GPIO3, UART3, UART4, UART5, I2C2, McSPI1 */ var peripheral2BaseAddr = 0x48100000 /* Configure the corresponding MMU page descriptor */ Mmu.setFirstLevelDescMeta(peripheral0BaseAddr, peripheral0BaseAddr, peripheralAttrs); Mmu.setFirstLevelDescMeta(peripheral1BaseAddr, peripheral1BaseAddr, peripheralAttrs); Mmu.setFirstLevelDescMeta(peripheral2BaseAddr, peripheral2BaseAddr, peripheralAttrs);

    For more info see the MMU details section of SYS/BIOS documentation (cdoc ti.sysbios.family.arm.a8.mmu).  After adding the code & rebuilding the application, I debugged it and saw the LED blink.  I used the default platform and manually created a ccxml file with default settings (XDS100v2 for BeagleBone).

    4722.HelloExample.zip   https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/355/6232.BeagleBone.ccxml

    Hope this helps,

    -- Emmanuel 

  • Thanks, Emmanuel, this worked! I just have two followup questions if you would:
    1. How did you know from the error message I printed that this was the issue? I don't see anything there indicating an MMU issue besides that some addresses it listed were related to GPIO. (I am just trying to learn for future debug).
    2. I read through that documentation and I'm not sure why disabling caching for peripheral addresses solves this problem. So by default my peripheral address space was being cached, but the MMU wasn't even on, so how is it protecting this memory? The documentation just says to add peripheral addresses to MMU table as non-cached "so that it can be accessed by code at runtime," but doesn't explain why. Is there some basic tutorial or documentation I should be reading about this first?

    Thanks again!
    Joel
  • Hi Joel,

    Joel Wigton said:

    1. How did you know from the error message I printed that this was the issue? I don't see anything there indicating an MMU issue besides that some addresses it listed were related to GPIO. (I am just trying to learn for future debug).

    The exception mentioned it was a data abort, the DFAR register has the address where the data fault occurred (which looked like a peripheral address).

    Joel Wigton said:

    2. I read through that documentation and I'm not sure why disabling caching for peripheral addresses solves this problem. So by default my peripheral address space was being cached, but the MMU wasn't even on, so how is it protecting this memory? The documentation just says to add peripheral addresses to MMU table as non-cached "so that it can be accessed by code at runtime," but doesn't explain why. Is there some basic tutorial or documentation I should be reading about this first?

    Actually SYSBIOS enables the MMU by default and sets all regions defined in the linker file as cache-able. So the code above maps the peripheral addresses and disables caching.  

  • Hi Emmanuel,

    Great points, thank you!  

    I know this seems like the thread that will not die, but I have one final issue that you did not seem to run into.  For me, your changes fixed that runtime issue, but to get the LED to blink I had to change the delay function I was using,

    from:

    Delay(0x3FFFF);

    to:

    Task_sleep(100);  // 100ms

    where previously Delay() was defined as:  

    static void Delay( volatile unsigned int count ) { while(count--); }

    When using the Delay() statement, it would enter that function and never return.  Is there something about SYS/BIOS that a task cannot call another function?  I'm wondering if there is something about your main.cfg that allowed this to work for you without modification.  

    Thanks,

    Joel