如何使用gdb调试nuttx

原文地址:https://blog.csdn.net/yazhouren/article/details/78192868

nuttx直接使用gdb没有办法调试,需要修改一下地方:

1. stm32_idle.c的

void up_idle(void) 
{ 
#if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_TIMER_INTS) 
/* If the system is idle and there are no timer interrupts, then process * "fake" timer     interrupts. Hopefully, something will wake up. */ 
    sched_process_timer(); 
#else 
/* Perform IDLE mode power management */ 
#ifndef CONFIG_DEBUG_SYMBOLS//added by john for eclipse debug BEGIN_IDLE(); 
    stm32_idlepm(); 
    END_IDLE(); 
#endif 
#endif 
} 

2. stm32_boot.c

void stm32_boardinitialize(void) 
{ 
#ifdef CONFIG_DEBUG_SYMBOLS//added by john for eclipse debug 
    uint32_t cr = getreg32(STM32_DBGMCU_CR); 
    cr |= DBGMCU_CR_STANDBY |DBGMCU_CR_STOP |DBGMCU_CR_SLEEP; 
    putreg32(cr,STM32_DBGMCU_CR); 
#endif 
#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function * stm32_spidev_initialize() has been brought into the link. */ 
    if (stm32_spidev_initialize) 
    { 
        stm32_spidev_initialize(); 
    } 
#endif

猜你喜欢

转载自blog.csdn.net/qq_21856675/article/details/82596658