Can I use PRINF with fusion Library

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

Can I use PRINF with fusion Library

Jump to solution
1,508 Views
ciuas
Contributor I

I am using the 6DOFBareBoardeCompass/FRDM_KL26Z library program and I am trying to get output such as magnetometer readings written to Putty using the PRINFT function with no success. Is this actually possible and if not is there any other way of getting output written to putty. I can see the UART functions but I cant get them to work either.

Thanks.

Labels (1)
0 Kudos
Reply
1 Solution
1,322 Views
michaelestanley
NXP Employee
NXP Employee

Ciu,

Because printf is a very large function, requiring a lot of memory, we don't include it in the standard build.  Instead, we use dedicated UART functions (which you've noted) to build up binary data structures to transmit data back to the Sensor Fusion Toolbox.  If you look at function CreateAndSendPacketsViaUART() in drivers.c, you will see that we hand packet a reusable buffer by:

  1. setting initial buffer pointer=0
  2. making repeated calls to sBufAppendItem to add data to the buffer
  3. calling UART_SendBlock to send the buffer when it is complete

The protocol is described in the user guide, and you can use the Sensor Fusion Toolbox to log data to a file.  I think you'll find the data you are after is already being transmitted.

Mike

View solution in original post

0 Kudos
Reply
1 Reply
1,323 Views
michaelestanley
NXP Employee
NXP Employee

Ciu,

Because printf is a very large function, requiring a lot of memory, we don't include it in the standard build.  Instead, we use dedicated UART functions (which you've noted) to build up binary data structures to transmit data back to the Sensor Fusion Toolbox.  If you look at function CreateAndSendPacketsViaUART() in drivers.c, you will see that we hand packet a reusable buffer by:

  1. setting initial buffer pointer=0
  2. making repeated calls to sBufAppendItem to add data to the buffer
  3. calling UART_SendBlock to send the buffer when it is complete

The protocol is described in the user guide, and you can use the Sensor Fusion Toolbox to log data to a file.  I think you'll find the data you are after is already being transmitted.

Mike

0 Kudos
Reply