How to not compile USB device ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-06-20 11:40 PM
Hi ,
I have added usb functionality in my code using stm32cubemx.
Now i don't want to compile it using #if or #ifdef
How to do it ?
I tried following:
I used #if to remove usb initializing function and not used usb in any code , but when i saw .map file still following files are getting compiled
usbd_conf.o
usbd_core.o
usbd_ctlreq.o
usbd_ioreq.o
Labels:
- Labels:
-
USB
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-06-21 5:22 AM
You would need to remove the files from linking,
exclude them in the project's file list.
Easier:
- Copy ioc file (backup in case you want USB later, rename backup as ***_WithUSB.ioc)
- Open in MX, disable/remove USB features, save project, regenerate code.
- Build and check map file
