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.

beaglebone and loadti

Hi.  I have a beaglebone black and an xds100v2 emulator.  They work ok with ccs5.  

I want to get loadti running with this hardware on core CortexA8 (not the wakeupSS).  I get the error:

SEVERE: m3_wakeupSS: Error connecting to target: (Error -1266 @0x0) Device is held in reset...........

The device is not held in reset, ccs5 loads & runs the same program

 

Then I discovered the dreaded caveat:

NOTE: loadti does not support multi-core debug by default. However, loadti can be modified to add this support. See the section called: Customizing loadti.

I just want to load a bare-metal program onto CortexA8, and not debug.  Is this supported?  Has anyone modded loadti to do this?

thx.................dd

  • I've never used this script, but I'd say the problem is this line in main.js:

    debugSession = debugServer.openSession("*", "*");

    This connects to "the first found target", which is guaranteed to be wrong on any ARM Cortex based device (since it will find the DAP before finding the processor).  Also, in the AM335x target config files, the wakeup-M3 is listed first which is the reason for the error you got (the wakeup-M3 is indeed held in reset by default).

    You can try openSession("*", "CortexA8") instead, or whatever the name is of the cortex-a8 in your target configuration.

  • ok, thanks. i'll give it a try. i want to load my own binaries into the bone, i wrote my own assembler.
    can i do this with ccs? (if loadti cannot)
  • Hi again. I cannot find the file main.js . please help. thanks............dd
  • For me it's right there in the loadti directory (scripting/examples/loadti). I am using CCSv6 however and don't have a CCSv5 install around anymore to check, so maybe it has gotten renamed or something.  Seems unlikely though, as this stuff looks quite old (as evidenced by the fact it's never been updated to support Cortex-based processors).

    It's also not hard to just write an upload script yourself, that's what I did.  If you basically just want to do the same as "load program" in CCS, the very short version would be something like:

    importPackage( Packages.com.ti.ccstudio.scripting.environment );
    importPackage( Packages.com.ti.debug.engine.scripting );
    
    env = ScriptingEnvironment.instance();
    
    ds = env.getServer( 'DebugServer.1' );
    
    ds.setConfig( 'target.ccxml' );
    session = ds.openSession( '*', 'CortexA8' );
    session.target.connect();
    session.memory.loadProgram( "demo.out" );
    session.target.runAsynch();
    

    You'll need to tweak some things like the paths to your target config file and program of course, and there are heaps of options you can set just as in CCS itself (via session.options).

  • yes, that works! the target name is CortxA8 thanks. it connects to the target and configures a bunch of stuff like ccs5.
    now i get severe errors:
    trouble writing memory block at 0x4c0000e4..... error 1065
    and
    gel: error while executing on ontargetconnect failed to write 0x4c0000e4
    which looks like it is not getting some required parameters.  

    like it has lost the path to ccs5 config parms. 

    what do you think?
    thanks again.............dd

  • hi again matt. this runs. thanks for the help. i get similar errors with this js snippet as with the main.js
    i need to bone up on target configuration stuff. is there a ti doc on this?
    thx................dd
  • hi again. no joy thus far. and now ccs5 debug hangs just after AM335x Beagleblack Initialization is done.
    ouch..........................dd
  • hi again. ok, it looks like my loadti escapade trashed ccs5. nothing loads with it.
    i got ccs6 up and running, so no worries.
    but i still need to get loadti going on my bbb.
    are there any ti docs for modding the dss scripts?
    can you upload yours and/or provide more instruction?

    thanks alot...............dd
  • Don Lawrence said:
    now i get severe errors

    yes, CCS likes to claim errors are "severe", regardless of whether they are. Typically it means "I can't perform this action right now because ( the cpu is not halted | something isn't enabled | i got confused | one of the many settings I could easily auto-detect but am forcing you to configure manually anyway is wrong )"

    Don Lawrence said:
    gel: error while executing on ontargetconnect failed to write 0x4c0000e4

    You have a GEL file (C-like scripting language predating javascript support) that's trying to write to 0x4c0000e4 (which is EMIF config).  In general you should avoid doing any initialization in a GEL file since depending on that means your app can't run without the help of CCS. The only thing that's still somewhat useful to have in a GEL file is the memory map definition.

    As for why it's failing, could either be for example because the cpu isn't halted (although I think it always halts it when connecting, annoyingly), the MMU is enabled and no flat mapping for EMIF config exists, EMIF itself isn't enabled through PRCM, etc...

    If you're writing code in assembler, then I very much doubt you're in any urgent need of the external RAM (given the amount of on-chip SRAM available), so you can probably skip initializing EMIF anyway.

    There's HTML documentation for debug-server scripting btw, at ccsv6/ccs_base/scripting/docs/DS_API/index.html
    For GEL files or target config I'm not sure...

    The example script I gave earlier in the thread should work btw, but I think only if you first get things working from within CCS since it seems to pull some options out of nowhere (probably project config or something).  Also, to start debug server scripting I use a shell script that's somewhat customized to make it more lightweight and use "rlwrap" for interactive use: ... wait, where the hell did the option to attach a file go? Damnit, stupid site "upgrade"... Well, let's see what happens if I insert it as "media" instead...dss.tar.gz

  • ok, thanks alot matt. i will grok those docs and give'r a go.......dd
    i really want to torture those 'tool' developers very slowly.
  • GREAT! Matt, I got it. your js snippet works! I just needed to delete all the existing main.js code, paste in your snippet then insert the correct values for target.ccxml, CortxA8 and demo.out It works repeatedly without reboot.
    I must have gotten those references wrong. It is hard 4 a noob 2 suss out all this undocumented spaghetti. I still don't know much about this beast. I never would have done it without u.
    thanks alot..................dd