edgetx icon indicating copy to clipboard operation
edgetx copied to clipboard

Whilst powered on and inserting USB lead connected to pc, radio powers off every time 2.11.0 RC

Open Kevltan opened this issue 10 months ago • 172 comments

Is there an existing issue for this problem?

  • [x] I have searched the existing issues

What part of EdgeTX is the focus of this bug?

Transmitter firmware

Current Behavior

Radio powers off when inserting usb lead connected to PC every time in 2.11.0 RC - TX16S mk1. Works fine in 2.10.6.

Expected Behavior

Expect to enter into usb mode and not power off.

Steps To Reproduce

As above

Version

2.11.0-rc

Transmitter

RadioMaster TX16S / TX16SMK2

Operating System (OS)

No response

OS Version

No response

Anything else?

No response

Kevltan avatar Feb 12 '25 07:02 Kevltan

@philmoz I have loaded a basic SD card for 2.10.6 no extra files added and as soon as the usb lead inserted the radio crashes to off. So it doesnt seem to be related to SD card content.

Kevltan avatar Feb 12 '25 14:02 Kevltan

Cannot reproduce, the the USB choice menu pops like it should here. Tested on both MK1 and MK2

3djc avatar Feb 12 '25 15:02 3djc

What can possibly be the issue here then? The usb connection works on 2.10.6 does not work on 2.11.0 rc. New SD card basic 2.10.6 loaded on no additions whatsoever on it, start radio, says there a files missing as expected then goes into stick calibration as expected put usb cable in to top of radio and instantly powers down every single time. Could there be something residual left in rom when loading firmware? Is worth doing a chip erase in STM32CUBE. I am lost for ideas here.

Kevltan avatar Feb 12 '25 16:02 Kevltan

Do you have a default usb mode set, or should it prompt ?

3djc avatar Feb 12 '25 16:02 3djc

Usually I have default usb mode set. But this is not the case with the last try as there was nothing set on a fresh SD card with no additions in 2.10.6 software on it, no models sound files radio data etc. I just plugged usb into the top and the radio just powered off into to sort of boot mode with the left hand led of six on. Screen blank and off, with a sharp click from the speaker as it powers off. 2.11.0 rc seems to be fine but just will not except a usb connection to any of my PC's!

Kevltan avatar Feb 12 '25 16:02 Kevltan

Hello, I have the same error now that I have the new v2.11.0-RC1 on the transmitter. When I connect the transmitter with USB cable to the PC and with USB memory (SD), the transmitter switches off and the connection is interrupted.

koaxheli avatar Feb 12 '25 17:02 koaxheli

This issue has been creeping up for ages but no one has seemed to be able to replicate it when I have created the issue request. I have already had problems with this in the past and raised the issue in the 2.11.0 nightlies. It is much more pronounced now than it was and is instantaneous in the latest 2.11.0 RC. Because I had the problem in the nightlies for safety reasons I decided to revert back to the 2.10's firmwares which seem relatively stable in this respect.

Kevltan avatar Feb 12 '25 18:02 Kevltan

Are you able to build the firmware yourself? If so can you try using the source from PR #5902 and commenting out line 488 in radio/src/main.cpp (call to handleUsbConnection).

philmoz avatar Feb 12 '25 21:02 philmoz

Yes will have ago.

On Wed, 12 Feb 2025, 21:25 philmoz, @.***> wrote:

Are you able to build the firmware yourself? If so can you try using the source from PR #5902 https://github.com/EdgeTX/edgetx/pull/5902 and commenting out line 488 in radio/src/main.cpp (call to handleUsbConnection).

— Reply to this email directly, view it on GitHub https://github.com/EdgeTX/edgetx/issues/5899#issuecomment-2654876722, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANPFAWZI5KSJXHVTNSDDQU32PO33XAVCNFSM6AAAAABW63NDZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJUHA3TMNZSGI . You are receiving this because you authored the thread.Message ID: @.***>

Kevltan avatar Feb 12 '25 21:02 Kevltan

@philmoz Have built this and this removes the usb capabilities completely - there is now no option for usb and a little black usb logo (next to volume indicator) appears in the top right of the screen and a drive is no longer created in windows when plugged in! VERS: 3.0.0-selfbuild (ad2c6dec) Can you clarify that I have the correct firmware build please?

On Wed, 12 Feb 2025, 21:38 Kev the Rev, @.***> wrote:

Yes will have ago.

On Wed, 12 Feb 2025, 21:25 philmoz, @.***> wrote:

Are you able to build the firmware yourself? If so can you try using the source from PR #5902 https://github.com/EdgeTX/edgetx/pull/5902 and commenting out line 488 in radio/src/main.cpp (call to handleUsbConnection).

— Reply to this email directly, view it on GitHub https://github.com/EdgeTX/edgetx/issues/5899#issuecomment-2654876722, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANPFAWZI5KSJXHVTNSDDQU32PO33XAVCNFSM6AAAAABW63NDZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJUHA3TMNZSGI . You are receiving this because you authored the thread.Message ID: @.***>

Kevltan avatar Feb 12 '25 22:02 Kevltan

That's the correct version, and what I would expect to happen.

If you put line 488 back does it now crash when plugging in the USB?

If it crashes can you change the USB mode to joystick (Radio Setup) instead and see what happens please.

Just trying to narrow down where it i crashing.

philmoz avatar Feb 12 '25 22:02 philmoz

OK will do

Kevltan avatar Feb 12 '25 22:02 Kevltan

Unedited 3.0.0 firmware the same..... USB: crashes! Joystick: crashes! Serial: doesn't crash

Kevltan avatar Feb 12 '25 23:02 Kevltan

Unedited 3.0.0 firmware the same..... crashes!

Crashes when USB mode is set to Joystick?

philmoz avatar Feb 12 '25 23:02 philmoz

What about 'Storage' and 'Ask' modes for USB?

philmoz avatar Feb 12 '25 23:02 philmoz

Doesn't crash in ask mode until either storage or joystick is selected from this. Crashes immediately if any one of these 2 modes is already selected/active and if lead is inserted or already inserted when Tx is powered up.

Kevltan avatar Feb 12 '25 23:02 Kevltan

You should not be able to power on the radio if the USB lead is plugged in. It should go into DFU mode if you plug in the USB cable when turned off.

Did you flash both bootloader and firmware?

It would be helpful if you could narrow down at what commit the problem started happening; but this can be a very tedious process.

philmoz avatar Feb 13 '25 01:02 philmoz

Yes meant inserting the lead after it is has started to power on.

Yes it drops into dfu mode when you insert the lead when in usb mode running 2.11.0

Yes I have tried both 2.10.6 bootloader and 2.11.0 bootloader and directly from STM32CUBE from the PC - same results. Can any data be left on the internal flash/rom in the chip that could be affecting this? Or is this some sort of firmware glitch or conflict?

I have NO internal modifications in this radio either i.e. IMU etc. It is as standard as regards electronics.

Dfu mode works no problem using STM32CUBE which says to me there has got to be a firmware conflict with this radio somewhere👌

Kevltan avatar Feb 13 '25 01:02 Kevltan

It's not easily reproducible which makes things harder.

You said the problem is not there in 2.10 - have you reverted and retested to be sure?

If 2.10 works then some change in the code is not behaving on your camera - if we can isolate which commit it started happening in that might help identify the cause.

philmoz avatar Feb 13 '25 02:02 philmoz

Absolutely, it does not happen in 2.10.6 it is instant on 2.11.0 and reproducable every time. I have put minimum software on the SD card as well and still does it when 2.11.0 firmware loaded. It's definately firmware related I think.

Kevltan avatar Feb 13 '25 03:02 Kevltan

If radio works in dfu mode (with usb lead) surely it should work in usb mode unless there is problem with the coding for the TX16S MK1 as it would appear I am not the only one with this problem. Question is what has my radio and his radio got in common🤔 Roll on the Radiomaster Flagship!!!

Kevltan avatar Feb 13 '25 03:02 Kevltan

What about in the bootloader - can you connect the USB and see the SD card mounted on your PC?

philmoz avatar Feb 13 '25 03:02 philmoz

@philmoz

Yes it connects in bootloader mode - in device manager comes up as a universal serial bus device - STM32 bootloader.

I am able to upload firmware to the radio using STMcubeprogramer succesfully.

But as expected in this mode there is no disk drive created on the pc.

Kevltan avatar Feb 13 '25 10:02 Kevltan

That sounds like DFU not bootloader. Do you see the bootloader screen?

Image

philmoz avatar Feb 13 '25 10:02 philmoz

@philmoz

You learn new things every day 😂!

Yes connects successfully in bootloader mode and creates an editable drive on the pc.

Reads "USB Connected" on the radio display.

Kevltan avatar Feb 13 '25 10:02 Kevltan

At this point all we can do is try and identify where in all the 2.11 changes the problem starts. The only way to do that is to work through the 2.11 commits in Git; building and testing. The most efficient way is pick a point halfway between latest commit to 2.11 and the first one (28th February 2024). If it works then move forward to a later commit, otherwise move backwards.

philmoz avatar Feb 13 '25 11:02 philmoz

@philmoz I have noticed this problem has been creeping in for ages even in 2.9.x originally but it sort of ~ went away. I created an issue for it but it didn't seem to get addressed I got "I can't reproduce on my radio". In that instance it would indescrimately power off when in USB mode, could be as soon as you plugged in or in about 10 minutes whilst you were downloading files to the card. But it seems completely stable in the latest 2.10.6 firmware. So something has changed in 2.11.0 which has exasperated the issue again and reared its ugly head. The difference now is the usb storage/joystick is fully broken using 2.11.0 rc firmware - on my radio, anyway.

Kevltan avatar Feb 13 '25 11:02 Kevltan

@philmoz Could be a long and laborious task. But if you can send me some commits I could try these but as I said when I was testing 2.11 before it was so inconsistent sometimes it would power off sometimes it wouldn't. It will be so hard to find because it is so intermittent in the earlier versions - you thought it was fixed and then bang I had to resort to taking the card out and putting it in a reader to edit. But if I had known about the the bootloader option for mass storage I probably would have used that instead!

I know you wouldn't do it in flight but what worries me Phil is by connecting a usb lead you can effectively power the radio off, and that a conflict resides somewhere in the firmware to do this!

Kevltan avatar Feb 13 '25 12:02 Kevltan

Are you familiar with the nightlies? It sounds like you might need to try some of the older 2.11 nightlies to see if you can fine one that still works. That will let the devs know which of the new commits broke the feature for your hardware.

J-Sorenson avatar Feb 13 '25 16:02 J-Sorenson

I have exactly the same problem with the same radio and for me the latest nightlie that works correctly is "2.11.0-selfbuilt (a35246b5) from 2024-09-03 but I haven't tried them all.

Salto42 avatar Feb 13 '25 16:02 Salto42