-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix SITL target build and runtime segfaults #9342
Conversation
src/main/cli/settings.c
Outdated
|
||
{ "osd_rcchannels", VAR_INT8 | MASTER_VALUE | MODE_ARRAY, .config.array.length = OSD_RCCHANNELS_COUNT, PG_OSD_CONFIG, offsetof(osdConfig_t, rcChannels) }, | ||
{ "osd_camera_frame_width", VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { OSD_CAMERA_FRAME_MIN_WIDTH, OSD_CAMERA_FRAME_MAX_WIDTH }, PG_OSD_CONFIG, offsetof(osdConfig_t, camera_frame_width) }, | ||
{ "osd_camera_frame_height", VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { OSD_CAMERA_FRAME_MIN_HEIGHT, OSD_CAMERA_FRAME_MAX_HEIGHT }, PG_OSD_CONFIG, offsetof(osdConfig_t, camera_frame_height) }, | ||
#endif // end of #ifdef USE_OSD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this PR, but valid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find - but can this please be extracted into a separate pull request to keep track of it?
@@ -538,7 +538,7 @@ void init(void) | |||
busSwitchInit(); | |||
#endif | |||
|
|||
#if defined(USE_UART) | |||
#if defined(USE_UART) && !defined(SIMULATOR_BUILD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is stub uartPinConfigure
for SIMULATOR_BUILD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should either remove this, or remove the stub.
{ | ||
UNUSED(io); | ||
UNUSED(cfg); | ||
printf("IOConfigGPIO\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively, it's possible to add #undef's for USE_PINIO, USE_PINIOBOX, USE_PIN_PULL_UP_DOWN
(see https://github.com/betaflight/betaflight/pull/9352/files#diff-f682e0332717b305936b703833517366)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am surprised that this even built before these stubs were added - are we missing some compiler settings to make this fail for the default build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikeller for me it didn't build without my change - I think it just hasn't been attempted to build in a while.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is built as part of our CI on Travis and on Jenkins (see https://ci.betaflight.tech/job/Betaflight/2018/artifact/obj/betaflight_4.2.0_SITL-2018-6433aaa68.hex). Unfortunately we do not have strong checks in place for the compiler suite version used for this target, so I suspect the build problems are gcc version dependent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am surprised that this even built before these stubs were added - are we missing some compiler settings to make this fail for the default build?
It builds with make TARGET=SITL, but fails with make TARGET=SITL DEBUG=GDB. I think that in release build some of PINIO-related calls is optimized away.
I've been passing through joystick input via MSP on a second TCP-UART, but I'm seeing some crazy latency in the receiver tab in the configurator. Is that the SITL build being slow, the TCP bridge being crappy, or the python MSP implementation I'm using being late? I also haven't been able to get any PWM data out, I'm trying to listen using netcat: |
src/main/cli/settings.c
Outdated
|
||
{ "osd_rcchannels", VAR_INT8 | MASTER_VALUE | MODE_ARRAY, .config.array.length = OSD_RCCHANNELS_COUNT, PG_OSD_CONFIG, offsetof(osdConfig_t, rcChannels) }, | ||
{ "osd_camera_frame_width", VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { OSD_CAMERA_FRAME_MIN_WIDTH, OSD_CAMERA_FRAME_MAX_WIDTH }, PG_OSD_CONFIG, offsetof(osdConfig_t, camera_frame_width) }, | ||
{ "osd_camera_frame_height", VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { OSD_CAMERA_FRAME_MIN_HEIGHT, OSD_CAMERA_FRAME_MAX_HEIGHT }, PG_OSD_CONFIG, offsetof(osdConfig_t, camera_frame_height) }, | ||
#endif // end of #ifdef USE_OSD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find - but can this please be extracted into a separate pull request to keep track of it?
@@ -538,7 +538,7 @@ void init(void) | |||
busSwitchInit(); | |||
#endif | |||
|
|||
#if defined(USE_UART) | |||
#if defined(USE_UART) && !defined(SIMULATOR_BUILD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should either remove this, or remove the stub.
{ | ||
UNUSED(io); | ||
UNUSED(cfg); | ||
printf("IOConfigGPIO\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am surprised that this even built before these stubs were added - are we missing some compiler settings to make this fail for the default build?
Can you please rebase / squash these changes into one commit? |
…vice vTable functions and IOConfigGPIO stub
decac1f
to
548379b
Compare
|
Fix SITL target build and runtime segfaults
SITL target segfaults in several places after running because of absent motorPwmDevice functions.
Target cannot be built with DEBUG=GDB option because of absent uartPinConfigure and IOConfigGPIO function calls.
Entering CLI tab in connected to SITL configurator also causes segfault because of some OSD cli settings placed outside of #ifdef USE_OSD