Difference between revisions of "Linux Debug"

From ArmadeusWiki
Jump to: navigation, search
(Testing Linux kernel)
(Chnage some titles)
Line 1: Line 1:
 
** Tips to do debug under linux **
 
** Tips to do debug under linux **
  
===Introduction===
+
==Introduction==
  
 
On this page, you will find usefull informations for debugging Armadeus under Linux
 
On this page, you will find usefull informations for debugging Armadeus under Linux
  
===Testing your custom Linux kernel before flashing it===
+
==Testing your custom Linux kernel before flashing it==
  
 
You can test a linux kernel you've generated without having to reflash your board and destroy your currently working image.
 
You can test a linux kernel you've generated without having to reflash your board and destroy your currently working image.
Line 12: Line 12:
 
  BIOS> bootm 8000000
 
  BIOS> bootm 8000000
  
===imxregs===
 
  
This tool allows you to access iMX registers from linux userspace/console. This way you debug your driver or access iMX hardware functionnalities
+
==Changing processor registers from Linux user space with imxregs==
directly from Linux console.
+
 
 +
This tool allows you to access i.MXl registers from linux userspace/console. This way you debug your driver or access i.MXl hardware functionnalities directly from Linux console.
  
 
First, you have enable this tool in Buildroot (package selection for target):
 
First, you have enable this tool in Buildroot (package selection for target):
Line 34: Line 34:
 
  # imxregs    (to dump all supported registers)
 
  # imxregs    (to dump all supported registers)
  
====Examples:====
+
===Examples:===
 
Show OCR1 registers of each GPIO Port:
 
Show OCR1 registers of each GPIO Port:
 
  # imxregs OCR1
 
  # imxregs OCR1
Line 41: Line 41:
 
  # imxregs OCR1_D 123
 
  # imxregs OCR1_D 123
  
===fpgaregs===
+
 
 +
==Changing FPGA IP's registers from Linux user space with fpgaregs==
  
 
This tool allows you to access FPGA registers from linux userspace/console. This way you can easily debug your driver directly from the Linux console.
 
This tool allows you to access FPGA registers from linux userspace/console. This way you can easily debug your driver directly from the Linux console.
Line 55: Line 56:
 
  # fpgaregs address (for read) or fpga address value (for write)
 
  # fpgaregs address (for read) or fpga address value (for write)
  
====Examples:====
+
===Examples:===
 
Show register at internal FPGA address 0x0010:
 
Show register at internal FPGA address 0x0010:
 
  # fpgaregs 0x0010
 
  # fpgaregs 0x0010
  
 
Write 0x0123 to FPGA register 0x0020:
 
Write 0x0123 to FPGA register 0x0020:
  # imxregs 0x0020 0x0123
+
  # fpgaregs 0x0020 0x0123
  
  
===Links===
+
==Links==
 
http://www.armadeus.com
 
http://www.armadeus.com

Revision as of 23:44, 3 January 2007

    • Tips to do debug under linux **

Introduction

On this page, you will find usefull informations for debugging Armadeus under Linux

Testing your custom Linux kernel before flashing it

You can test a linux kernel you've generated without having to reflash your board and destroy your currently working image. Indeed Linux kernel images can be loaded and started from SDRAM with U-Boot:

BIOS> tftp 8000000 linux-kernel-2.6.16-arm.bin
BIOS> bootm 8000000


Changing processor registers from Linux user space with imxregs

This tool allows you to access i.MXl registers from linux userspace/console. This way you debug your driver or access i.MXl hardware functionnalities directly from Linux console.

First, you have enable this tool in Buildroot (package selection for target):

$ make menuconfig

Once done, compile it:

$ make

The generated file is located in buildroot/build_arm_nofpu/imxregs-1.0/. Now you can copy it on your target.

To use it, you must clear PAR 1&2 registers (register access rights) before launching Linux kernel, so in U-Boot type:

BIOS> mw.l 0x00200008 0
BIOS> mw.l 0x00210008 0

Then in linux, launch it like that:

# imxregs REGISTER_NAME  (give it the register name as printed in iMX Ref Manual or just the begining of the name)

or

# imxregs    (to dump all supported registers)

Examples:

Show OCR1 registers of each GPIO Port:

# imxregs OCR1

Write 123 to OCR1_D register:

# imxregs OCR1_D 123


Changing FPGA IP's registers from Linux user space with fpgaregs

This tool allows you to access FPGA registers from linux userspace/console. This way you can easily debug your driver directly from the Linux console.

First, you have enable this tool in Buildroot (package selection for target):

$ make menuconfig

Once done, compile it:

$ make

The generated file is located in buildroot/build_arm_nofpu/fpgaregs-1.0/. Now you can copy it on your target. Then in linux, launch it like that:

# fpgaregs address (for read) or fpga address value (for write)

Examples:

Show register at internal FPGA address 0x0010:

# fpgaregs 0x0010

Write 0x0123 to FPGA register 0x0020:

# fpgaregs 0x0020 0x0123


Links

http://www.armadeus.com