FRDM-SFUSION programming as serial data

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

FRDM-SFUSION programming as serial data

494 Views
haneybriggs
Contributor II

Hi I am doing a project using the FRDM-SFUSION kit with a k64f MCU. I am currently having two problems and am hoping someone can offer some help.

 

First, I am having problems getting serial data out from the board. When I first plugged it in I opened up a console (using PUTTY) and remember seeing data being fed out through the serial port. Since then I have changed to the Freescale 5.0 Library and added some of my own, though fairly minor, code. The project builds and actually works as expected, so I can't see why my code would mess with the serial output. When I open the console now I only get dots. A professor told me this could mean PUTTY is receiving data that it can't interpret, or that I might have configuration errors with PUTTY itself. I am looking into this to see if there is a problem on my end, but can anyone think of something else that could be going wrong?

 

Second is that, once I am able to get this data out, I want to be able to do some simple things to be able to store that data. I am currently grabbing acceleration values in a ENU coordinates and will eventually be using them for some calculations. I simply want to print this data so I can make some graphs with it. I am getting errors when trying to include libraries like stdio. I thought this might be included in the freescale libraries, but I also can't build the project if I try to use a printf function. I feel like what I am doing wrong is glaringly obvious, but sometimes it takes another person to look at something and see that. Any thoughts?

Labels (1)
0 Kudos
1 Reply

353 Views
isaacavila
NXP Employee
NXP Employee

Hello,

In fact, Sensor fusion software does send data using UART drivers through FRDM-K64F's SDA interface (UART0 - PTB16 and PTB17) or UART3 PTC16 and PTC17 (designed to send data to bluetooth module) but this data is "encoded" and Sensor Fusion toolbox is responsible to parse this data, as you can see on next image, I opened a COM terminal with a board with sensor fusion's software and this is what I got:

Sensor Fusion Output.jpg

So, that is why you saw strange data in your terminal. (Sensor fusion does not send data in ASCII format, so we only see symbols in our terminal).

If you want to analyze the code, i will recommend you to look on the function CreateAndSendPacketsViaUART located at driver.c file in which, a packet is created and sent through UART interface. At the end of this function, you will notice a calling: UART_A_SendBlock(), this function is the one that sends data through UART interface, this function receives three parameters:

  • The Device Data pointer (Like these drivers were created using PEx, this pointer is already defined when UART module is initialized).
  • The Output Buffer (This array contains the data that will be sent through UART)
  • The size (This variable specifies how many bytes are going to be sent)

So basically, if you want to send data through UART interface (i will recommend you to add a new UART component) you can call this function (UART_X_SendBlock(DeviceDataPtr_X, outputBuffer, SizeOfOutputBuffer);) and data will be sent through UART.

Also, please check that Sensor fusion enables interrupt for receiving and transmitting data (event.c file) so you can write your code based on how this library is built.

I hope this can help you,

Best Regards,

Isaac

----------------------------------------------------------------------------------------------------------------------------------------

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

----------------------------------------------------------------------------------------------------------------------------------------

0 Kudos