Reference problem in systemcmds/tests

Hi there.

I am starting on a project on the PX4 and I wanted to interact with some IO device. I have well succes to use the nuttX shell to read sensors value but now I want to send command to the motors. I saw that their where already test function in systemcmds/tests. So I uncomment the line in nuttx_px4fmu-v2_default cmake configs.
# Testing
#
#drivers/sf0x/sf0x_tests
#drivers/test_ppm
#lib/rc/rc_tests
#modules/commander/commander_tests
#modules/controllib_test
#modules/mavlink/mavlink_tests
#modules/unit_test
#modules/uORB/uORB_tests
systemcmds/tests

But when I build the firmware I have a lots of reference problem :

 /home/robolab/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: firmware_nuttx section `.text' will not fit in region `flash'
/home/robolab/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: address 0x8107e64 of firmware_nuttx section `__param' is not within region `flash'
/home/robolab/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: address 0x8107e64 of firmware_nuttx section `__param' is not within region `flash'
/home/robolab/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: address 0x8107e64 of firmware_nuttx section `__param' is not within region `flash'
/home/robolab/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: region `flash' overflowed by 38608 bytes
../../systemcmds/tests/libsystemcmds__tests.a(tests_main.c.obj):(.rodata.tests+0x88): undefined reference to `commander_tests_main'
../../systemcmds/tests/libsystemcmds__tests.a(tests_main.c.obj):(.rodata.tests+0x94): undefined reference to `controllib_test_main'
../../systemcmds/tests/libsystemcmds__tests.a(tests_main.c.obj):(.rodata.tests+0xa0): undefined reference to `mavlink_tests_main'
../../systemcmds/tests/libsystemcmds__tests.a(tests_main.c.obj):(.rodata.tests+0xac): undefined reference to `mc_pos_control_tests_main'
../../systemcmds/tests/libsystemcmds__tests.a(tests_main.c.obj):(.rodata.tests+0xb8): undefined reference to `sf0x_tests_main'
../../systemcmds/tests/libsystemcmds__tests.a(tests_main.c.obj):(.rodata.tests+0xc4): undefined reference to `uorb_tests_main'
../../systemcmds/tests/libsystemcmds__tests.a(test_autodeclination.cpp.obj): In function `AutoDeclinationTest::~AutoDeclinationTest()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_autodeclination.cpp:15: undefined reference to `UnitTest::~UnitTest()'
../../systemcmds/tests/libsystemcmds__tests.a(test_autodeclination.cpp.obj): In function `AutoDeclinationTest::autodeclination_check()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_autodeclination.cpp:31: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_autodeclination.cpp.obj): In function `AutoDeclinationTest':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_autodeclination.cpp:15: undefined reference to `UnitTest::UnitTest()'
../../systemcmds/tests/libsystemcmds__tests.a(test_autodeclination.cpp.obj): In function `test_autodeclination':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_autodeclination.cpp:43: undefined reference to `UnitTest::print_results()'
../../systemcmds/tests/libsystemcmds__tests.a(test_hysteresis.cpp.obj): In function `HysteresisTest::~HysteresisTest()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_hysteresis.cpp:5: undefined reference to `UnitTest::~UnitTest()'
../../systemcmds/tests/libsystemcmds__tests.a(test_hysteresis.cpp.obj): In function `HysteresisTest::_zero_case()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_hysteresis.cpp:64: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_hysteresis.cpp:73: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_hysteresis.cpp.obj): In function `HysteresisTest::_change_after_time()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_hysteresis.cpp:93: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_hysteresis.cpp:103: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_hysteresis.cpp.obj): In function `HysteresisTest::_hysteresis_changed()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_hysteresis.cpp:122: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_hysteresis.cpp.obj):/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_hysteresis.cpp:135: more undefined references to `UnitTest::_print_assert(char const*, char const*, char const*, int)' follow
../../systemcmds/tests/libsystemcmds__tests.a(test_hysteresis.cpp.obj): In function `HysteresisTest':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_hysteresis.cpp:5: undefined reference to `UnitTest::UnitTest()'
../../systemcmds/tests/libsystemcmds__tests.a(test_hysteresis.cpp.obj): In function `test_hysteresis':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_hysteresis.cpp:204: undefined reference to `UnitTest::print_results()'
../../systemcmds/tests/libsystemcmds__tests.a(test_float.cpp.obj): In function `FloatTest::~FloatTest()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_float.cpp:14: undefined reference to `UnitTest::~UnitTest()'
../../systemcmds/tests/libsystemcmds__tests.a(test_float.cpp.obj): In function `FloatTest::singlePrecisionTests()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_float.cpp:71: undefined reference to `UnitTest::_print_compare(char const*, char const*, int, char const*, int, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_float.cpp.obj): In function `FloatTest::doublePrecisionTests()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_float.cpp:127: undefined reference to `UnitTest::_print_compare(char const*, char const*, int, char const*, int, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_float.cpp.obj): In function `FloatTest':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_float.cpp:14: undefined reference to `UnitTest::UnitTest()'
../../systemcmds/tests/libsystemcmds__tests.a(test_float.cpp.obj): In function `test_float':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_float.cpp:141: undefined reference to `UnitTest::print_results()'
../../systemcmds/tests/libsystemcmds__tests.a(test_int.cpp.obj): In function `IntTest::~IntTest()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_int.cpp:20: undefined reference to `UnitTest::~UnitTest()'
../../systemcmds/tests/libsystemcmds__tests.a(test_int.cpp.obj): In function `IntTest':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_int.cpp:20: undefined reference to `UnitTest::UnitTest()'
../../systemcmds/tests/libsystemcmds__tests.a(test_int.cpp.obj): In function `test_int':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_int.cpp:61: undefined reference to `UnitTest::print_results()'
../../systemcmds/tests/libsystemcmds__tests.a(test_mathlib.cpp.obj): In function `MathlibTest::~MathlibTest()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_mathlib.cpp:59: undefined reference to `UnitTest::~UnitTest()'
../../systemcmds/tests/libsystemcmds__tests.a(test_mathlib.cpp.obj): In function `MathlibTest':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_mathlib.cpp:59: undefined reference to `UnitTest::UnitTest()'
../../systemcmds/tests/libsystemcmds__tests.a(test_mathlib.cpp.obj): In function `test_mathlib':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_mathlib.cpp:439: undefined reference to `UnitTest::print_results()'
../../systemcmds/tests/libsystemcmds__tests.a(test_mathlib.cpp.obj): In function `MathlibTest::testVector2()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_mathlib.cpp:90: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_mathlib.cpp.obj): In function `MathlibTest::testVector3()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_mathlib.cpp:113: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_mathlib.cpp.obj): In function `MathlibTest::testRotationMatrixQuaternion()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_mathlib.cpp:291: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_mathlib.cpp.obj): In function `MathlibTest::testQuaternionRotate()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_mathlib.cpp:416: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_mathlib.cpp.obj): In function `MathlibTest::testVector4()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_mathlib.cpp:150: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_mathlib.cpp.obj):/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_mathlib.cpp:170: more undefined references to `UnitTest::_print_assert(char const*, char const*, char const*, int)' follow
../../systemcmds/tests/libsystemcmds__tests.a(test_matrix.cpp.obj): In function `MatrixTest::~MatrixTest()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_matrix.cpp:11: undefined reference to `UnitTest::~UnitTest()'
../../systemcmds/tests/libsystemcmds__tests.a(test_matrix.cpp.obj): In function `MatrixTest':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_matrix.cpp:11: undefined reference to `UnitTest::UnitTest()'
../../systemcmds/tests/libsystemcmds__tests.a(test_matrix.cpp.obj): In function `test_matrix':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_matrix.cpp:60: undefined reference to `UnitTest::print_results()'
../../systemcmds/tests/libsystemcmds__tests.a(test_matrix.cpp.obj): In function `MatrixTest::setIdentityTests()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_matrix.cpp:517: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_matrix.cpp.obj): In function `MatrixTest::matrixScalarMultTests()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_matrix.cpp:498: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_matrix.cpp.obj): In function `MatrixTest::matrixMultTests()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_matrix.cpp:480: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_matrix.cpp.obj): In function `MatrixTest::squareMatrixTests()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_matrix.cpp:569: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_matrix.cpp:582: undefined reference to `UnitTest::_print_assert(char const*, char const*, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_matrix.cpp.obj):/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_matrix.cpp:680: more undefined references to `UnitTest::_print_assert(char const*, char const*, char const*, int)' follow
../../systemcmds/tests/libsystemcmds__tests.a(test_mixer.cpp.obj): In function `MixerTest::MixerTest()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_mixer.cpp:127: undefined reference to `UnitTest::UnitTest()'
../../systemcmds/tests/libsystemcmds__tests.a(test_mixer.cpp.obj): In function `test_mixer':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_mixer.cpp:144: undefined reference to `UnitTest::print_results()'
../../systemcmds/tests/libsystemcmds__tests.a(test_mixer.cpp.obj): In function `MixerTest::load_mixer(char const*, char const*, unsigned int, unsigned int, unsigned int, bool)':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_mixer.cpp:356: undefined reference to `UnitTest::_print_compare(char const*, char const*, int, char const*, int, char const*, int)'
../../systemcmds/tests/libsystemcmds__tests.a(test_mixer.cpp.obj): In function `MixerTest::~MixerTest()':
/home/robolab/Documents/syncflight/src/Firmware/src/systemcmds/tests/test_mixer.cpp:105: undefined reference to `UnitTest::~UnitTest()'
collect2: error: ld returned 1 exit status
make[4]: *** [src/firmware/nuttx/firmware_nuttx] Error 1
make[3]: *** [src/firmware/nuttx/CMakeFiles/firmware_nuttx.dir/all] Error 2
make[2]: *** [src/firmware/nuttx/CMakeFiles/upload.dir/rule] Error 2
make[1]: *** [upload] Error 2
make: *** [px4fmu-v2_default] Error 2

Have you ever experienced that ? What is going on ?
Thank you

You’d need to uncomment the other modules under testing as well, although you’re probably better off starting with motor_test or motor_ramp instead.


Now there is one last error :

Linking CXX executable firmware_nuttx
/home/robolab/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: firmware_nuttx section `.text' will not fit in region `flash'
/home/robolab/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: address 0x81515cc of firmware_nuttx section `__param' is not within region `flash'
/home/robolab/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: address 0x81515cc of firmware_nuttx section `__param' is not within region `flash'
/home/robolab/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: address 0x81515cc of firmware_nuttx section `__param' is not within region `flash'
/home/robolab/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: region `flash' overflowed by 339620 bytes
../../systemcmds/tests/libsystemcmds__tests.a(tests_main.c.obj):(.rodata.tests+0xac): undefined reference to `mc_pos_control_tests_main'
collect2: error: ld returned 1 exit status
make[3]: *** [src/firmware/nuttx/firmware_nuttx] Error 1
make[2]: *** [src/firmware/nuttx/CMakeFiles/firmware_nuttx.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [px4fmu-v2_default] Error 2

Seems like the flash memory is full right ?

Ok I successfully control my actuators with

Tank you you can colse the subject

EDIT : Strangly it is not working with motor_test.

But none of the rotors turning