KISS Data Aquisition and Control System
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
6.0 KiB

  1. /*
  2. *
  3. * PRU Debug Program
  4. * (c) Copyright 2011 by Arctica Technologies
  5. * Written by Steven Anderson
  6. *
  7. */
  8. #include <stdio.h>
  9. #include "prudbg.h"
  10. void printhelp()
  11. {
  12. printf("Command help\n\n");
  13. printf(" Commands are case insensitive\n");
  14. printf(" Address and numeric values can be dec (ex 12), hex (ex 0xC), or octal (ex 014)\n");
  15. printf(" Memory addresses can be wa=32-bit word address, ba=byte address. Suffix of i=instruction or d=data memory\n");
  16. printf(" Return without a command will rerun a previous d, dd, or di command while displaying the next block\n\n");
  17. printf(" BR [breakpoint_number [address]]\n");
  18. printf(" View or set an instruction breakpoint\n");
  19. printf(" 'b' by itself will display current breakpoints\n");
  20. printf(" breakpoint_number is the breakpoint reference and ranges from 0 to %u\n", MAX_BREAKPOINTS - 1);
  21. printf(" address is the instruction word address that the processor should stop at (instruction is not executed)\n");
  22. printf(" if no address is provided, then the breakpoint is cleared\n\n");
  23. printf(" D memory_location_wa [length]\n");
  24. printf(" Raw dump of PRU data memory (32-bit word offset from beginning of full PRU memory block - all PRUs)\n\n");
  25. printf(" DD memory_location_wa [length]\n");
  26. printf(" Dump data memory (32-bit word offset from beginning of PRU data memory)\n\n");
  27. printf(" DI memory_location_wa [length]\n");
  28. printf(" Dump instruction memory (32-bit word offset from beginning of PRU instruction memory)\n\n");
  29. printf(" DIS memory_location_wa [length]\n");
  30. printf(" Disassemble instruction memory (32-bit word offset from beginning of PRU instruction memory)\n\n");
  31. printf(" G\n");
  32. printf(" Start processor execution of instructions (at current IP)\n\n");
  33. printf(" GSS\n");
  34. printf(" Start processor execution using automatic single stepping - this allows running a program with breakpoints\n\n");
  35. printf(" HALT\n");
  36. printf(" Halt the processor\n\n");
  37. printf(" L memory_location_iwa file_name\n");
  38. printf(" Load program file into instruction memory at 32-bit word address provided (offset from beginning of instruction memory\n\n");
  39. printf(" PRU pru_number\n");
  40. printf(" Set the active PRU where pru_number ranges from 0 to %u\n", NUM_OF_PRU - 1);
  41. printf(" Some debugger commands do action on active PRU (such as halt and reset)\n\n");
  42. printf(" Q\n");
  43. printf(" Quit the debugger and return to shell prompt.\n\n");
  44. printf(" R\n");
  45. printf(" Display the current PRU registers.\n\n");
  46. printf(" RESET\n");
  47. printf(" Reset the current PRU\n\n");
  48. printf(" SS\n");
  49. printf(" Single step the current instruction.\n\n");
  50. printf(" WA [watch_num [address [value]]]\n");
  51. printf(" Clear or set a watch point\n");
  52. printf(" format 1: wa - print watch point list\n");
  53. printf(" format 2: wa watch_num - clear watch point watch_num\n");
  54. printf(" format 3: wa watch_num address - set a watch point (watch_num) so any change at that word address\n");
  55. printf(" in data memory will be printed during program execution with gss command\n");
  56. printf(" format 4: wa watch_num address value - set a watch point (watch_num) so that the program (run with gss) will\n");
  57. printf(" be halted when the memory location equals the value\n");
  58. printf(" NOTE: for watchpoints to work, you must use gss command to run the program\n\n");
  59. printf(" WR memory_location_wa value1 [value2 [value3 ...]]\n");
  60. printf(" Write a 32-bit value to a raw (offset from beginning of full PRU memory block - all PRUs)\n");
  61. printf(" memory_location is a 32-bit word index from the beginning of the PRU subsystem memory block\n\n");
  62. printf(" WRD memory_location_wa value1 [value2 [value3 ...]]\n");
  63. printf(" Write a 32-bit value to PRU data memory (32-bit word offset from beginning of PRU data memory)\n\n");
  64. printf(" WRI memory_location_wa value1 [value2 [value3 ...]]\n");
  65. printf(" Write a 32-bit value to PRU instruction memory (32-bit word offset from beginning of PRU instruction memory)\n\n");
  66. printf("A brief version of help is available with the command hb\n");
  67. printf("\n");
  68. }
  69. void printhelpbrief()
  70. {
  71. printf("Command help\n\n");
  72. printf(" BR [breakpoint_number [address]] - View or set an instruction breakpoint\n");
  73. printf(" D memory_location_wa [length] - Raw dump of PRU data memory (32-bit word offset from beginning of full PRU memory block - all PRUs)\n");
  74. printf(" DD memory_location_wa [length] - Dump data memory (32-bit word offset from beginning of PRU data memory)\n");
  75. printf(" DI memory_location_wa [length] - Dump instruction memory (32-bit word offset from beginning of PRU instruction memory)\n");
  76. printf(" DIS memory_location_wa [length] - Disassemble instruction memory (32-bit word offset from beginning of PRU instruction memory)\n");
  77. printf(" G - Start processor execution of instructions (at current IP)\n");
  78. printf(" GSS - Start processor execution using automatic single stepping - this allows running a program with breakpoints\n");
  79. printf(" HALT - Halt the processor\n");
  80. printf(" L memory_location_iwa file_name - Load program file into instruction memory\n");
  81. printf(" PRU pru_number - Set the active PRU where pru_number ranges from 0 to %u\n", NUM_OF_PRU - 1);
  82. printf(" Q - Quit the debugger and return to shell prompt.\n");
  83. printf(" R - Display the current PRU registers.\n");
  84. printf(" RESET - Reset the current PRU\n");
  85. printf(" SS - Single step the current instruction.\n");
  86. printf(" WA [watch_num [address [value]]] - Clear or set a watch point\n");
  87. printf(" WR memory_location_wa value1 [value2 [value3 ...]] - Write a 32-bit value to a raw (offset from beginning of full PRU memory block)\n");
  88. printf(" WRD memory_location_wa value1 [value2 [value3 ...]] - Write a 32-bit value to PRU data memory for current PRU\n");
  89. printf(" WRI memory_location_wa value1 [value2 [value3 ...]] - Write a 32-bit value to PRU instruction memory for current PRU\n");
  90. printf("\n");
  91. }