| 19 | or apply next change to RTEMS sources |
| 20 | {{{ |
| 21 | --- a/c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c |
| 22 | +++ b/c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c |
| 23 | @@ -29,6 +29,15 @@ |
| 24 | #include <libcpu/arm-cp15.h> |
| 25 | #include <bsp.h> |
| 26 | |
| 27 | +void ll_strout(char *str) |
| 28 | +{ |
| 29 | + char ch; |
| 30 | + while ((ch = *(str++)) != 0) { |
| 31 | + if (ch == '\n') |
| 32 | + bcm2835_usart_fns.deviceWritePolled(0, '\r'); |
| 33 | + bcm2835_usart_fns.deviceWritePolled(0, ch); |
| 34 | + } |
| 35 | +} |
| 36 | |
| 37 | void BSP_START_TEXT_SECTION bsp_start_hook_0(void) |
| 38 | { |
| 39 | @@ -66,6 +75,21 @@ void BSP_START_TEXT_SECTION bsp_start_hook_0(void) |
| 40 | |
| 41 | /* Clear Secure or Non-secure Vector Base Address Register */ |
| 42 | arm_cp15_set_vector_base_address(0); |
| 43 | + |
| 44 | + /* Enable JTAG */ |
| 45 | + rtems_gpio_bsp_select_specific_io(0, 22, RPI_ALT_FUNC_4); |
| 46 | + rtems_gpio_bsp_select_specific_io(0, 4, RPI_ALT_FUNC_5); |
| 47 | + rtems_gpio_bsp_select_specific_io(0, 27, RPI_ALT_FUNC_4); |
| 48 | + rtems_gpio_bsp_select_specific_io(0, 25, RPI_ALT_FUNC_4); |
| 49 | + rtems_gpio_bsp_select_specific_io(0, 23, RPI_ALT_FUNC_4); |
| 50 | + rtems_gpio_bsp_select_specific_io(0, 24, RPI_ALT_FUNC_4); |
| 51 | + |
| 52 | + if (1) { |
| 53 | + ll_strout("JTAG Enabled and waiting for GDB\n"); |
| 54 | + |
| 55 | + continue_execution = 0; |
| 56 | + while (!continue_execution); |
| 57 | + } |
| 58 | } |
| 59 | |
| 60 | void BSP_START_TEXT_SECTION bsp_start_hook_1(void) |
| 61 | }}} |
| 62 | Start RTEMS, when message appears connect from OpenOCD, setup breakpoints and set continue_execution to one |
| 63 | {{{ |
| 64 | (gdb) set continue_execution=1 |
| 65 | }}} |
| 66 | |