An IAR template project to build TinyUSB examples.
- NUCLEO-G0B1RE
- LPCXpresso55S69
- STM32F4DISCOVERY
- STM32L0538-DISCO
- STM32H573I-DK
- STM32F723E-DISCO
- NUCLEO-U5A5Zj-Q
- Clone TinyUSB and this template repositories.
- Add
TUSB_DIR
configuration variable in IAR.- Open
Tools -> Configure Custom Argument Variables
, switch toGlobal
tab - Click
New Group …
, name it toTUSB
- Click
Add Variable …
, name it toTUSB_DIR
, change it’s value to the path of your TinyUSB stack, for exampleC:\tinyusb
- Open
- Checkout dependencies according to TinyUSB guide: https://docs.tinyusb.org/en/latest/reference/getting_started.html#dependencies
-
In workspace, choose configuration according to the board, eg.
TUSB_STM32F723E-DISCO
. -
In workspace, uncheck
Exclude from build
of the example in interest, eg.cdc_dual_ports
Ensure it's checked for other projects. -
In
Project Option -> C/C++ Compiler -> Preprocessor
, ensure example path is listed in include, eg.$TUSB_DIR$\examples\device\cdc_dual_ports\src
, Also ensure other examples' path are NOT included, eg. NO$TUSB_DIR$\examples\device\uac2_headset\src
. -
build project and profit.