how to log data in USB using CW10.5 +MQX RTOS.

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

how to log data in USB using CW10.5 +MQX RTOS.

Jump to solution
1,437 Views
sudhanshumehta
Contributor IV

Hi All,

I am using twr-k70F120M "kit".

I have twr-ser1 board. And elevator boards with me.

i am using freescale codewarrior 10.5 special edition(free version) + MQX4.0.2 

I want to use thumb drive(usb mass storage device) for following

    1)      Data logging.

   2)      Updating code into processor.

how can i obtain above?

  

Please provide documentation if you have for this + some example code.

I have got HVAC example and I feel it is writing data in USB mass storage device.

But when I enable its                   "#define DEMOCFG_ENABLE_USB_FILESYSTEM  0  /* enable USB mass storage */"               flag, it says code size increased  (because I am using freescale codewarrior 10.5 (free special edition) + MQX )

Is there is any small project example using which I can log data in USB mass storage device??

Kindly reply ASAP.

Labels (2)
0 Kudos
Reply
1 Solution
1,137 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Sudhanshu,

Let's go back to the basics. Try to create a new project for MQX for the board you are using but this time make sure you are addind the USB libraries like this screenshot:

pastedImage_0.png

Then, in this new project just add the USB code form the web_hvac. Just try to make the logging. Let me know if that works.


Regards,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
9 Replies
1,137 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Sudhanshu,

You can try to make merge between C:\Freescale\Freescale_MQX_4_1\mfs\examples\mfs_usb and C:\Freescale\Freescale_MQX_4_1\demo\web_hvac:

Take the code that crates the file and writes to it from the web_hvac code and put is inside a new task in the mfs_usb example code:

...

log_fp = fopen(LOG_FILE,"a");

write(log_fp,"MyData", 6);

fclose(log_fp);

That should be enough. Hope this helps you!


Regards,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,137 Views
sudhanshumehta
Contributor IV

Hi Garabo,

I have editied PE_Demo project for my application.

now i need USB functionality in my project. If i copy USB code from above projects or i use HVAC project,  i am getting errors.

i have a question:

    Is there is specific project setting or I need to include some library into my project to make my project USB enable?


Thanks

Sudhanshu

0 Kudos
Reply
1,137 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Sudhanshu,

Well, PE makes things a bit complex when it is mixed with MQX. You definitely need to include the USB host libraries. Just like ..\mfs\examples\mfs_usb

For more information about using MQX and PE you can review this document:

C:\Freescale\Freescale_MQX_4_1\doc\tools\cw\MQX_CW10_Getting_Started.pdf

I hope this helps you.


Regards,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,137 Views
sudhanshumehta
Contributor IV

Hi Garabo.

I thank you for helping.

i have tried various things for this. but no one worked. My problem is i want to log data in USB (thumb drive). and i want to do this in my project. I followed the code of HVAC. but it is not working for my project.

compilation is giving errors that it is not able to find USB APIs.

I have made my full project now i want to make the logs in same Project.

hope you got my problem now. please suggest some way.

do i need to change some makefile etc.?? my base project was PE_Demo project.

thanks

Sudhanshu

0 Kudos
Reply
1,137 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi,

If you didn't include the bin files for the USB libraries then it will fail to find the API for USB functions. Copy the same paths that the HVAC project as, into your project. That should fix this error.


Regards,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,137 Views
sudhanshumehta
Contributor IV

Are you talking about properties--> c/c++ General--> paths and symbols --> includes-->Assembly?

I have already done this.no solution.

I have added path in includes. Are you talking about some other path?

please suggest something else.

I thank you for helping in this.

Thanks

Sudhanshu

0 Kudos
Reply
1,138 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Sudhanshu,

Let's go back to the basics. Try to create a new project for MQX for the board you are using but this time make sure you are addind the USB libraries like this screenshot:

pastedImage_0.png

Then, in this new project just add the USB code form the web_hvac. Just try to make the logging. Let me know if that works.


Regards,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,137 Views
sudhanshumehta
Contributor IV

THIs is great... I thank you Grabo... BOOM i am happy.. thank you for the support.

It was critical for my project...

0 Kudos
Reply
1,137 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Great to read it is working now, Sudhanshu!

Good luck!

-Garabo

0 Kudos
Reply