u-boot 2011.09 开启debug 调试

以前做过,现在刚才又想不起来了,这个错误非常的严重。

在这里记一下。

debug 调试信息的开启在 include/common.h

有如下宏定义:

 1 #ifdef  DEBUG                                                                   
 2 #define debug(fmt,args...)  printf (fmt ,##args)                                
 3 #define debugX(level,fmt,args...) if (DEBUG>=level) printf(fmt,##args);         
 4 #else                                                                           
 5 #define debug(fmt,args...)                                                      
 6 #define debugX(level,fmt,args...)                                               
 7 #endif  /* DEBUG */                                                             
 8                                                                                 
 9 #ifdef DEBUG                                                                    
10 # define _DEBUG 1                                                               
11 #else                                                                           
12 # define _DEBUG 0                                                               
13 #endif                                    

所以,我们如果想开启u-boot  的debug 调试信息,只需要在这里加一个宏定义:

#define DEBUG

到此,我们u-boot 的debug 调试信息开启。

原文地址:https://www.cnblogs.com/chenfulin5/p/5938029.html