Baseflight aka multiwii port to stm32

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Post by timecop »

Not sure, since I didn't write it + dont use gcc. I do know that there might (?) be some stuff in there for last k of flash to be used as config storage so it doesn't get overwritten. Other than that, you'd probably need to read up on what gcc linker scripts look like. keil SCT stuff is heaps easier compared to that.

User avatar
aBUGSworstnightmare
Posts: 115
Joined: Mon Jun 27, 2011 8:31 pm
Location: Munich, Germany

Re: Baseflight aka multiwii port to stm32

Post by aBUGSworstnightmare »

timecop wrote:Not sure, since I didn't write it + dont use gcc. I do know that there might (?) be some stuff in there for last k of flash to be used as config storage so it doesn't get overwritten. Other than that, you'd probably need to read up on what gcc linker scripts look like. keil SCT stuff is heaps easier compared to that.


O.K.! Well, hopefully I will find the answer when digging through both .map files.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Post by timecop »

Is there anything to dig for? does the binary not work? or?
if it builds + links + runs it's probably fine?

User avatar
aBUGSworstnightmare
Posts: 115
Joined: Mon Jun 27, 2011 8:31 pm
Location: Munich, Germany

Re: Baseflight aka multiwii port to stm32

Post by aBUGSworstnightmare »

No, everything is looking fine! But since there is the difference in the linker script file there's maybe difference in memory usage too.

I've only checked with Baseflight GUI so far; when changing to the RELATIME DATA VIEW tab you can see packet errors. Don't know if this is related to the GUI or my basflight .hex.

Do you use special optimization settings or not?

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Post by timecop »

Release build that I upload sometimes to svn is just -O3 in keil. Nothing special.
Do you get errors with baseflight build from svn, or only yours?
I guess it shouldn't be happening.
btw, during debugging I always run -O0 (no optimization) build, so I guess it should work if properly built.
Memory is not anywhere near being used, so I don't think even 1-2k difference in ram used in map file is gonna matter.

User avatar
aBUGSworstnightmare
Posts: 115
Joined: Mon Jun 27, 2011 8:31 pm
Location: Munich, Germany

Re: Baseflight aka multiwii port to stm32

Post by aBUGSworstnightmare »

Hi timecop,

I've just checked out r447 and tested the .hex file included --> no packet errors in BaseflightGUI REALTIME DATA tab.

I've the build r447 in my environment (using various optimization settings) and I always see packet errors in REALTIME DATA tab. The error rate is at 10% of the total packages received.

The strange thing is that I only get package errors on this tab, not on the others (i.e. RC CONTROL SETTING). Maybe this is related to the GUI and not the Firmware. Is there any other GUI to test with (which also shows this value)? The GUI often crashes when I try to change RX MAP.

cGiesen
Posts: 188
Joined: Wed Jul 18, 2012 7:53 am
Location: Bochum, Germany

Re: Baseflight aka multiwii port to stm32

Post by cGiesen »

The error is related to MSP_MISC (114) all other packages are ok.
I see, the HEX is more than twice (321.592 Byte) than the 'normal' HEX (152.495 Byte)

Edit:
It's an CRC Error

User avatar
aBUGSworstnightmare
Posts: 115
Joined: Mon Jun 27, 2011 8:31 pm
Location: Munich, Germany

Re: Baseflight aka multiwii port to stm32

Post by aBUGSworstnightmare »

cGiesen wrote:I see, the HEX is more than twice (321.592 Byte) than the 'normal' HEX (152.495 Byte)


Don't get fooled by the 'codesize' --> I think you refer to the filesize! The codesize with -O2 optimization is around 72kB.

The current 4.7 ARM GCC compiler generates larger code than the 4.6 version. I will check with two more revisions (and the new one with a special symbol to let the 4.7 compiler generate a 4.6 like codesize.

In which module is the sourcecode for MSP_MISC (114)?

Jörg

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Baseflight aka multiwii port to stm32

Post by Crashpilot1000 »

I also noticed various file lengths through gcc versions. They are all a some precious KB longer than the keil compiled hex from tc (using the same code for testing). Well to get down to that subject you will have to look for differences in the generated assembly language code (like disassemble the .elf file)......

DrEvil
Posts: 17
Joined: Mon Sep 10, 2012 12:23 pm

Re: Baseflight aka multiwii port to stm32

Post by DrEvil »

I have been trying to set up a flying wing with Baseflight on my ver.4 board.
I gotmost tings working, but can not arm the motor.
Servo's are working and all seems fine, all but motor.
Gui works, but somewhat unstable.
In gui all rc/servo show's but not motor in "live rc", throttel indicates proper link.

I have also flashed latest Harakiri with the same error.
I have been several month's away from the Naze32 universe, :-) so please bare with me :-) :-)

I'm a little lost atm.

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Baseflight aka multiwii port to stm32

Post by Crashpilot1000 »

Did you ever come across the idea to arm the fc like described in mwii wiki? If that doesn't work, sell the board or buy a radio that reaches the appropiate stick limits if you are not able to change them in cli or your TX. Arming hasn't changed for "several months" in any mwii "universe".

DrEvil
Posts: 17
Joined: Mon Sep 10, 2012 12:23 pm

Re: Baseflight aka multiwii port to stm32

Post by DrEvil »

Crashpilot1000 wrote:Did you ever come across the idea to arm the fc like described in mwii wiki? If that doesn't work, sell the board or buy a radio that reaches the appropiate stick limits if you are not able to change them in cli or your TX. Arming hasn't changed for "several months" in any mwii "universe".



Are we trying to copy TC's way of replies in rude "honest" answers.. ?
My rx and tx is rhe same as i have used with these boards before, only thing
change is software/gui.
But thanks :-)

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Post by timecop »

Flying wing servo/motor assignment changed a bit, I just commited a patch to baseflight that *should* make motor + servos properly work, of course you'll need to build your own version to try it out. I think GUI now expects motor to be in servo[7], which is probably why you don't see it.

DrEvil
Posts: 17
Joined: Mon Sep 10, 2012 12:23 pm

Re: Baseflight aka multiwii port to stm32

Post by DrEvil »

timecop wrote:Flying wing servo/motor assignment changed a bit, I just commited a patch to baseflight that *should* make motor + servos properly work, of course you'll need to build your own version to try it out. I think GUI now expects motor to be in servo[7], which is probably why you don't see it.


Ok, thanks for the headsup.
I have no idea how to build my own version.
I had motor in servo 1 and 2, so thats an explenation :-)

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Post by timecop »

Yeah, that too.
afair in flying wing mode, throttle goes in motor1, then servos into motors 3/4.
you won't see throttle reply in GUI but you should be able to flyi t (with old version tahts up flor download)

User avatar
IceWind
Posts: 115
Joined: Fri Mar 25, 2011 2:11 am
Contact:

Re: Baseflight aka multiwii port to stm32

Post by IceWind »

Hey,

I'm testing the 3D feature with the baseflight code.
When I arm the board the motors start spinning and I can't make them stop no matter how much I try to align the throttle stick to the center.
I have the MOTOR_STOP enabled, not sure if that works with the 3D feature or not.

All my channels are within the mcfg.deadband3d_low = 1406 & mcfg.deadband3d_high = 1514 so it should not be detecting any input.
Any idea what I might be doing wrong? Or that is the expected behaviour.

One other thing I noticed is that when I send the save command in the CLI the motors will start spinning for a few seconds while the FC reboots.
(Probably no way to fix that.)

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Post by timecop »

Motor startup during reboot was fixed in latest svn about a week ago or so.
You will need to build it yourself to get that fix.
For other 3d stuff, stop by irc and talk to nicodh, since he wrote that patch and used it.

User avatar
IceWind
Posts: 115
Joined: Fri Mar 25, 2011 2:11 am
Contact:

Re: Baseflight aka multiwii port to stm32

Post by IceWind »

The code I'm using was compiled after running a svn update today.
Revision: 459

User avatar
IceWind
Posts: 115
Joined: Fri Mar 25, 2011 2:11 am
Contact:

Re: Baseflight aka multiwii port to stm32

Post by IceWind »

Did you guys just screw up the 3D feature code?
The previous issues are now fixed but the throttle range is all screwed up...

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Post by timecop »

Noone tests this stuff, what's broken?
Make sure you're using latest .hex from github - I finally fixed the dumb MSP_SET_MISC bug that would reset minthrottle to 1000 on each save yesterday.

User avatar
IceWind
Posts: 115
Joined: Fri Mar 25, 2011 2:11 am
Contact:

Re: Baseflight aka multiwii port to stm32

Post by IceWind »

The motors throttle range wasn't linear when the throttle stick position was <1406, it would jump straight to 1000.
(I ended up loading R428 from the SVN to get back the proper behaviour.)

I saw you moved the code to GIT (hurrayyyy) and I was trying the .hex there yesterday.
I can't quite compile it as I get linker errors about a missing symbol (_sbrk)

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Post by timecop »

Works here.
Stop using shitty toolchains.
Those are gcc problems anyway, I don't commit non-building code

User avatar
IceWind
Posts: 115
Joined: Fri Mar 25, 2011 2:11 am
Contact:

Re: Baseflight aka multiwii port to stm32

Post by IceWind »

I just loaded again the .hex in github and it's all messed up. When I arm the motors jump to 1000.
I made sure to reset to defaults and after enable the features 3D, MOTOR_STOP and PPM.

Get me a better toolchain for MacOSX and I'll use it. :)


nicog
Posts: 88
Joined: Tue Aug 21, 2012 2:21 pm

Re: Baseflight aka multiwii port to stm32

Post by nicog »

icewind, are you sure you want 3D enabled? Are you going to fly inverted? Are your esc flashed for that?

User avatar
IceWind
Posts: 115
Joined: Fri Mar 25, 2011 2:11 am
Contact:

Re: Baseflight aka multiwii port to stm32

Post by IceWind »

timecop wrote:https://launchpad.net/gcc-arm-embedded

Up to now I've been using these ones: http://www.carlson-minot.com/available- ... r-mac-os-x
I'll give that one a try.


nicog wrote:icewind, are you sure you want 3D enabled? Are you going to fly inverted? Are your esc flashed for that?


Yep, that is what want. :)
I already have all remaining gear ready (ESC's flashed and tested, 3D props,...) just finalising setting up the FC.

mifau
Posts: 13
Joined: Sat Nov 24, 2012 7:46 pm

Re: Baseflight aka multiwii port to stm32

Post by mifau »

Timecop is right.
In naze32 hardware thread I wrote a whole post about MacOSX developement.
Use suggested toolchain and should be fine.

User avatar
IceWind
Posts: 115
Joined: Fri Mar 25, 2011 2:11 am
Contact:

Re: Baseflight aka multiwii port to stm32

Post by IceWind »

Well I was using the other toolchain up to now without any problem.

Either way I tried the suggested one and it compile without error. Thanks TC!

Update: I think the FC is getting out of memory or stack or whatever...

For now I'm using the FreeFlight v1.2 and the newest version I can load is r436 from the SVN. After that I start having the weird behavior on the motors.
Checking the commits after that I see no change in code that can explain that behavior, so I must be hitting some limit on the FC.
(I have my Naze32 where I could load the same code to troubleshoot but is all set and I don't want to mess up the settings just to try this)

I started a "weight loss" program on the code to try and bring it down to a size similar to the ones I see working.
Waste of time? Probably Yes! But it's winter and I don't expect to have much free time to fly now. :)

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Baseflight aka multiwii port to stm32

Post by scrat »

One question. With baseflight dev_464 loaded to FC...can I use MWii Conf v2.3 from now on?

Thx.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Post by timecop »

Yes, I'm doing all tests with multiwiiconf 2.3 and it works fine.
Also consider using chrome baseflight configurator https://chrome.google.com/webstore/deta ... figk?hl=en

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Baseflight aka multiwii port to stm32

Post by scrat »

Have loaded baseflight dev 464 on rev5 board like it is written in Naze32 manual. Then using chrome baseflight conf...connected calibrated acc and mag. Then in CLI haveset some variables and looptime to 3000. Before I have set variables in cli, I was watching looptime and it was constantly moving around 3500. Then like I said set looptime to 3000 and then saved settings in cli...board reeboots...but then looptime is moving around 3000 like it is should but every 2 seconds looptime stops and starts again. This is the same like when I was using multiwii when I clicked Write in GUI...looptime was stopped for 1sec and then started. Is this a problem or bug?

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Post by timecop »

You enabled GPS (and didnt connect it)

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Baseflight aka multiwii port to stm32

Post by scrat »

timecop wrote:You enabled GPS (and didnt connect it)


You're right. I have powered FC with USB cable, so GPS can't work but it's connected.
Can I burn something if I connect flight battery and have USB cable connected at the same time?

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Post by timecop »

No.

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Baseflight aka multiwii port to stm32

Post by scrat »

timecop wrote:No.


Thank you! 8-)

Truglodite
Posts: 48
Joined: Sat Jun 22, 2013 2:37 am

Re: Baseflight aka multiwii port to stm32

Post by Truglodite »

Is power meter working in Baseflight?

I have my current sensor connected to rc input 2 (using cPPM) and have powermeter enabled in the Baseflight GUI. Following the notes in the code, I also set power_adc_channel = 1. I still only see zeroes under 'power sum' on Baseflight GUI. I was expecting to see some change after having my lipo plugged in and everything drawing through the sensor (including 0.5A worth of LEDs). Am I missing something?

Thanks in advance,
Kev

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Post by timecop »

Never been tested, powermeter is not something that belongs in FC, I think.
I cleared out ADC channel for some guy who wanted to get it working, but I don't think it does anything beyond that.
Feel free to submit a patch.

Truglodite
Posts: 48
Joined: Sat Jun 22, 2013 2:37 am

Re: Baseflight aka multiwii port to stm32

Post by Truglodite »

Thanks TC. I was mainly hoping I could use one of the 5 free rx pins on my FC, versus soldering another wire to the tiny Mega8 pins on my OSD board. I am not talented enough with coding to get data from that free ADC channel in to MWS, but I'll have a look and see if I can learn something new. More than likely I'll just add the wiring to my OSD, but that way it will be useless for failsafe routines. That makes me wonder...

Why do you feel powermeter doesn't belong on the FC? It seems the same could be said about Vbat.

frog32
Posts: 55
Joined: Sun Nov 20, 2011 9:39 pm

Re: Baseflight aka multiwii port to stm32

Post by frog32 »

that guy who used the adc with a current sensor was me. i hat reasonable results using it as a powermeter but i don't know if it is capable of alarming you because i use it with a max 7456 to display used power

Truglodite
Posts: 48
Joined: Sat Jun 22, 2013 2:37 am

Re: Baseflight aka multiwii port to stm32

Post by Truglodite »

frog32 I saw your posts earlier when you were developing powermeter for baseflight. Good to hear you got it working. Can you tell me how you set up the firmware to do this?

I just want current added to my MWS stream for use with KVOSD (minimOSD board). The reason is I recently replaced the uBEC on my mini-H with one of those 3dr style power modules (shunt+divider+uBEC all in one). The big solder pads on the power module double as a PDB (small rig = small wire), making the wiring job lighter and more compact than before. I was hoping just to get an added bonus out of the current shunt. I'll be very grateful if you can help me get it working... so will my local friends, who I bet will be picking my brain if I manage to get it working on my rig. ;)

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Post by timecop »

Yeah, if you have your current working code and want to open a patch on https://github.com/multiwii/baseflight go ahead - if ADC exists and works might as well merge the feature.
Also rev5 has another standalone ADC input on bottom, so that you don't lose any PWM pins for ADC channel. Currently no support for that at all, but if powermeter stuff makes it back in, I can makea it available.

JustasM
Posts: 11
Joined: Thu Oct 20, 2011 7:34 pm

Re: Baseflight aka multiwii port to stm32

Post by JustasM »

I was drawn away from all the copter stuff for a while...then i've noticed there was a "gps unfucking" kind of firmware of baseflight. Does it mean it is now functional (at least PH) ? Or..is it just a start of gps becoming functional?

Truglodite
Posts: 48
Joined: Sat Jun 22, 2013 2:37 am

Re: Baseflight aka multiwii port to stm32

Post by Truglodite »

From the experimenting I've done with Baseflight (mid summer mostly), PH it's OK. Harakiri firmware has the best PH I've seen in MWii-land.

felixrising
Posts: 244
Joined: Sat Mar 23, 2013 12:34 am
Location: Australia

Re: Baseflight aka multiwii port to stm32

Post by felixrising »

Confirming, Current baseflight does PH and RTL no problem... haven't really tried Harakiri.

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Baseflight aka multiwii port to stm32

Post by scrat »

felixrising wrote:Confirming, Current baseflight does PH and RTL no problem... haven't really tried Harakiri.


Do you mean the latest dev from github?

felixrising
Posts: 244
Joined: Sat Mar 23, 2013 12:34 am
Location: Australia

Re: Baseflight aka multiwii port to stm32

Post by felixrising »

yes. latest .hex from github, loaded with chrome app 'baseflight configurator'

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Baseflight aka multiwii port to stm32

Post by scrat »

Thank you very much! Can't wait to try this new FW.

User avatar
IceWind
Posts: 115
Joined: Fri Mar 25, 2011 2:11 am
Contact:

Re: Baseflight aka multiwii port to stm32

Post by IceWind »

TC on a side note and followign something I saw on a different thread and forum.
Maybe it's worth to add the code Revision in the cli status page. That way it would be easier to check what's the FW loaded in the board.
(last time I checked it only shows the cli version, not the code revision. If this is already there then ignore this)

theailer
Posts: 49
Joined: Tue Sep 24, 2013 9:06 pm

Post by theailer »

It let's you know the date it was compiled which makes it pretty easy to check the revision

rortega
Posts: 34
Joined: Sat Aug 11, 2012 7:34 pm

Re: Baseflight aka multiwii port to stm32

Post by rortega »

scrat wrote:
felixrising wrote:Confirming, Current baseflight does PH and RTL no problem... haven't really tried Harakiri.


Do you mean the latest dev from github?


Have any of you compared Baseflight GPS Hold behavior against Harakiri 10 (SG 2.6) on rev5. Today I have had a bad experience testing GPS Hold with Harakiri in a windy day (no more than 20 km/h). But some days before, without wind It worked perfect.

How does Baseflight works with wind? Is it able to perform RTL with autolanding?

The reason I have moved to Harakiri is that I can't set up Baseflight to get a good Altitude Hold. Could any of you share your Baseflight settings?

Thanks.

Post Reply