Difference between revisions of "Linux Debug"
(moved installation) |
(→Changing processor registers from Linux user space with imxregs) |
||
Line 24: | Line 24: | ||
BIOS> mw.l 0x00200008 0 | BIOS> mw.l 0x00200008 0 | ||
BIOS> mw.l 0x00210008 0 | BIOS> mw.l 0x00210008 0 | ||
+ | </pre> | ||
+ | * on APF27: | ||
+ | <pre class="apf"> | ||
+ | BIOS> mw 10000008 0 | ||
+ | BIOS> mw 10020008 0 | ||
</pre> | </pre> | ||
Revision as of 23:50, 14 November 2009
Tips to do debugging under Linux.
Contents
Introduction
On this page, you will find usefull informations for debugging your Linux kernel/drivers.
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 ${loadaddr} ${board_name}-linux.bin BIOS> bootm ${loadaddr}
Changing processor registers from Linux user space with imxregs
This tool allows you to access i.MX registers from Linux userspace/console. This way you can debug your driver or access i.MX hardware functionnalities directly from Linux console.
In recent releases (>= 3.0) you should find this tool in /usr/bin/ on your board.
- To use it, you must clear i.MX PAR_1 & PAR_2 registers (registers access rights) before launching Linux kernel, so in U-Boot type (example here is for APF9328):
BIOS> mw.l 0x00200008 0 BIOS> mw.l 0x00210008 0
- on APF27:
BIOS> mw 10000008 0 BIOS> mw 10020008 0
If you use it frequently, a small script unlock_regs has been defined in U-Boot, and you can call it before booting your board:
BIOS> run unlock_regs BIOS> boot
- Then in Linux console/terminal, launch imxregs like that:
# imxregs REGISTER_NAME (give it the register name as printed in i.MX 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 0x00000123 to OCR1_D register:
# imxregs OCR1_D 123
Changing FPGA IP's registers from Linux user space with fpgaregs
see FPGA_register
Links
- http://www-users.cs.umn.edu/~boutcher/kprobes/
- http://tree.celinuxforum.org/CelfPubWiki/PatchArchive
Other languages: | |
---|---|
English • Français |