From ae8e46de1ff7386c5add04e8ee3830fc71042306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=B1=AA?= <547884940@qq.com> Date: Tue, 12 Aug 2014 18:27:50 +0800 Subject: [PATCH] Revert "[bsp]add gdb support for BBB" This reverts commit a966dd3c3802198cf84adbd8aef08d9206e256ce. --- bsp/beaglebone/applications/application.c | 8 ----- bsp/beaglebone/drivers/serial.c | 42 ++--------------------- bsp/beaglebone/rtconfig.h | 6 ---- bsp/beaglebone/rtconfig.py | 2 +- 4 files changed, 4 insertions(+), 54 deletions(-) diff --git a/bsp/beaglebone/applications/application.c b/bsp/beaglebone/applications/application.c index f34821e74..99c2991df 100644 --- a/bsp/beaglebone/applications/application.c +++ b/bsp/beaglebone/applications/application.c @@ -16,10 +16,6 @@ #include #include -#ifdef RT_USING_GDB -#include -#endif - int rt_application_init() { /* do component initialization */ @@ -27,10 +23,6 @@ int rt_application_init() #ifdef RT_USING_NEWLIB libc_system_init(RT_CONSOLE_DEVICE_NAME); #endif -#ifdef RT_USING_GDB - gdb_set_device("uart4"); - gdb_start(); -#endif return 0; } diff --git a/bsp/beaglebone/drivers/serial.c b/bsp/beaglebone/drivers/serial.c index 1cc0e69a8..8dcd38912 100644 --- a/bsp/beaglebone/drivers/serial.c +++ b/bsp/beaglebone/drivers/serial.c @@ -338,42 +338,6 @@ static void config_pinmux(void) #endif } -static int am33xx_putc_poll(struct rt_serial_device *serial, char c) -{ - struct am33xx_uart* uart; - - RT_ASSERT(serial != RT_NULL); - uart = (struct am33xx_uart *)serial->parent.user_data; - - while (!(UART_LSR_REG(uart->base) & 0x20)); - UART_THR_REG(uart->base) = c; - - return 1; -} - -static int am33xx_getc_poll(struct rt_serial_device *serial) -{ - int ch; - struct am33xx_uart* uart; - - RT_ASSERT(serial != RT_NULL); - uart = (struct am33xx_uart *)serial->parent.user_data; - - ch = -1; - while(!(UART_LSR_REG(uart->base) & 0x01)); - ch = UART_RHR_REG(uart->base) & 0xff; - - return ch; -} - -static const struct rt_uart_ops am33xx_gdb_ops = -{ - am33xx_configure, - am33xx_control, - am33xx_putc_poll, - am33xx_getc_poll, -}; - int rt_hw_serial_init(void) { struct serial_configure config; @@ -483,17 +447,17 @@ int rt_hw_serial_init(void) config.invert = NRZ_NORMAL; config.bufsz = RT_SERIAL_RB_BUFSZ; - serial4.ops = &am33xx_gdb_ops; + serial4.ops = &am33xx_uart_ops; serial4.config = config; /* enable RX interrupt */ - UART_IER_REG(uart4.base) = 0x00; + UART_IER_REG(uart4.base) = 0x01; /* install ISR */ rt_hw_interrupt_install(uart4.irq, am33xx_uart_isr, &serial4, "uart4"); rt_hw_interrupt_control(uart4.irq, 0, 0); rt_hw_interrupt_mask(uart4.irq); /* register UART4 device */ rt_hw_serial_register(&serial4, "uart4", - RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_STREAM, + RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX, &uart4); #endif diff --git a/bsp/beaglebone/rtconfig.h b/bsp/beaglebone/rtconfig.h index 018b2862f..15326d74c 100644 --- a/bsp/beaglebone/rtconfig.h +++ b/bsp/beaglebone/rtconfig.h @@ -2,12 +2,6 @@ #ifndef __RTTHREAD_CFG_H__ #define __RTTHREAD_CFG_H__ -//
-//#define RT_USING_GDB -//#define RT_GDB_DEBUG -#define RT_GDB_ICACHE -//
- // // diff --git a/bsp/beaglebone/rtconfig.py b/bsp/beaglebone/rtconfig.py index a5561f54d..3c7f228d8 100644 --- a/bsp/beaglebone/rtconfig.py +++ b/bsp/beaglebone/rtconfig.py @@ -23,7 +23,7 @@ elif CROSS_TOOL == 'iar': if os.getenv('RTT_EXEC_PATH'): EXEC_PATH = os.getenv('RTT_EXEC_PATH') -BUILD = 'debug' +BUILD = 'release' if PLATFORM == 'gcc': # toolchains -- GitLab