flashing nuttx on pixhawk 2 flight controller board

291 views
Skip to first unread message

Amit Tewari

unread,
Mar 25, 2018, 4:52:52 PM3/25/18
to NuttX
hello friends,
I am trying to understand px4 autopilot code. As a starting point i wanted to flash nuttx rtos on pixhawk flight controller(containing stm32f427V). I added pixhawk board(px4fmu-v2 board config) to nuttx configs and can configure it using menuconfig but getting error in building nuttx using make.

/home/lucifer/nuttxspace/nuttx/lib/libarch.a(stm32_start.o): In function `__start':
/home/lucifer/nuttxspace/nuttx/arch/arm/src/chip/stm32_start.c:312: undefined reference to `stm32_boardinitialize'
/home/lucifer/nuttxspace/nuttx/lib/libarch.a(up_assert.o): In function `up_assert':
/home/lucifer/nuttxspace/nuttx/arch/arm/src/armv7-m/up_assert.c:408: undefined reference to `board_crashdump'
/home/lucifer/nuttxspace/nuttx/lib/libsched.a(os_start.o): In function `os_start':
/home/lucifer/nuttxspace/nuttx/sched/init/os_start.c:723: undefined reference to `sched_note_start'
/home/lucifer/nuttxspace/nuttx/lib/libsched.a(task_activate.o): In function `task_activate':
/home/lucifer/nuttxspace/nuttx/sched/task/task_activate.c:82: undefined reference to `sched_note_stop'
/home/lucifer/nuttxspace/nuttx/sched/task/task_activate.c:89: undefined reference to `sched_note_start'
/home/lucifer/nuttxspace/nuttx/lib/libarch.a(stm32_otgfsdev.o): In function `stm32_resumeinterrupt':
/home/lucifer/nuttxspace/nuttx/arch/arm/src/chip/stm32_otgfsdev.c:3085: undefined reference to `stm32_usbsuspend'
/home/lucifer/nuttxspace/nuttx/lib/libarch.a(stm32_otgfsdev.o): In function `stm32_suspendinterrupt':
/home/lucifer/nuttxspace/nuttx/arch/arm/src/chip/stm32_otgfsdev.c:3147: undefined reference to `stm32_usbsuspend'
/home/lucifer/nuttxspace/nuttx/lib/libapps.a(nsh_romfsetc.o): In function `nsh_romfsetc':
/home/lucifer/nuttxspace/apps/nshlib/nsh_romfsetc.c:123: undefined reference to `romfs_img_len'
/home/lucifer/nuttxspace/apps/nshlib/nsh_romfsetc.c:123: undefined reference to `romfs_img'
/home/lucifer/nuttxspace/nuttx/lib/libfs.a(fs_fat32.o): In function `fat_unbind':
/home/lucifer/nuttxspace/nuttx/fs/fat/fs_fat32.c:2194: undefined reference to `fat_dma_free'
/home/lucifer/nuttxspace/nuttx/lib/libfs.a(fs_fat32.o): In function `fat_dup':
/home/lucifer/nuttxspace/nuttx/fs/fat/fs_fat32.c:1474: undefined reference to `fat_dma_alloc'
/home/lucifer/nuttxspace/nuttx/lib/libfs.a(fs_fat32.o): In function `fat_close':
/home/lucifer/nuttxspace/nuttx/fs/fat/fs_fat32.c:459: undefined reference to `fat_dma_free'
/home/lucifer/nuttxspace/nuttx/lib/libfs.a(fs_fat32.o): In function `fat_open':
/home/lucifer/nuttxspace/nuttx/fs/fat/fs_fat32.c:326: undefined reference to `fat_dma_alloc'
/home/lucifer/nuttxspace/nuttx/lib/libfs.a(fs_fat32util.o): In function `fat_mount':
/home/lucifer/nuttxspace/nuttx/fs/fat/fs_fat32util.c:543: undefined reference to `fat_dma_alloc'
/home/lucifer/nuttxspace/nuttx/fs/fat/fs_fat32util.c:673: undefined reference to `fat_dma_free'
/home/lucifer/nuttxspace/nuttx/lib/libsched.a(sched_suspendscheduler.o): In function `sched_suspend_scheduler':
/home/lucifer/nuttxspace/nuttx/sched/sched/sched_suspendscheduler.c:89: undefined reference to `sched_note_suspend'
/home/lucifer/nuttxspace/nuttx/lib/libsched.a(sched_resumescheduler.o): In function `sched_resume_scheduler':
/home/lucifer/nuttxspace/nuttx/sched/sched/sched_resumescheduler.c:102: undefined reference to `sched_note_resume'
/home/lucifer/nuttxspace/nuttx/lib/libsched.a(task_terminate.o): In function `task_terminate':
/home/lucifer/nuttxspace/nuttx/sched/task/task_terminate.c:198: undefined reference to `sched_note_stop'
/home/lucifer/nuttxspace/nuttx/lib/libconfigs.a(boardctl.o): In function `boardctl':
/home/lucifer/nuttxspace/nuttx/configs/boardctl.c:275: undefined reference to `board_app_initialize'
Makefile:203: recipe for target 'nuttx' failed
make[1]: *** [nuttx] Error 1
make[1]: Leaving directory '/home/lucifer/nuttxspace/nuttx/arch/arm/src'
Makefile.unix:416: recipe for target 'pass2' failed
make: *** [pass2] Error 2

Can anyone help me in figuring out what is wrong.

patacongo

unread,
Mar 25, 2018, 5:01:26 PM3/25/18
to NuttX
I am trying to understand px4 autopilot code. As a starting point i wanted to flash nuttx rtos on pixhawk flight controller(containing stm32f427V). I added pixhawk board(px4fmu-v2 board config) to nuttx configs and can configure it using menuconfig but getting error in building nuttx using make.

It is clear that your board configuration does not match the version of the OS you are using.

Are you using upstream NuttX or some squirreled away PX4 variant?  Where did you get the px4fmu-v2 board configuration.  It does not seem to match the NuttX version you are using.

If you are using the currently using upstream NuttX, then the answer to all of your questions is in nuttx/configs/stm32f4discover/src (STM32F407) or nuttx/configs/stm32f429i-disco/src.  While not STM32F27, they are close enough and all of the answers are there.  You can use those source files to bring your old configuration up to date.

If you are not using upstream NuttX, then you asking in the wrong forum.  The PX4 team supports the custom OS versions that they use.  While there are a few PX4 knowledgeable people here, you probably will not get a helpful responses.

patacongo

unread,
Mar 25, 2018, 5:14:25 PM3/25/18
to NuttX
I am trying to understand px4 autopilot code. As a starting point i wanted to flash nuttx rtos on pixhawk flight controller(containing stm32f427V). I added pixhawk board(px4fmu-v2 board config) to nuttx configs and can configure it using menuconfig but getting error in building nuttx using make.

It is clear that your board configuration does not match the version of the OS you are using.

Some of the problems are because your version of the board code is much older than the OS code you are using.  These symbols include:  stm32_boardinitialize()

But the reset are features that you have enabled in the configuration that cause board-specific logic to be called, but have apparently provided any implementation of the features in your board code.  These include: board_crashdump(), sched_note_*(), romfs_img_lenm, romfs_img, fat_dma_*(), and board_app_initialize().  None of those are provided by the RTOS but must be supported by your board-specific logic (or you can reconfigure to disable the feature the requires those functions).

Some of those special, board-specific, are provided in upstream STM32 F4 configurations, but most are not.  You will probably need to fish around in the PX4 code to find the implementations.

I know, for example, that PX4 team pirated the sched_note_*() instrumentation for there non-standard implementation of the top command.  That code violates the portable POSIX OS interface and can never come upstream (it could be properly converted to use the procfs file system, I suppose.)

The romfs_* data references are to the ROMFS file system that is mounted on start-up and holds the PX4 start-up script.  Again, not part of NuttX.

You can look at the location where the other missing functions are called to see what configuration options enable them and, if you don't want to bother implementing the PX4 hooks, you can just disable the configuration.


Amit Tewari

unread,
Mar 26, 2018, 2:16:18 PM3/26/18
to NuttX
thanks for repyly patacongo,
I downloaded the latest version of nuttx and tried bulding it for pixhawk board and got same errors. I am using px4fmu-v2 configuration available in px4 firmware. As I am not an expert so could you help me as to how i can flash and run nuttx on pixahawk board(stm32f427V). 


Alan Carvalho de Assis

unread,
Mar 26, 2018, 2:28:21 PM3/26/18
to Amit Tewari, NuttX
Hi Amit,

This pixhawk board is a contribution from PX4 project.

You should get better support directly on PX4 forum, because here only
David Sidrane is suppose to have this board. Case this board support
on NUttX mainline is broken, then PX4 could help to fix it.

BR,

Alan
> --
> You received this message because you are subscribed to the Google Groups
> "NuttX" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nuttx+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

patacongo

unread,
Mar 26, 2018, 2:34:09 PM3/26/18
to NuttX
I downloaded the latest version of nuttx and tried bulding it for pixhawk board and got same errors. I am using px4fmu-v2 configuration available in px4 firmware. As I am not an expert so could you help me as to how i can flash and run nuttx on pixahawk board(stm32f427V). 

I don't know anything about PX4 and cannot help you.  You need to talk to people in the PX developer forum for help.

There used to be a stripped down build-abled version of the px4fmu-v2 configuration.  It was removed because there was no one to support it.  The old, last used version is here:  See https://bitbucket.org/nuttx/obsoleted/src/master/nuttx/configs/px4fmu-v2_upstream

see also


and


patacongo

unread,
Mar 26, 2018, 2:37:53 PM3/26/18
to nu...@googlegroups.com

There used to be a stripped down build-abled version of the px4fmu-v2 configuration.  It was removed because there was no one to support it.  The old, last used version is here:  See https://bitbucket.org/nuttx/obsoleted/src/master/nuttx/configs/px4fmu-v2_upstream

NOTE that that code was removed 3 years 2 months+ ago.  It is likely not fully compatible either.

Also, there are two versions of the PX4 firmware.  One using an ancient copy of Nuttx (probably that goes with the configuration that you have) and one that is only a year or so behind.  I forget what the PX4 people called that, nuttx-new or something like that (well, it was new a year or so ago).

Reply all
Reply to author
Forward
0 new messages