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,048件の閲覧回数
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,003件の閲覧回数
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 件の賞賛
返信

996件の閲覧回数
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,025件の閲覧回数
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 件の賞賛
返信