Unit tests for FreeRTOS / NXP MCU

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

Unit tests for FreeRTOS / NXP MCU

2,609 Views
gregbanderet
Contributor I

Hi,

We are starting a new project based on a K66 (Cortex-M4). We plan to use MCUxpresso and FreeRTOS.

We would like to unit test most of our code. What's the best approach for that? Is there any Windows/Linux simulation mode (of the MCU peripherals and of FreeRTOS)?

I'm curious to learn about what the community is doing for their unit tests. Do you compile your sources in another environment? Do you run your tests on the target?

For our previous project we were using Keil uVision and its Windows simulator. That way we were able to use CppUTest framework with that simulation mode.

Thank you for sharing your experience,

Greg

2 Replies

1,798 Views
mjbcswitzerland
Specialist V

Hi Greg

The uTasker project includes a turn-key FreeRTOS V9.0 and peripheral (USB stacks, Ethernet stacks, etc.) solution with K66 peripheral simulation which allows (approx.) real time project testing in Visual Studio.
Unfortunately the FreeRTOS pre-empting hasn't been fully solved yet in the simulation but the rest allows pretty much all code testing (including interrupt and DMA operations).

It is a versioned GIT based project and the following video shows how new targets can be added and managed https://youtu.be/_7Rxdr0NKWE

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html
Kinetis K66:
- http://www.utasker.com/kinetis/TWR-K65F180M.html
- http://www.utasker.com/kinetis/FRDM-K66F.html
- http://www.utasker.com/kinetis/TEENSY_3.6.html

Free Open Source solution: https://github.com/uTasker/uTasker-Kinetis
Working project in 15 minutes video: https://youtu.be/K8ScSgpgQ6M

For better, faster, cheaper product developments consider the uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : http://www.utasker.com/support.html

1,798 Views
BlackNight
NXP Employee
NXP Employee

Hi Greg,

I would have pointed you to the uTasker simulation too (thanks to Mark for jumping in here), as there is no full chip similation with peripheral simulation available from NXP. There is a Windows port of FreeRTOS (I have not used it), but here again you won't be able to run the K66 peripherals.

There is the QEMU emulation/simulation (see The GNU MCU Eclipse QEMU ) but you won't have a full peripheral simulation unless you add/implement it.

My approach is to do directly unit test on the real target/hardware which works pretty well. Basically I'm using a simple and small unit test framework which logs and handles the unit test cases. If there is any interest about that framework, I can try to put some time aside to write about it.

I hope this helps,

Erich

0 Kudos