TWRKV58F i2c / accelerometer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TWRKV58F i2c / accelerometer

Jump to solution
1,033 Views
TurboMan
Contributor IV

I was very kindly provided with an early TWRKV58F220M board by an NXP rep. However, I'm having trouble getting the i2c working. I was given a software package which was basically an early version of the SDK for KV58F. It has various examples in.

 

I can get the example project working, if I import this from the SDK (i2c callback project), talking to the accelerometer and retrieving the WHO_AM_I reg from the on board FXOS8700. But, this is a referenced project. I cannot add files.

 

I have created a processor expert project, and set up an I2C bean, which didn't work.

 

I have over-written the I2C drivers with the specific KV58F drivers from the software package I was given. this didn't work either.

 

I have used the project generation tool, but this requests a library I cannot add in by the usual method and produces this error:

make: *** No rule to make target '../../lib/ksdk_platform_lib/kds/KV58F22/debug/libksdk_platform.a', needed by 'KV58F_PGTest_MKV58F1M0VLQ22.elf'.

Even when the library is included and the path to it added. Library specified as "ksdk_platform".

 

When the i2c does transmit, I am getting a NACK in any other project than the example project. The start condition appears fine, the data and clock lines both appear to work ok, and identically, but only the example project gets an ACK from the accelerometer.

 

Any help would be great.

Labels (1)
1 Solution
749 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello T S,

-  Which version of  KSDK do you used , SDK_2.0_TWR-KV58F220M or SDK_1.3_TWR-KV58F220M ?

About your said "but only the example project gets an ACK from the accelerometer", which example ?

- “

I have used the project generation tool, but this requests a library I cannot add in by the usual method and produces this error:

make: *** No rule to make target '../../lib/ksdk_platform_lib/kds/KV58F22/debug/libksdk_platform.a', needed by 'KV58F_PGTest_MKV58F1M0VLQ22.elf'.

Even when the library is included and the path to it added. Library specified as "ksdk_platform".

” Please send this project to me , i help you check the error .

- I recommend you use the latest version of SDK_2.0_TWR-KV58F220M  , this version is also

easily to use and can add files . You can download it refer to this DOC : How to: install KSDK 2.0 

and how to use it on KDSv3.0 or v3.2 :  https://community.nxp.com/docs/DOC-329662 

Hope it helps

Alice

View solution in original post

0 Kudos
8 Replies
749 Views
TurboMan
Contributor IV

Firstly, I downloaded the latest sdk (2.0) for twrkv58f220m. This worked and I can read the accelerometer's whoami reg (from FXOS8700). One point, I specced 400kHz but the i2c clk + data was read back on the scope at 1MHz.

Secondly, virtual folders.... this makes it really really annoying to deal with. I have to manually create a file in the filesystem, link a virtual file to the actual file in the source or wherever, instead of right clicking on the folder, and selecting "new>>c file" and getting a nice template. So, I can add files to a virtual folder, but I lose the "niceness" of eclipse functionality...

If you know ANY way of getting round this, that would be fantastic :smileyhappy: 

0 Kudos
749 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

So i think you can use the real fold , not use virtual folder .

BR

Alice

0 Kudos
749 Views
TurboMan
Contributor IV

Thank you for the replies, more information then:

Marek, trying to add a new file fails on virtual folders with the following: "Creation of element failed" "Reason: Only virtual folders and links can be created under a virtual folder". I can't find an eclipse option to add a virtual file. Virtual folders are indicated by a light grey square on the bottom right of the folder icon.

Alice_Yang, I have attached the project generated code. This used the SDK I was given by an NXP FAE, "KSDK1.2.0_KV5xF_1.0.0", so may be an early version. I have only just seen the 2.0 SDK download in my download vault / folder, I had tried to download this weeks ago but needed permission? I could just download the old SDK fine. So do I need to build an SDK for each MCU I might be working with? I will download and try V2.0 and let you know if this helps anyway. Thanks

0 Kudos
748 Views
MarekTrmac
NXP Employee
NXP Employee

Hi,

about adding file to the project:

First you do not need to have the library listed in the project, it is enough to have it configured in the build options.

If you want to see it, you can link it into virtual folder using right click on the folder - New - File - Advanced - check Link to file in file system - and select file.

Another possibility is to create physical folder in your project using right click on the project - New - Folder.

Regards,

Marek

0 Kudos
748 Views
TurboMan
Contributor IV

Hi Marek,

   I created a real folder in the project and added files to it that way, as per your suggestion. The only drawback with this is that the include paths have to be updated. Otherwise the files are in the created folder like so:

<project location>\kds\<created folder name>

I did also do as below, but prefer actual folders to virtual. Thanks for your help,

regards

748 Views
TurboMan
Contributor IV

Oh yes, the project that worked is: "i2c_callback_master_example_twrkv58f220m".

thank you for the KDS 3 / 3.2 links

0 Kudos
748 Views
MarekTrmac
NXP Employee
NXP Employee

Hi,

library can be added to the project in Project - Properties - C/C++ Build  - Settings - Cross ARM C Linker - Libraries.

>But, this is a referenced project. I cannot add files.

Why? There should not be any limitation.

Regards,

Marek

0 Kudos
750 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello T S,

-  Which version of  KSDK do you used , SDK_2.0_TWR-KV58F220M or SDK_1.3_TWR-KV58F220M ?

About your said "but only the example project gets an ACK from the accelerometer", which example ?

- “

I have used the project generation tool, but this requests a library I cannot add in by the usual method and produces this error:

make: *** No rule to make target '../../lib/ksdk_platform_lib/kds/KV58F22/debug/libksdk_platform.a', needed by 'KV58F_PGTest_MKV58F1M0VLQ22.elf'.

Even when the library is included and the path to it added. Library specified as "ksdk_platform".

” Please send this project to me , i help you check the error .

- I recommend you use the latest version of SDK_2.0_TWR-KV58F220M  , this version is also

easily to use and can add files . You can download it refer to this DOC : How to: install KSDK 2.0 

and how to use it on KDSv3.0 or v3.2 :  https://community.nxp.com/docs/DOC-329662 

Hope it helps

Alice

0 Kudos