Is there a way to get SmartAudio working?

Yes, worked like a charm with a TBS Unify pro32!
So I wasted all this time on the Atlatl HV piece of crap, from now on only TBS equipment :slight_smile:

Thanks fro bringing this in Ardupilot!

Hi,

I tried using SmartAudio with the latest 4.1-dev binary from April 16th (Copter/latest/MatekH743-bdshot, git-version 323cbe47d2c4f49f796f88e07e8f612a50ef8cb4).

I configured it, it seems to work partially. I’m able to set channel, power etc., but I’m not able to arm. I’m using a AKK X2 Ultimate 1200mW.

Errors while arming:

17.04.2021 14:36:43 : PreArm: Internal errors 0x800000 l:57 stack_ovrflw
17.04.2021 14:36:29 : PreArm: Internal errors 0x800000 l:57 stack_ovrflw
17.04.2021 14:36:25 : PreArm: Internal errors 0x800000 l:57 stack_ovrflw

On Discord I was told it should be fixed in the latest Master, but that’s what I’m using.

What is needed to fix this?

Thanks,
Sebastian

Please can you post your parameters and I will see if I can reproduce

Also please start a new thread in the 4.1 channel

Hi,

while trying to create a new thread: “You’ve reached the maximum number of topics a new user can create on their first day. Please wait 12 hours before trying again.” :frowning:

When the VTX is not connected, it arms.

Config is here: https://pastebin.com/A39Jrs9F

Does it make sense to connect the RX pin of a serial adapter to the SmartAudio pin and try to dump the communication? Not sure if that will work with halfduplex connections?

Sebastian

So when this happens please connect using mavproxy and run
ftp get @SYS/threads.txt -
and send me the output

APM: PreArm: Internal errors 0x800000 l:57 stack_ovrflw

STABILIZE>
STABILIZE> ftp get @SYS/threads.txt -
STABILIZE> Getting @SYS/threads.txt as -
ThreadsV2
ISR           PRI=255 sp=0x20000000 STACK=1208/1536
ArduCopter    PRI=182 sp=0x20000600 STACK=5352/7168
idle          PRI=  1 sp=0x20017288 STACK=144/352
UART_RX       PRI= 60 sp=0x2001D888 STACK=864/1104
OTG1          PRI= 60 sp=0x2001C9A8 STACK=400/656
monitor       PRI=183 sp=0x20012FA0 STACK=472/848
timer         PRI=181 sp=0x200141C0 STACK=1456/1872
rcout         PRI=181 sp=0x200138B0 STACK=480/848
rcin          PRI=177 sp=0x20013328 STACK=640/1360
io            PRI= 58 sp=0x20012618 STACK=1440/2384
storage       PRI= 59 sp=0x20013C38 STACK=872/1360
UART7         PRI= 60 sp=0x2001C508 STACK=256/656
UART1         PRI= 60 sp=0x2001B0F8 STACK=264/656
UART2         PRI= 60 sp=0x30000410 STACK=384/656
UART3         PRI= 60 sp=0x30000EF0 STACK=384/656
UART8         PRI= 60 sp=0x300019D0 STACK=280/656
UART4         PRI= 60 sp=0x300024B0 STACK=296/656
OTG2          PRI= 60 sp=0x30003390 STACK=400/656
UART6         PRI= 60 sp=0x30007B50 STACK=256/656
uavcan_0      PRI=178 sp=0x3000F858 STACK=2504/4432
I2C0          PRI=176 sp=0x30010C68 STACK=824/1360
OSD           PRI= 59 sp=0x30011F50 STACK=672/1360
log_io        PRI= 59 sp=0x30012630 STACK=1048/1656
SPI4          PRI=181 sp=0x300162C8 STACK=560/1360
SPI1          PRI=181 sp=0x30016888 STACK=560/1360
SmartAudio    PRI= 57 sp=0x30016FB8 STACK=24/848
FTP           PRI= 58 sp=0x3001C168 STACK=1736/2896

Sebastian

So this is the problem. Is it like this from startup or is there something you do that drops the stack this low? Try getting the trace at various points after startup.

Also what VTX do you have?

It’s a AKK X2 Ultimate.

Here is the output from start to error, executing your command several times in between:

no link
APM: ESC: BLHeli installed on port 0
APM: ESC: ESC: 6 motors mask=0x003F
link 1 OK
heartbeat OK

STABILIZE> APM: Calibrating barometer
ftp get @SYS/threads.txt -
STABILIZE> Getting @SYS/threads.txt as -
ThreadsV2
ISR           PRI=255 sp=0x20000000 STACK=1280/1536
main          PRI= 10 sp=0x20000600 STACK=5352/7168
idle          PRI=  1 sp=0x20017288 STACK=144/352
UART_RX       PRI= 60 sp=0x2001D888 STACK=864/1104
OTG1          PRI= 60 sp=0x2001C9A8 STACK=400/656
monitor       PRI=183 sp=0x20012FA0 STACK=472/848
timer         PRI=181 sp=0x200141C0 STACK=1496/1872
rcout         PRI=181 sp=0x200138B0 STACK=624/848
rcin          PRI=177 sp=0x20013328 STACK=552/1360
io            PRI= 58 sp=0x20012618 STACK=1440/2384
storage       PRI= 59 sp=0x20013C38 STACK=904/1360
UART7         PRI= 60 sp=0x2001C508 STACK=360/656
UART1         PRI= 60 sp=0x2001B0F8 STACK=336/656
UART2         PRI= 60 sp=0x30000410 STACK=384/656
UART3         PRI= 60 sp=0x30000EF0 STACK=384/656
UART8         PRI= 60 sp=0x300019D0 STACK=320/656
UART4         PRI= 60 sp=0x300024B0 STACK=296/656
OTG2          PRI= 60 sp=0x30003390 STACK=400/656
UART6         PRI= 60 sp=0x30008160 STACK=296/656
uavcan_0      PRI=178 sp=0x3000F858 STACK=3320/4432
I2C0          PRI=176 sp=0x30010C68 STACK=956/1360
OSD           PRI= 59 sp=0x30011F50 STACK=776/1360
log_io        PRI= 59 sp=0x30012630 STACK=1304/1656
FTP           PRI= 58 sp=0x300185B0 STACK=1736/2896

APM: Barometer 1 calibration complete
APM: Barometer 2 calibration complete

STABILIZE> APM: ArduPilot Ready
APM: AHRS: DCM active
APM: GPS 1: specified as UAVCAN1-113
Time has wrapped
Time has wrapped 8657 296664
APM: VTX: Freq: 5825MHz, Power: 800mw, Band: 1, Chan: 3
APM: MotorEStop LOW
APM: CameraTrigger LOW
APM: Relay1 HIGH
APM: Relay2 HIGH
APM: EKF3 IMU0 buffs IMU=17 OBS=7 OF=16 EN:16 dt=0.0120
APM: EKF3 IMU1 buffs IMU=17 OBS=7 OF=16 EN:16 dt=0.0120

STABILIZE> APM: EKF3 IMU0 initialised
APM: EKF3 IMU1 initialised
APM: AHRS: EKF3 active
ftp get @SYS/threads.txt -
STABILIZE> Getting @SYS/threads.txt as -
ThreadsV2
ISR           PRI=255 sp=0x20000000 STACK=1208/1536
ArduCopter    PRI=182 sp=0x20000600 STACK=5352/7168
idle          PRI=  1 sp=0x20017288 STACK=144/352
UART_RX       PRI= 60 sp=0x2001D888 STACK=864/1104
OTG1          PRI= 60 sp=0x2001C9A8 STACK=400/656
monitor       PRI=183 sp=0x20012FA0 STACK=472/848
timer         PRI=181 sp=0x200141C0 STACK=1456/1872
rcout         PRI=181 sp=0x200138B0 STACK=480/848
rcin          PRI=177 sp=0x20013328 STACK=552/1360
io            PRI= 58 sp=0x20012618 STACK=1440/2384
storage       PRI= 59 sp=0x20013C38 STACK=856/1360
UART7         PRI= 60 sp=0x2001C508 STACK=272/656
UART1         PRI= 60 sp=0x2001B0F8 STACK=272/656
UART2         PRI= 60 sp=0x30000410 STACK=384/656
UART3         PRI= 60 sp=0x30000EF0 STACK=384/656
UART8         PRI= 60 sp=0x300019D0 STACK=312/656
UART4         PRI= 60 sp=0x300024B0 STACK=296/656
OTG2          PRI= 60 sp=0x30003390 STACK=400/656
UART6         PRI= 60 sp=0x30008160 STACK=256/656
uavcan_0      PRI=178 sp=0x3000F858 STACK=3008/4432
I2C0          PRI=176 sp=0x30010C68 STACK=872/1360
OSD           PRI= 59 sp=0x30011F50 STACK=720/1360
log_io        PRI= 59 sp=0x30012630 STACK=1304/1656
FTP           PRI= 58 sp=0x300185B0 STACK=1712/2896
SPI4          PRI=181 sp=0x3001A238 STACK=584/1360
SPI1          PRI=181 sp=0x3001A7F8 STACK=560/1360
SmartAudio    PRI= 57 sp=0x3001AF28 STACK=24/848

APM: EKF3 IMU1 tilt alignment complete
APM: EKF3 IMU0 tilt alignment complete
APM: EKF3 IMU1 initial yaw alignment complete
APM: EKF3 IMU0 initial yaw alignment complete

STABILIZE> ftp get @SYS/threads.txt -
STABILIZE> Getting @SYS/threads.txt as -
ThreadsV2
ISR           PRI=255 sp=0x20000000 STACK=1208/1536
ArduCopter    PRI=182 sp=0x20000600 STACK=5352/7168
idle          PRI=  1 sp=0x20017288 STACK=144/352
UART_RX       PRI= 60 sp=0x2001D888 STACK=864/1104
OTG1          PRI= 60 sp=0x2001C9A8 STACK=400/656
monitor       PRI=183 sp=0x20012FA0 STACK=472/848
timer         PRI=181 sp=0x200141C0 STACK=1456/1872
rcout         PRI=181 sp=0x200138B0 STACK=480/848
rcin          PRI=177 sp=0x20013328 STACK=552/1360
io            PRI= 58 sp=0x20012618 STACK=1440/2384
storage       PRI= 59 sp=0x20013C38 STACK=856/1360
UART7         PRI= 60 sp=0x2001C508 STACK=272/656
UART1         PRI= 60 sp=0x2001B0F8 STACK=272/656
UART2         PRI= 60 sp=0x30000410 STACK=384/656
UART3         PRI= 60 sp=0x30000EF0 STACK=384/656
UART8         PRI= 60 sp=0x300019D0 STACK=312/656
UART4         PRI= 60 sp=0x300024B0 STACK=296/656
OTG2          PRI= 60 sp=0x30003390 STACK=400/656
UART6         PRI= 60 sp=0x30008160 STACK=256/656
uavcan_0      PRI=178 sp=0x3000F858 STACK=3008/4432
I2C0          PRI=176 sp=0x30010C68 STACK=848/1360
OSD           PRI= 59 sp=0x30011F50 STACK=720/1360
log_io        PRI= 59 sp=0x30012630 STACK=1304/1656
FTP           PRI= 58 sp=0x300185B0 STACK=1712/2896
SPI4          PRI=181 sp=0x3001A238 STACK=560/1360
SPI1          PRI=181 sp=0x3001A7F8 STACK=560/1360
SmartAudio    PRI= 57 sp=0x3001AF28 STACK=24/848

ftp get @SYS/threads.txt -
STABILIZE> Getting @SYS/threads.txt as -
ThreadsV2
ISR           PRI=255 sp=0x20000000 STACK=1208/1536
ArduCopter    PRI=182 sp=0x20000600 STACK=5352/7168
idle          PRI=  1 sp=0x20017288 STACK=144/352
UART_RX       PRI= 60 sp=0x2001D888 STACK=864/1104
OTG1          PRI= 60 sp=0x2001C9A8 STACK=400/656
monitor       PRI=183 sp=0x20012FA0 STACK=472/848
timer         PRI=181 sp=0x200141C0 STACK=1456/1872
rcout         PRI=181 sp=0x200138B0 STACK=480/848
rcin          PRI=177 sp=0x20013328 STACK=552/1360
io            PRI= 58 sp=0x20012618 STACK=1440/2384
storage       PRI= 59 sp=0x20013C38 STACK=856/1360
UART7         PRI= 60 sp=0x2001C508 STACK=272/656
UART1         PRI= 60 sp=0x2001B0F8 STACK=272/656
UART2         PRI= 60 sp=0x30000410 STACK=384/656
UART3         PRI= 60 sp=0x30000EF0 STACK=384/656
UART8         PRI= 60 sp=0x300019D0 STACK=312/656
UART4         PRI= 60 sp=0x300024B0 STACK=296/656
OTG2          PRI= 60 sp=0x30003390 STACK=400/656
UART6         PRI= 60 sp=0x30008160 STACK=256/656
uavcan_0      PRI=178 sp=0x3000F858 STACK=3008/4432
I2C0          PRI=176 sp=0x30010C68 STACK=848/1360
OSD           PRI= 59 sp=0x30011F50 STACK=672/1360
log_io        PRI= 59 sp=0x30012630 STACK=1304/1656
FTP           PRI= 58 sp=0x300185B0 STACK=1712/2896
SPI4          PRI=181 sp=0x3001A238 STACK=560/1360
SPI1          PRI=181 sp=0x3001A7F8 STACK=560/1360
SmartAudio    PRI= 57 sp=0x3001AF28 STACK=24/848

DAPM: PreArm: Internal errors 0x800000 l:57 stack_ovrflw

Do you know what version of SmartAudio it supports?

Sorry, I don’t know…

But well, it’s mostly working. I can configure the channel, band and power, and I can see that it sets these values on the VTX.

I just can’t arm.

Ah, another thing I tried:

When starting without the VTX being connected, I can arm.

When starting with it, then receiving the error while arming, then disconnecting the VTX, I still am not able to arm. Maybe you’re storing some invalid infomation, can you maybe add some debug to dump your internally stored information?

What flight controller are you using? Copter or Plane?

Copter

some more characters to be able to send this post…

Try this one: https://www.dropbox.com/s/927h7pi5x2mkhn6/arducopter.apj?dl=0

Hey,

now it’s working :slight_smile: What was it?

One minor thing, the displayed power levels are wrong, as my VTX supports “25mW / 200mW / 600mW / 1200mW”, but the values of Smart Audio in ArduPilot are hardcoded…

Thanks!
Sebastian

Can you get the stack data for the working version?

Supporting power levels more flexibly requires a decent amount more work that I don’t currently have time for.

Sure:

SmartAudio PRI= 57 sp=0x300180F8 STACK=280/1104

Thx, I just increased the stack size but wanted to make sure there wasn’t some unconstrained growth

2 Likes

For anyone who is still interested on how to get the Atlatl VTX to work with Smartaudio in Ardupilot:

Finally I figured it out after 2 years, when using a Atlatl HV from Holybro set VTX_OPTIONS=112 than it’s working.