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.

Setting AM335x CPU mode (privileged/user).

Hi,

I'm working on a bare metal C++ application that needs to set various peripheral registers.  I'm using CCS  Version: 6.1.0.00104 with Starterware, BeagleBone Black and BlackHawk USB100v2.

After launching the debugger (BeagleBone_Black.ccxml) and running my programm, writes to memory locations in the Control Module (0x44E10000 - 0x44E11FFF) doesn't change the actual memory content.  I think I'm running in User mode and need privileged mode.  So, my question(s) are:

- How can I known the effective cpu mode ?

- How can I switch between cpu-modes (from user to privileged) ?

I have googled on this subject to no avail...

I have examined StarterWare source to no avail (CPUSwitchToPrivilegedMode() doesn't work, results in a deadloop @ 0x00020008)

Any help/advise is welcome.

Thanks in advance,

Paul

  • Hi Paul,

    Are you using a GEL that loads on target connect? Please take a look at the BBB gel for some guidance (ti\ccsv6\ccs_base\emulation\boards\beaglebone\gel). I believe lines ~497-501 enables lock mode. If you remove these lines are you able to write to the locations that you want to access?

    Lali
  • Hi Lalindra,

    For the moment I imported the gpioLEDBlink example project, deleted the main and replaced it with my own code, and now the SoC is in privileged mode (I'm able to change peripheral registers). For the moment I'm able to do my job. But I wonder how to setup a CCS project using StarterWare startup code... (bare metal no OS initialisation of DDR3, JTAG, etc)

    regards, Paul
  • hi paul
    I think you should use the GEL to initialise the pll,ddr and some other peripherals.
    or you can use the GEL to initialise the power and pll and then load the code in ccs project to initialise the ddr and some other peripherals you need.