Little endian register display

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Little endian register display

850 Views
deans
Contributor I

Is there a way to define a register as little-endian in the xml used by CodeWarrior? I haven't been able to find the schema.

Example:

        <registers>
          <register>
            <name>example</name>
            <access>R</access>
            <register-details-file-name>blkX/example.xml</register-details-file-name>
            <offset>0</offset>
            <size>4</size>
            <base>
              <direct-base>
                <base-model>MMR_BASE</base-model>
                <base-address>0x124000</base-address>
                <base-memory-space>4</base-memory-space>
              </direct-base>
            </base>
          </register>

Note that bitrange does seem to handle bit being number w/ 0 as the lsb, e.g., 

      <bitrange>15:8</bitrange>

but a register of size 4 is read as big-endian.

Thanks,

0 Kudos
3 Replies

512 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Dean Saridakis,

Which processor and which version CodeWarrior do you use?

As normal, CodeWarrior display register values in the correct byte order, as described in the processor Reference User Manual. You could display register values in the reverse order in the debug shell as the following example, please open debug shell from Window->Show View->Debug Shell.

CodeWarrior Debugger Shell v1.0
%>display gpr0
  + General Purpose Registers
    GPR0=0x000000007FF46FE0
%>display gpr0 -s
  + General Purpose Registers
    GPR0=0xE06FF47F00000000
%>change gpr0 01
%>display gpr0
  + General Purpose Registers
    GPR0=0x0000000000000001
%>display gpr0 -s 01
  + General Purpose Registers
    GPR0=0x0100000000000000
%>display gpr0
  + General Purpose Registers
    GPR0=0x0000000000000001
%>change gpr0 -s 01
%>display gpr0
  + General Purpose Registers
    GPR0=0x0100000000000000
%>mem fe211000
          fe211000  0x05FAA1E4   .... 
%>mem fe211000 -s
          fe211000  0xE4A1FA05   .... 
%>mem fe211000 =10
%>mem fe211000 -s =0x20000000

If the above doesn't help, would you please explain your purpose in more details? Why do you want to change xml file in CodeWarrior to display register values in the little-endian?


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

512 Views
deans
Contributor I

Wow - thought I'd responded ages ago, but must not have...

I'm using CW for PA. We have a custom SoC where some of the register blocks are little-endian and have added xml for those blocks.

-s in the debugger shell is what I've been using as a work-around, but the gui display is much nicer for most users (especially decoding bit fields). Also, -d isn't working w/ this xml -- haven't looked into it (perhaps it doesn't like the bitrange's).

So, is there currently a way to tell the gui to byte-swap in the xml? If not, can we put this in as an enhancement request?

Thanks,

0 Kudos

512 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Dean Saridakis,

Thank you, we will report your request to CodeWarrior development team.

Thanks,

Yiping

0 Kudos