[bsp]add gdb support for BBB
This commit is contained in:
parent
ae8e46de1f
commit
4cf77e255f
@ -16,6 +16,10 @@
|
|||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
#include <components.h>
|
#include <components.h>
|
||||||
|
|
||||||
|
#ifdef RT_USING_GDB
|
||||||
|
#include <gdb_stub.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
int rt_application_init()
|
int rt_application_init()
|
||||||
{
|
{
|
||||||
/* do component initialization */
|
/* do component initialization */
|
||||||
@ -23,6 +27,10 @@ int rt_application_init()
|
|||||||
#ifdef RT_USING_NEWLIB
|
#ifdef RT_USING_NEWLIB
|
||||||
libc_system_init(RT_CONSOLE_DEVICE_NAME);
|
libc_system_init(RT_CONSOLE_DEVICE_NAME);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef RT_USING_GDB
|
||||||
|
gdb_set_device("uart4");
|
||||||
|
gdb_start();
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -80,6 +80,11 @@ static rt_err_t am33xx_configure(struct rt_serial_device *serial, struct serial_
|
|||||||
UART_DLL_REG(base) = 26;
|
UART_DLL_REG(base) = 26;
|
||||||
UART_DLH_REG(base) = 0;
|
UART_DLH_REG(base) = 0;
|
||||||
}
|
}
|
||||||
|
else if (cfg->baud_rate == BAUD_RATE_9600)
|
||||||
|
{
|
||||||
|
UART_DLL_REG(base) = 0x38;
|
||||||
|
UART_DLH_REG(base) = 1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NOT_IMPLEMENTED();
|
NOT_IMPLEMENTED();
|
||||||
@ -439,7 +444,7 @@ int rt_hw_serial_init(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RT_USING_UART4
|
#ifdef RT_USING_UART4
|
||||||
config.baud_rate = BAUD_RATE_115200;
|
config.baud_rate = BAUD_RATE_9600;
|
||||||
config.bit_order = BIT_ORDER_LSB;
|
config.bit_order = BIT_ORDER_LSB;
|
||||||
config.data_bits = DATA_BITS_8;
|
config.data_bits = DATA_BITS_8;
|
||||||
config.parity = PARITY_NONE;
|
config.parity = PARITY_NONE;
|
||||||
@ -450,14 +455,14 @@ int rt_hw_serial_init(void)
|
|||||||
serial4.ops = &am33xx_uart_ops;
|
serial4.ops = &am33xx_uart_ops;
|
||||||
serial4.config = config;
|
serial4.config = config;
|
||||||
/* enable RX interrupt */
|
/* enable RX interrupt */
|
||||||
UART_IER_REG(uart4.base) = 0x01;
|
UART_IER_REG(uart4.base) = 0x00;
|
||||||
/* install ISR */
|
/* install ISR */
|
||||||
rt_hw_interrupt_install(uart4.irq, am33xx_uart_isr, &serial4, "uart4");
|
rt_hw_interrupt_install(uart4.irq, am33xx_uart_isr, &serial4, "uart4");
|
||||||
rt_hw_interrupt_control(uart4.irq, 0, 0);
|
rt_hw_interrupt_control(uart4.irq, 0, 0);
|
||||||
rt_hw_interrupt_mask(uart4.irq);
|
rt_hw_interrupt_mask(uart4.irq);
|
||||||
/* register UART4 device */
|
/* register UART4 device */
|
||||||
rt_hw_serial_register(&serial4, "uart4",
|
rt_hw_serial_register(&serial4, "uart4",
|
||||||
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
|
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_STREAM,
|
||||||
&uart4);
|
&uart4);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2,6 +2,12 @@
|
|||||||
#ifndef __RTTHREAD_CFG_H__
|
#ifndef __RTTHREAD_CFG_H__
|
||||||
#define __RTTHREAD_CFG_H__
|
#define __RTTHREAD_CFG_H__
|
||||||
|
|
||||||
|
// <section name="RT_USING_GDB" description="Gdb Stub for rtt" default="true" >
|
||||||
|
//#define RT_USING_GDB
|
||||||
|
//#define RT_GDB_DEBUG
|
||||||
|
#define RT_GDB_ICACHE
|
||||||
|
// </section>
|
||||||
|
|
||||||
// <RDTConfigurator URL="http://www.rt-thread.com/eclipse">
|
// <RDTConfigurator URL="http://www.rt-thread.com/eclipse">
|
||||||
|
|
||||||
// <integer name="RT_NAME_MAX" description="Maximal size of kernel object name length" default="6" />
|
// <integer name="RT_NAME_MAX" description="Maximal size of kernel object name length" default="6" />
|
||||||
|
@ -23,7 +23,7 @@ elif CROSS_TOOL == 'iar':
|
|||||||
if os.getenv('RTT_EXEC_PATH'):
|
if os.getenv('RTT_EXEC_PATH'):
|
||||||
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
|
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
|
||||||
|
|
||||||
BUILD = 'release'
|
BUILD = 'debug'
|
||||||
|
|
||||||
if PLATFORM == 'gcc':
|
if PLATFORM == 'gcc':
|
||||||
# toolchains
|
# toolchains
|
||||||
|
Loading…
x
Reference in New Issue
Block a user