Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PX4IO not enough RAM left for VTOL models like convergence #14116

Closed
julianoes opened this issue Feb 6, 2020 · 8 comments
Closed

PX4IO not enough RAM left for VTOL models like convergence #14116

julianoes opened this issue Feb 6, 2020 · 8 comments
Labels
Board: Pixhawk fmu-v5 FMU-v5 including pixhawk 4, pixhack v5, etc bug priority-critical

Comments

@julianoes
Copy link
Contributor

julianoes commented Feb 6, 2020

@sfuhrer found that sometimes RC did not work on the convergence and that the ACT LED on the Pixhawk 4 IO side would be always on instead of blinking.

We could also see a segfault using GDB via Dronecode Probe:

Program received signal SIGSEGV, Segmentation fault.
mm_free (heap=0x20000438 <g_mmheap>, mem=0x20001e38) at mm_heap/mm_free.c:130
130	  if ((prev->preceding & MM_ALLOC_BIT) == 0)
(gdb) bt
#0  mm_free (heap=0x20000438 <g_mmheap>, mem=0x20001e38)
    at mm_heap/mm_free.c:130
#1  0x08009132 in NullMixer::~NullMixer (this=0x20001e38, 
    __in_chrg=<optimized out>)
    at ../../../../../src/lib/mixer/NullMixer/NullMixer.hpp:47
#2  0x080077d4 in List<Mixer*>::clear (
    this=this@entry=0x20000e3c <mixer_group>)
    at ../../../../../src/include/containers/List.hpp:168
#3  0x08007872 in MixerGroup::reset (this=0x20000e3c <mixer_group>)
    at ../../../../../src/lib/mixer/MixerGroup.hpp:74
#4  mixer_handle_text (buffer=buffer@entry=0x20000c65 <dma_packet+4>, 
    length=62) at ../../../../../src/modules/px4iofirmware/mixer.cpp:601
#5  0x08005d0c in registers_set (page=<optimized out>, 
    offset=<optimized out>, values=values@entry=0x20000c65 <dma_packet+4>, 
    num_values=<optimized out>)
    at ../../../../../src/modules/px4iofirmware/registers.c:464
#6  0x08006446 in rx_handle_packet ()
    at ../../../../../src/modules/px4iofirmware/serial.c:176
#7  rx_dma_callback (handle=<optimized out>, status=status@entry=2 '\002', 
    arg=arg@entry=0x0)
    at ../../../../../src/modules/px4iofirmware/serial.c:234
#8  0x080065be in serial_interrupt (irq=<optimized out>, 
    context=<optimized out>, arg=<optimized out>)
    at ../../../../../src/modules/px4iofirmware/serial.c:325
#9  0x08002fe2 in irq_dispatch (irq=irq@entry=54, 
    context=context@entry=0x20001c5c) at irq/irq_dispatch.c:176
#10 0x08001d88 in up_doirq (irq=54, regs=0x20001c5c) at armv7-m/up_doirq.c:86
#11 0x08001a7a in exception_common () at armv7-m/gnu/up_exception.S:213
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) 

According to git bisect the bytes free go from 568 to 88 (sometimes 24) anywhere here, presumably due to the NuttX upgrade:

The first bad commit could be any of:
58799dc
694ae56
e847698
36a75b7
645b6c3
0f2a7ad
522ed2d
78944a7
d965b92
69694ab

Steps to reproduce:

Set SYS_AUTOSTART to 13012 for convergence airframe.
Boot and do px4io status.
You should see:

88 bytes free

Or sometimes garbage values when it crashed.

FYI @bkueng @davids5.

@julianoes julianoes added bug priority-critical Board: Pixhawk fmu-v5 FMU-v5 including pixhawk 4, pixhack v5, etc labels Feb 6, 2020
@dagar dagar added this to the Release v1.11.0 milestone Feb 6, 2020
@dagar
Copy link
Member

dagar commented Feb 6, 2020

For comparison.

PX4IO: starting
MEM: fre` 1160, Hargest 1160  <-- stable v1.10
MEM: free 622, largest 632    <-- master

@julianoes
Copy link
Contributor Author

@dagar What is that comparing? And what airframe?

@dagar
Copy link
Member

dagar commented Feb 6, 2020

It's the SYSLOG output in px4io.c before the mixer is even loaded.

https://github.com/PX4/Firmware/blob/b399698306e5afa068903adda094adedf0423691/src/modules/px4iofirmware/px4io.c#L359

@davids5
Copy link
Member

davids5 commented Feb 6, 2020

@julianoes - it was the last upgrade of NuttX, when the H7 came in. FD/streams became required. We could set it to 0 in the past and that saved memory. I adjusted the stack and free mem to boot. with out police lights, but Not all the mixers were tested. :(

@sfuhrer
Copy link
Contributor

sfuhrer commented Feb 7, 2020

Hi guys, do you see an easy way to unblock people that are using this specific airframe?

@julianoes
Copy link
Contributor Author

@sfuhrer #14128 might be just enough for now.

@sfuhrer
Copy link
Contributor

sfuhrer commented Feb 10, 2020

@sfuhrer #14128 might be just enough for now.

True, the IO with the Convergence works again with this PR (with 40 bytes free).

@dagar
Copy link
Member

dagar commented May 6, 2020

This was fixed, although we're still slightly short for the most extreme case (dodecarotor coax).

@dagar dagar closed this as completed May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Board: Pixhawk fmu-v5 FMU-v5 including pixhawk 4, pixhack v5, etc bug priority-critical
Projects
None yet
Development

No branches or pull requests

4 participants