Error flashing file to FRDM-SFUSION sensor fusion board

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

Error flashing file to FRDM-SFUSION sensor fusion board

Jump to solution
1,257 Views
haneybriggs
Contributor II

We are working on a senior design project for the University of Idaho. We are trying to follow Part 7: Explore the Sensor Fusion Library from AMF-CON-T0756 training file that comes with the FRDM-FSX-MULTI-B sensor fusion board paired with the FRDM-K64F microcontroller board. Following these steps, I am able to run processExpert, and build the file. But when I run the file I get and error, and am not able to flash the .elf file to the microcontroller. Here are the steps I have done:

 

1) Download the Sensor Fusion Library for Kinetis MCUs

2) Download FRDM-SFUSION Quick Start Guide (this is where the AMF-CON-T0756 training is located, in the training file)

3) Download Kinetis v3.0.0

4) Download OpenSDAv2

5) Download firmware for the sensor fusion board

6) Install Sensor Fusion Toolbox (found in quick start guide in windows installer file)

 

At this point, I thought I had everything I needed to get started, so I opened Kinetis and:

1) Converted my project by selecting Project > KDS Upgrade Assistant (successful)

2) Run ProcessorExpert.pe (successful)

3) Build project (successful)

4 Run project (failure)

 

I am stuck here and can't figure out where to go next. Some information that may be helpful is that the quick start guide comes with a pre-compiled binary file that I am able to flash to the board. This difference is that the board shows up just like another drive, and all I have to do is drag and drop the binary file into the drive and it works. Also, if I try to do this with the binary file built in kinetis, it looks like it works, but the opening the Sensor Fusion Toolbox shows that the binary file was not correct, and the toolbox actually can't get any information from the board. Another thing is, Kinetis is trying the flash the .elf file, not the binary.

 

If anyone can see a possible error in the process I am taking, or have suggestions on what I should be doing differently, I would be very grateful.

 

Links to downloads:

Sensor Fusion Library for Kinetis MCU's and Quick Start Guide: Sensor Fusion Development Kit|Freescale

Kinetis v3.0.0: Kinetis Design Studio Integrated Development |Freescale

OpenSDAv2: Windows serial configuration - Handbook | mbed

Firmware download:Firmware FRDM K64F - Handbook | mbed

Sensor Fusion toolbox: In quick start guide, in Windows Installer folder

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

This one is easy, I can see you are new to Processor Expert.  When you changed the UART to UART0, you also needed to change the RX/TX pin assignments.  Again referring to Table 2 in the user guide, UART0 must be assigned pins PTB17:16 for the K64.   You shouldn't have had to touch the JTAG at all.

View solution in original post

0 Kudos
7 Replies
1,038 Views
haneybriggs
Contributor II

Oh and here is a screenshot of the fail that I get. There isn't really any information included in it.

pastedImage_1.png

0 Kudos
1,038 Views
michaelestanley
NXP Employee
NXP Employee

Honestly, I have trouble flashing directly from KDS as well.  The one approach that always works for Mark Pedley and myself (the fusion team) is to build a binary and drag and drop.  I assume you are using the ARM CMSIS-DAP OpenSDA2 implementation?  If so, you need a .bin file created when you compile.  Under Project->Properties->C/C++ Build->Settings, expand the last entry (Cross-ARM GNU Create Flash Image) and make sure you have the "Output file format" field set to "Raw Binary".

I have had problems with KDS sometimes refusing to build a binary.  Doing a project clean and then recompiling always forces the issue.  Then just open up a file explorer and drag the .bin file across to the MBED MSD device.

I invite other experts from within Freescale to chime in with better solutions for the above.  I am NOT a KDS expert.

On the topic of interaction with the Sensor Fusion Toolbox.  Can you click the "About" button on that tool and tell me what you see?  Version 5.00 of the sensor fusion library (which we are about to pre-release) breaks compatibility the old versions of the Sensor Fusion Toolbox.

BTW, the Fusion Toolbox for Windows has the ability to flash boards with binaries which are guaranteed to be compatible with the tool.  So try that to ensure that your hardware and drivers are set up OK.

Once I know you've seen this reply, I will move this thread over the the sensor fusion community page.  I keep close tabs on that page, and you'll get more timely support on fusion topics.

Regards,

Mike Stanley

0 Kudos
1,038 Views
haneybriggs
Contributor II

We actually had the binary file being built already, and I checked the setting you pointed me to and it was set correctly. But there is a problem with the binary being build. It allows us to drag and drop the built binary, but then when we open the Sensor Fusion Toolbox and click auto detect it fails to find our device. Below is the error that we are getting.

pastedImage_1.png

As for your other suggestions, I am able to flash using the Sensor Fusion Toolbox, as well as drag and drop the pre-complied code provided in the quick start guide, so I don't think it is a problem with the drivers or hardware. The above problem will go away after I do either of these.

Finally, below is a screenshot of the about window from the Toolbox.

pastedImage_0.png

0 Kudos
1,038 Views
michaelestanley
NXP Employee
NXP Employee

I'm sorry you are struggling.  If we can't resolve it shortly, I would be happy to schedule a Skype session with you to debug your problem.  Most of the time this kind of thing turns out to be simple to resolve once we do that.

The K64F has a couple of UARTs that are of interest for this project.  One drives the Bluetooth module, the other the serial/OpenSDA.  The version of the kit you have requires you to explicitly program the project's UART to one or the other (see table 2 in the user guide).  That might account for why the precompiled binaries work and the one you built doesn't.   This is a really common error.  So check that first.  BTW, just yesterday I posted an early release of Version 5.00 of the sensor fusion library.  The new builds work with BOTH wired and wireless connections without this modification.

Other problems I've seen over the years are conflicts for the PC's serial port.  To be sure, exit KDS before starting up the fusion toolbox.  And make absolutely sure you don't have multiple copies of the fusion toolbox up and running.  That will screw you up every time.

When you say you tried drag and drop, was it with a .bin file or a .elf file?  The latter is only useful for download within the debugging environment, and frankly I have problems myself in KDS.  Another thing I forget to do all the time is to explicitly unplug the OpenSDA after the drag and drop and then reconnect.  This forces a reset of the MCU into the downloaded program.  Some boards seem to not need that, but the official process is to always reset the board using this technique.

If you see the green blinking LED on the board, you know the fusion software is running.  Given what you've described in this last message, I'm betting the wrong UART is programmed.  You want UART3 if you are using Bluetooth, UART0 if you are using a wired USB connection.  The screen dump below shows the KDS/ProcessorExpert window where you need to make the change.

Regards,

Mike

KDS3_K64_UART.png

0 Kudos
1,038 Views
haneybriggs
Contributor II

We are using a wired USB connection, and you were right that we were programming UART3. But when changing this setting I am getting this error.

pastedImage_0.png

The problem is that some JTAG settings are conflicting with these settings. I turned them off and at least stopped getting this error. We aren't using JTAG, so I didn't think this would be a problem. Below is what I saw, and unchecking TDI and TDO got rid of the errors. Can you see any problem with doing so? If there is a problem, how can I use UART0?

pastedImage_2.png

After turning off those JTAG settings I was able to build the project. As you suggested, I used the drag and drop method (with the binary file) and it looked like it programmed the board. I then closed KDS, unplugged the board, power cycled, plugged it back in, opened the toolbox and hit Auto Detect. Once again, it failed to recognize the board, which is the same problem we have been having. Can you see anything else we should check? If not, I would appreciate having a Skype conversation so we can figure this out.

0 Kudos
1,039 Views
michaelestanley
NXP Employee
NXP Employee

This one is easy, I can see you are new to Processor Expert.  When you changed the UART to UART0, you also needed to change the RX/TX pin assignments.  Again referring to Table 2 in the user guide, UART0 must be assigned pins PTB17:16 for the K64.   You shouldn't have had to touch the JTAG at all.

0 Kudos
1,038 Views
haneybriggs
Contributor II

Sorry for taking so long to reply. This worked for me, and I got excited to continue with my work and forgot to let you know! I am still not able to use Kinetis to flash to the device, but I am building a valid binary file so this is not a concern to me. Thanks for the help! This has been a roadblock for quite awhile so it is nice to finally be over it.

0 Kudos