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.

CCS/BEAGLEBK: RTOS example projects issue

Part Number: BEAGLEBK
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

Regarding the posting :

e2e.ti.com/.../2497610

Which was never answered, I will say the following:

1. As typical for support on from TI, they simply marked it as "TI Thinks Resolved", and locked it off.  Without ever answering.

2. How the XDC/SysBios actually assigned the entry vector is just "FM" (F - Magic) from the point of view of us in the real world.  When it works, you have NO CLUE what, where, or how.  When it doesn't work there is no doc or support to make it work.  And that is about 50% of the time.  Even one of the helpful replies to one of my questions said "I don't know why XDC and SYS/BIOS have not been changed to make this detail easier.  I'll ask those experts to comment on this thread."  Of course, there was silence.

3. Trying to use the linker commands are mostly useless, because the build tool recreates the entire linker cmd file from ...? (i..e. Pulls them out of it's... air), and overriding them is a nightmare.

processors.wiki.ti.com/.../Linker_Command_File_Primer

4.Trying to use the recommended custom.cmd to "enhance" the scripts apparently doesn't work in GNU, as was discussed in   apparently the syntax is different.

So... here is a summary and a couple ideas...

When using the SD card on the BBB, the bootloader has two integer values that it reads from the "app" file.  The length, and the location to load it to...  This second value is the same as the place to jump to the start the program.  (think about it...  should there have been three values, and then the base address would not have to be the same as the entry??  But that's the way they made it...  ) So, we must set the beginning of the program to be the same as the load address.

So... the goal of the original post from Riccardo is to get the entry point of the program to be at location 0x8000 0000.  Most likely, it is not.  The actual origin (where the initialization before "main" happens)  is a function called "c_int00".  The fastest way to determine where it is, is to look in the "debug" folder, and open the *.MAP file of the same name as the project, and do a search for "c_int00".  You will likely see a couple of spots.  One is the name of the module that the linker took it from.  Another will be the memory location of the function, along with it's length.  In my sample, it says:

LOAD ./main_led_blink.o

.c_int00        0x80000000       0xb4
 *(.c_int00)
 .c_int00       0x80000000       0xb4 C:\ti\bios_6_46_05_55\packages\gnu\targets\arm\rtsv7A\lib\boot.aa8fg(boot.oa8fg)
                0x80000000                _c_int00
 *(.c_int00)

Which tells me it was loaded at memory location 0x8000 0000, and is 0xb4 bytes long.  This is the way it is supposed to be.  If not, we are left out in the cold with no help and no useful support.  So, if you are grasping as straws... read on.

I offer these total and complete HACKS, which I take no responsibility for them working or not.

1.  If there is any *.lds file, REMOVE IT.  This is a linker script which tells the link stage what to do. I am guessing that XDC/SysBios is creating it's own and any script that the CCS/Eclipse tosses in there is a template, and will not work (must be customized).  It is very easy to accidentally have CCS toss one in there when you make a changes to the project properties.  I've fallen victim to this defective behavior myself.   But, of course the XDC system just lets you shoot yourself in the foot. 

Try the build again, and see if the "c_int00" is now in the right place.

NOTE: That if you are not building a SysBios project, you will need to create a linker script, or use one of the templates that CCS throws into your project.  Then you will have to examine, and perhaps modify, the startup_ARMCA8.s  (assembler) code that CCS created for you, and tweak the linker script to place the compiled sections in the right place. But that is a whole other thread.  It is actually easier to do that once you know how... you are not fighting with the XDC/SysBios tools which do all this stuff for you, thinking it's a favor, but just binding you in a straight jacket which you can't figure out.  (Non-SysBios is how I built my own bootloader, which runs from eMMC, and I even wrote a copier to move "app" from the SD card to eMMC - Now I can boot the BBB from eMMC and even copy programs over.  And not rely on the mechanical SD card connection, or pressing the "boot" button)

2. If that didn't work, then we assume that XDC/SysBios isn't placing your entry point where it needs.  I have no idea what might cause that, or how to fix it.  Try adding you own new script at the project root.  You can do what I did and name it "custom.cmd".  The environment "just knows" to use that when linking.  The complete contents of mine are:

MEMORY
{
     DDR : org = 0x80000000, len = 0x20000000
}

SECTIONS {
       .c_int00 : {
        KEEP (*(.c_int00))
    } > DDR
}

I just lifted this out of the "linker.cmd" file that appears to be generated from a working Sys/Bios project, preserved only the DDR memory address, and changed the name so it didn't conflict with the name "DDR3" which is in the auto-generated linker cmd file.

If neither of these work, I'm currently out of ideas (not to say I won't find another idea later).  Or maybe, just maybe, TI will offer some help.

By the way Riccardo , if it's not an issue with company confidential code, it's usually useful to post the zipped up project, but first delete any "debug" and/or "release" folder from the zip. They are recreated during the build process.

Hope this helps.  And my sarcasm gets some support attention from real TI people.  Not fellow amateurs, such as myself.

.  

45

  • The RTOS team have been notified. They will respond here.
  • I should have marked it as a "resolved".  Because my suggestions were meant to do that.

    Or at least a "suggested" solution, but I don't see a "suggested" check box.  Only a "resolved".

    However, It would be nice to get an actual answer from TI on this issue.  It is their environment after all.

    So I am marking this reply to capture the "resolved" flag...   If someone is looking for suggestions on the same topic, see the original post. Maybe it'll help them.

  • Hi Christopher,

    your first solution worked!! It was enough to remove the .lds file!! 

    I am quite astonished, thinking how simple it was to fix the problem and how many days I have spent uselessly trying to figure it out. 

    Thank you very much for giving me the support that I have not received up to now!

    Riccardo

  • Great news.

    So here's a new question, lets see if they respond:

    How would I set my entry point address to some other location?

    What if I wanted to set the entry to 0x8000:0400?  I could easily set the TIimage.exe to place that value in the image header, and the boot loader would place it there and jump to it.  But the XDC/SysBios/CFG file based build environment doesn't allow you to control it?

    Why would I want to??  What if I used XIP code in a ROM at 0x8000:0400, and set aside the 1K at 0x8000:0000 to be RAM, or maybe even EEPROM that could be field swapped...  Or there are a bunch of other use cases I could think of that I didn't want to be handcuffed to that address as an entry point.

    Does this environment allow that?  Is that explained anywhere?

  • Hi,

    One way to set this is using a template xdt file, which has the section placement code (in GNU linker format) and set Program.sectionsTemplate to this file. This will cause XDC to copy the contents of the template file into SECTIONS {} in the generated linker command file.

    For example, you have a SYSBIOS project with A8 core, by default the _c_int00 is placed at a certain location (by checking .map file) you  want to customize it (say place it at 0x8000:0400).

    1. In your .cfg file add:

    Program.sectionsTemplate = "MyApp.xdt";    //This is the location of the file, you can use something like "C:/temp/MyApp.xdt";

    2. Create a MyApp.xdt file with (using a text editor) a line:

    .c_int00 0x80000400 : AT (0x80000400) {*(.c_int00)}

    3. Build the CCS project and check the .map file. You should see the that, I just tested a typical SYSBIOS project with SYSBIOS 6_52_00_12. Attached the .xdt for your reference.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/MyApp.xdt

    Regards, Eric

  • lding said:

    Hi,

    One way to set this is using a template xdt file, which has the section placement code (in GNU linker format) and set Program.sectionsTemplate to this file. This will cause XDC to copy the contents of the template file into SECTIONS {} in the generated linker command file.

    That's useful to know.  Thanks.

  • Hi Scott,

    I am struggled to get EMMC boot of my BBB, until caught your post here,

    quote: "(Non-SysBios is how I built my own bootloader, which runs from eMMC, and I even wrote a copier to move "app" from the SD card to eMMC - Now I can boot the BBB from eMMC and even copy programs over. And not rely on the mechanical SD card connection, or pressing the "boot" button)"

    I am able to SD card boot with MLO/app. The .map file shows .c_int00 @ 0x80000000 0xb4.

    Would you mind elaborating in detail about how to build emmc MLO and sharing the "copier" program for my reference?

    Please advise, thanks in advance

    Mike
  • Mike,

    I'll take a day or two (evenings) to write it up. Give me some time.

    In the meantime, have you looked at the doc about ROM and bootstrapping?  It's called "spruh73", and starts in chapter 26, at page 5015 (  Don't ask me how TI came up with these file names.)

  • Mike/Scott,

    It is good to open a new thread with a title to describe the new issue, as the old one was already closed. That would be also helpful for others to find the relevant info when similar issue comes up.

    Regards, Eric
  • Very well. I will open a new thread. I will need a way to notify Mike of that thread (where to find it, it's name, etc...)
  • Scott,

    You can open a new thread, and mention that assign this to Eric. Then I will be notified. I will post the the link of this new thread in this old E2E. Or, you can directly post the new thread link in this old one.

    So when Mike looks into this old thread, he can find out. Thanks for the help!

    Regards, Eric
  • Hi Scott,

    Thank you for your prompt reply. Looking forward for the instruction.

    Best

    Mike
  • Hi Scott,

    I will closely follow any of your new posts. Thanks for the sharing and instruction.

    Best

    Mike
  • lding said:
    Scott,

    You can open a new thread, and mention that assign this to Eric. Then I will be notified. I will post the the link of this new thread in this old E2E. Or, you can directly post the new thread link in this old one.

    So when Mike looks into this old thread, he can find out. Thanks for the help!

    Regards, Eric

    Eric,
    I was not aware I could "request" that a post be assigned to someone.  There are a few people that are helpful, at least until they tire of it or me, and lose interest..  But it has always seemed random that I stumble on helpful people.
    I summarized my work here.
     

    I am not going post the code or the project, as I spend weeks and months figuring it out, after spending years trying to learn this eco-system. I have found TI support atrocious, and don't want to give away what TI should have documented in the first place  (I can make a long thread on that as well...)

  • Scott,

    You can't open/assign an E2E thread to a specific engineer. All threads go to a moderator first, he/she will assign it to an engineer with that expertise. It is not random, but within a small group of engineers.

    If you mention an engineer's name in the thread, most likely the moderator will assign it accordingly. And sorry for the unpleasant experience you may have with TI supports, we have been working hard to resolve customer issues.

    And thanks for opening a new E2E thread, sharing your experience to other community users! I also closed this original thread.

    Regards, Eric