Hi Mike,
I'm relatively new to Freescale and Sensor Fusion. I have a project working on a custom board with a KL25Z128VFM4. It's driving a string of LEDS, reading some switches, and monitoring a battery voltage with an ADC. The board also includes an FXOS8700CQ accelerometer and magnetometer, and an FXAS21002 gyroscope. I built the initial software using SDK1 and processor expert, and can configure and read the sensors (I2C) and manage all the other components, but now I want to integrate the Sensor Fusion Software. I thought an approach would be to build a bare metal version using the V7 Sensor Fusion on the FRDMKL25Z with the AGM01 board and get that working with the Sensor Fusion toolbox, then port it to my board. But I'm struggling to work out where to begin. I built a SDK2.0 package for the KL25Z128, and downloaded it, and can create a new project using it with the 2.0 wizard. I've read the print of the pages from the Rev 2 of the User Guide, but am still unclear how to proceed. Is there a document I'm missing somewhere that will provide some direction? Do I just have to import all appropriate source and headers into the project, modify the main with main_baremetal.c, configure the build.h, and go from there?
Thanks for any help!
解決済! 解決策の投稿を見る。
Andrew,
I appreciate the status update. It makes my day when I know someone has successfully included the library into their design.
Regards,
Mike
Remember the Borg in Star Trek the Next Generation? Well, we (as in the Sensor Fusion project) have been assimilated by KSDK. Along with the many benefits, it also places some limitations on us as to how we field example applications. The initial 7.00 release within KEx only supports K22F and K64F out of the box. BUT, if you build your K25Z KSDK based on the FRDM-KL25Z-A8471 kit pulldown, and check the ISSDK option, you will get the sensor fusion code included (I just checked). But it does not have a reference design. Let me see if I can pull one together for you. Do you prefer IAR or KDS?
Mike
Thanks Mike - a reference design would be great - KDS please.
I realized that the V7 was (so far!) for the K22 and K64, but did build and download for the K25 and selected the ISSDK option and got the Sensor Fusion code - and then stalled! I think I can work it out but the work involved looks fairly daunting! Any help is much appreciated,
Andy
Andy,
I am working on an example for you, but it's taking a bit longer than I expected because I had forgotten that the KL25Z UART0 uses a different driver. I've got to roll a slightly different version of the control subsystem to adapt for that. So please give me another day.
To address your earlier question about the process:
The fusion code is basically hardware agnostic. All hardware dependencies are contained within the headers in (4) above, plus subsystems and sensor drivers. There's quite a bit of discussion on that in the sensor fusion user guide.
Regards,
Mike
Andrew, I uploaded a bare metal IAR project in a separate posting. The FreeRTOS version isn't ready for prime time yet, as I need to bring RAM requirements down.
FYI, I also found that when using the "all algorithms" build at 40Hz fusion rate, I encountered problems in the dynamic behavior in the 9-axis build. So the version I posted is ONLY 9-axis at 25Hz. That seems to be better behaved.
Thanks Mike - but I'm hoping that IAR is a typo - did you mean KDS?
No, I meant IAR. Since you didn't specify, I went with my default tool. I'll try to pull together a KDS version for you.
Thanks - I did specify - I guess you missed it - first line of my reply on the 24th!
I really appreciate all the work so far - I've been working along attempting to make progress myself! Quite a steep learning curve though.
You did. I must have read it half a dozen times. Sorry.
I'm working on it now. Unfortunately KDS and I do not get along well, so although I now know exactly what file changes need to be brought in place, getting the configuration in the tool correct is taking some time.
No worries! I know how that happens.
Andrew,
Check out the latest posting. I hope it gets you moving forward.
To get this working on KL25Z, I had to create new versions of:
All dealt with differences in the KSDK between flavors of Kinetis.
As noted earlier, I built for a 25Hz fusion rate, 9-axis only. Otherwise, everything will match what you see in the user manual.
Regards,
Mike
Mike - thought you might like to know, - I got the bare metal version running on our board today, using the FRDMKL25Z opensda to program it and to communicate to the pc. I had to switch to uart0, as the uart1 pins on our board are used for other functions. Had some challenges getting the uart running correctly, but eventually worked out that set status wasn't configured in sfg - so changed the order of the initialization in main, and it worked fine. Then had to run uart connections from our board to the FRDM board. Also had to reroute the i2C pins, but then all works and talks to the Sensor fusion tool box! Thanks again for your help.
Andrew,
I appreciate the status update. It makes my day when I know someone has successfully included the library into their design.
Regards,
Mike
Hi Mike,
I'm in sort of the same boat as Andrew but can't seem to find the code you posted for the project. Could you let me know where I might find it?
Many thanks,
-Dino
Dino - I think it's attached to the posting from Mike a month ago labeled 'Bare Metal KL25Z KDS Sensor Fusion 7.00'.
Regards, Andy
Correct.
Great, thanks Andrew and Mike!
-Dino
Hi Mike,
Anything in particular (besides what is in the SensorFusion Guide) I should consider in migrating your code over to run on FreeRTOS for the FRDM-KL25Z or for the FRDM-KL27Z as we're looking at possibly using a KL17Z for production?
Thanks,
-Dino
Dino,
Make sure you pick a KL17Z variant with sufficient RAM/Flash. Pay attention to which UART variant (standard or low power) is used for the OpenSDA port (which affects the control subsystem implementation), and especially pay attention to physical alignment of the sensors on the PCB. There are a couple of existing NXP applications notes on the topic of PCB layout considerations for accel and mag. Make sure whoever does the layout is familiar with them.
Mike
Thx Mike, will do!
-Dino
Got it running Mike - many thanks for all your help!