USB not working when i use NDEBUG preproc macro instead of DEBUG

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

USB not working when i use NDEBUG preproc macro instead of DEBUG

1,050 次查看
euginjeyapradee
Contributor II

Hello,

We are using imxRT1050 for one of our product. When compiling the software with DEBUG preprocessor macro, path related information is added on to the .axf file that gets generated. It includes the directory path where the software is opened and compiled. So we renamed the macro to NDEBUG to remove debug related information from the .axf file. When we do that and run the software, USB is not working and it fails at enumeration (Getting device descriptor). When hooked an USB analyzer, have seen that the setup token sent by the host seem to be wrong. Have any one faced similar issues? If yes, please let me know what could be causing this?

 

Regards,

Eugin

 

标签 (1)
0 项奖励
回复
3 回复数

1,005 次查看
euginjeyapradee
Contributor II

Hello Kerry,

Will try your suggestion. But the intention behind using NDEBUG is to remove path related information from the binaries. We are at the production stage and when compiling the software, any path related informaion getting into the binaries would lead to different binaries getting generated across different paths the software is compiled. 

Not sure whether having DEBUG and NDEBUG is ideal and will it remove the path related data that gets into the binaries. Will try and let you know


Regards,
Eugin

 

0 项奖励
回复

998 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @euginjeyapradee ,

   From your description, seems it is related to the debug related code influence the USB execution time routine.

   Whether your project also contains the release version or not, just like the SDK demo also include debug and release two version, if you have the release version, I think you also can try the release situation.

   Another way to debug, you can search all the Debug related code, then comment part by part, just to check, whether detail code influence your demo function.

 

Best Regards,

Kerry

0 项奖励
回复

1,027 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @euginjeyapradee ,

  From my experience, you can try this 2 methods:

1. Use release version

2. Don't remove DEBUG, just add NDEBUG directly.

Please try it on your side again.

If you still have issues about it, please kindly let me know.

Best Regards,

Kerry

0 项奖励
回复