Hiya @itr1718
I'm asking we bring the "Clock tact between USB CDC and I2C" thread into this one.
It appears that you are bringing in code from multiple sources and selectively applying them without understanding the different platforms and SDKs they were written for.
I believe that there are three drvier pieces that are needed to be coordinated before you can expect to get a working application and I don't think that's happening.
Just so we're clear the three Driver pieces are:
- Clock Driver (System which includes USB and I2C)
- USB Driver
- I2C Driver
Ideally, each are from the same SDK (the latest one available for your target processor). Along with that, I highly recommend that you use MCUXpresso for configuring your system. The Clock and Pins Wizards should be used for specifying your IO. The USB Driver should be from the SDK examples and I recommend the bare metal ("cdc_vcom_bm") code for your base.
To keep things simple, I suggest that you create a formatted string from your sensor data using sprintf and passing it to the USB send function rather than trying to convert printf to use USB (a *lot* less work and much easier to debug and there should be very little difference in final application size).
Could you confirm that the drivers you're using are from the same SDK and that you can use the Clocks and Pin Wizard in MCUXpresso?
myke