Difference between revisions of "Template:MCU resources"
(Created page with "=Resources= *[https://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/ A simple Makefile tutorial] * [https://developers.redhat.com/blog/2021/04/30/the-gdb-developers-gnu...") |
(→Resources) |
||
(12 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Resources= |
=Resources= |
||
⚫ | |||
===Tutorials=== |
|||
* Setting up [[ARM development environment on Ubuntu]] |
|||
⚫ | |||
⚫ | |||
* [http://www.bravegnu.org/gnu-eprog/ Embedded Programming using the GNU Toolchain] |
|||
* [https://www.gnu.org/software/make/manual/ GNU Make manual] |
|||
===GDB=== |
|||
* [https://www.cs.umd.edu/~srhuang/teaching/cmsc212/gdb-tutorial-handout.pdf GDB tutorial] from UMD |
|||
* [https://developers.redhat.com/blog/2021/04/30/the-gdb-developers-gnu-debugger-tutorial-part-1-getting-started-with-the-debugger GDB getting started tutorial] |
* [https://developers.redhat.com/blog/2021/04/30/the-gdb-developers-gnu-debugger-tutorial-part-1-getting-started-with-the-debugger GDB getting started tutorial] |
||
* [http://web.cecs.pdx.edu/~jrb/cs201/lectures/handouts/gdbcomm.txt GDB commands in short] from PDX |
|||
⚫ | |||
* [http://www.gnu.org/software/gdb/documentation/ GDB manual] |
|||
====Remote debugging example==== |
|||
Debugging myprog with a parameter 10. |
|||
* First, start the qemu emulator, providing the communications port (12345), and run it in background (&). |
|||
** Before you do this, make sure that the port is not in use by anyone or anything. |
|||
* Then start the gdb-multiarch with the name of the program and |
|||
* Use the gdb command "remote target" with address (localhost) and the port (12345). |
|||
* Finally start the program execution with "continue". Perhaps, you may want to set some breakpoints before that. |
|||
$ qemu-arm -L /usr/arm-linux-gnueabi -g 12345 myprog 10 & |
|||
$ gdb-multiarch myprog |
|||
(gdb) target remote localhost:12345 |
|||
(gdb) continue |
|||
====A few essential GDB commands==== |
|||
{| border=1 |
|||
| GDB command |
|||
| Shortcut |
|||
| Description |
|||
|+ |
|||
| run |
|||
| |
|||
| Run the program from the beginning |
|||
|- |
|||
| continue |
|||
| c |
|||
| Continue (or start) the execution of the program |
|||
|- |
|||
| step |
|||
| s |
|||
| Execute the current line from the source. If there is a function call, step into it. |
|||
This command can have a parameter n that tells how many steps to make. |
|||
|- |
|||
| next |
|||
| n |
|||
| Execute the current line from the source. If there is a function call, stop after running it. |
|||
This command can have a parameter n that tells how many steps to make. |
|||
|- |
|||
| break <x> |
|||
| b <x> |
|||
| |
|||
Set a "breakpoint" to <x>, where <x> could be: |
|||
* line_number in the current source code file |
|||
* filename:line_number |
|||
* function_name |
|||
* filename:function_name |
|||
* *address |
|||
*...and many others |
|||
|- |
|||
| list |
|||
| l |
|||
| Shows the source code (lines). Could be followed by a function_name or file:line_number |
|||
|- |
|||
| info registers |
|||
| i r |
|||
| Prints all registers and their values. Can be followed by one or more register names. |
|||
|- |
|||
| set step mode on |
|||
| |
|||
| Set running mode such that "step" will enter the code that has no debug information available. |
|||
Using "off" instead of "on" resets this mode. |
|||
|} |
|||
===ARM=== |
|||
* [http://pages.cs.wisc.edu/~markhill/restricted/arm_isa_quick_reference.pdf ARM instruction set quick reference] - from U.Wisconsin. |
* [http://pages.cs.wisc.edu/~markhill/restricted/arm_isa_quick_reference.pdf ARM instruction set quick reference] - from U.Wisconsin. |
||
Line 9: | Line 87: | ||
* [https://developer.arm.com/architectures/system-architectures/software-standards/abi Application Binary Interface (ABI)] for the Arm architecture |
* [https://developer.arm.com/architectures/system-architectures/software-standards/abi Application Binary Interface (ABI)] for the Arm architecture |
||
* [https://developer.arm.com/architectures/instruction-sets/base-isas/a32 ARM A32 instruction set]. Note, that ARM has several [https://developer.arm.com/architectures/instruction-sets instruction sets described here] |
* [https://developer.arm.com/architectures/instruction-sets/base-isas/a32 ARM A32 instruction set]. Note, that ARM has several [https://developer.arm.com/architectures/instruction-sets instruction sets described here] |
||
====Xscale==== |
|||
* Intel XScale Microarchitecture Assembly Language Quick Reference Card ARM Instruction Set, Intel Corporation, 2001 |
|||
* Intel IXP42X Product Line of Network Processors and IXC1100 Control Plane Processor Developer’s Manual, ON: 252480-006US, Intel Corporation, 2006 |
|||
* [http://download.intel.com/design/intelxscale/27347302.pdf Intel XScale(R) Core Developer’s Manual] |
|||
* [http://download.intel.com/design/intelxscale/27347302.pdf Intel XScale R Core Developer’s Manual], ON: 273473-002, Intel Corporation, 2004 |
|||
== Insights == |
|||
* [http://norvig.com/21-days.html Teach yourself programming in 10 years] by Peter Norvig |
|||
* [https://qr.ae/pGBj0b Should I learn assembly language to program a microcontroller?] - Answer on Quora by software R&D professional with 40 years of experience. |
Latest revision as of 14:56, 30 September 2022
Contents
Resources
Tutorials
- Setting up ARM development environment on Ubuntu
Make
GDB
- GDB tutorial from UMD
- GDB getting started tutorial
- GDB commands in short from PDX
- GDB manual
Remote debugging example
Debugging myprog with a parameter 10.
- First, start the qemu emulator, providing the communications port (12345), and run it in background (&).
- Before you do this, make sure that the port is not in use by anyone or anything.
- Then start the gdb-multiarch with the name of the program and
- Use the gdb command "remote target" with address (localhost) and the port (12345).
- Finally start the program execution with "continue". Perhaps, you may want to set some breakpoints before that.
$ qemu-arm -L /usr/arm-linux-gnueabi -g 12345 myprog 10 & $ gdb-multiarch myprog (gdb) target remote localhost:12345 (gdb) continue
A few essential GDB commands
GDB command | Shortcut | Description |
run | Run the program from the beginning | |
continue | c | Continue (or start) the execution of the program |
step | s | Execute the current line from the source. If there is a function call, step into it.
This command can have a parameter n that tells how many steps to make. |
next | n | Execute the current line from the source. If there is a function call, stop after running it.
This command can have a parameter n that tells how many steps to make. |
break <x> | b <x> |
Set a "breakpoint" to <x>, where <x> could be:
|
list | l | Shows the source code (lines). Could be followed by a function_name or file:line_number |
info registers | i r | Prints all registers and their values. Can be followed by one or more register names. |
set step mode on | Set running mode such that "step" will enter the code that has no debug information available.
Using "off" instead of "on" resets this mode. |
ARM
- ARM instruction set quick reference - from U.Wisconsin.
- A32 instruction summary
- Application Binary Interface (ABI) for the Arm architecture
- ARM A32 instruction set. Note, that ARM has several instruction sets described here
Xscale
- Intel XScale Microarchitecture Assembly Language Quick Reference Card ARM Instruction Set, Intel Corporation, 2001
- Intel IXP42X Product Line of Network Processors and IXC1100 Control Plane Processor Developer’s Manual, ON: 252480-006US, Intel Corporation, 2006
- Intel XScale(R) Core Developer’s Manual
- Intel XScale R Core Developer’s Manual, ON: 273473-002, Intel Corporation, 2004
Insights
- Teach yourself programming in 10 years by Peter Norvig
- Should I learn assembly language to program a microcontroller? - Answer on Quora by software R&D professional with 40 years of experience.