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

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

Open
1 task done
Kevltan opened this issue Feb 12, 2025 · 45 comments
Open
1 task done
Labels
bug 🪲 Something isn't working triage Bug report awaiting review / sorting

Comments

@Kevltan
Copy link

Kevltan commented Feb 12, 2025

Is there an existing issue for this problem?

  • 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 Kevltan added bug 🪲 Something isn't working triage Bug report awaiting review / sorting labels Feb 12, 2025
@Kevltan Kevltan changed the title Whilst powered on and inserting USB lead connected to pc radio powers off every time 2.11.0 RC Whilst powered on and inserting USB lead connected to pc, radio powers off every time 2.11.0 RC Feb 12, 2025
@Kevltan
Copy link
Author

Kevltan commented Feb 12, 2025

@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.

@3djc
Copy link
Collaborator

3djc commented Feb 12, 2025

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

@Kevltan
Copy link
Author

Kevltan commented Feb 12, 2025

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.

@3djc
Copy link
Collaborator

3djc commented Feb 12, 2025

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

@Kevltan
Copy link
Author

Kevltan commented Feb 12, 2025

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!

@koaxheli
Copy link

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.

@Kevltan
Copy link
Author

Kevltan commented Feb 12, 2025

This issue has been kreeping 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.

@philmoz
Copy link
Collaborator

philmoz commented Feb 12, 2025

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).

@Kevltan
Copy link
Author

Kevltan commented Feb 12, 2025 via email

@Kevltan
Copy link
Author

Kevltan commented Feb 12, 2025 via email

@philmoz
Copy link
Collaborator

philmoz commented Feb 12, 2025

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.

@Kevltan
Copy link
Author

Kevltan commented Feb 12, 2025

OK will do

@Kevltan
Copy link
Author

Kevltan commented Feb 12, 2025

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

@philmoz
Copy link
Collaborator

philmoz commented Feb 12, 2025

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

Crashes when USB mode is set to Joystick?

@philmoz
Copy link
Collaborator

philmoz commented Feb 12, 2025

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

@Kevltan
Copy link
Author

Kevltan commented Feb 12, 2025

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.

@philmoz
Copy link
Collaborator

philmoz commented Feb 13, 2025

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.

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

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👌

@philmoz
Copy link
Collaborator

philmoz commented Feb 13, 2025

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.

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

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
Copy link
Author

Kevltan commented Feb 13, 2025

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!!!

@philmoz
Copy link
Collaborator

philmoz commented Feb 13, 2025

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

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

@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.

@philmoz
Copy link
Collaborator

philmoz commented Feb 13, 2025

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

Image

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

@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.

@philmoz
Copy link
Collaborator

philmoz commented Feb 13, 2025

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.

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

@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
Copy link
Author

Kevltan commented Feb 13, 2025

@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!

@J-Sorenson
Copy link

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.

@Salto42
Copy link

Salto42 commented Feb 13, 2025

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

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

Tried this one as above a35246b exactly the same instant off when usb lead plugged into pc.

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

@philmoz
This is a good one from my selfbuild archive (5281b8b) and have it written down as "no conflicts". It's on my radio now and my usb connection works fine 👌I had an IMU module in my radio then and have since removed it thinking it was causing the usb conflict problems in my later 2.11.0 nightlies - but maybe not!!

Going back to another issue I highlighted a couple of days ago the 2.11.0 RC1 scrolling betwen main views is not as smooth as in 2.10.6. and the above 2.11.0 self build nightly is the same in this respect - so it looks like this may have been indroduced as well into 2.11.0.

@koaxheli
Copy link

Hello, I have tested the last 3 versions with the result that the version from 17.12.24 was OK.
The version 22.12.24 is OK once and also crashed on a new attempt.
The last version from 12.2.25 always crashes after vPC connection.
Here are the compiled versions:
BOOT10edgetx-tx16s-2.11.0-selfbuild (12e84b5) still OK from 17.12.2024
BOOT10edgetx-tx16s-2.11.0-selfbuild (2b920a0) crash from 22.12.2024
BOOT10edgetx-tx16s-2.11.0-selfbuild (46089fe) crashed on 12.02.2025 RC1

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

Have tried (12e84b5) still crashes imediately when usb lead inserted on mine. This is very strange that some peoples do and some peoples don't!!!

What the hell is the difference in these radios!?

@philmoz
Copy link
Collaborator

philmoz commented Feb 13, 2025

Hello, I have tested the last 3 versions with the result that the version from 17.12.24 was OK. The version 22.12.24 is OK once and also crashed on a new attempt. The last version from 12.2.25 always crashes after vPC connection. Here are the compiled versions: BOOT10edgetx-tx16s-2.11.0-selfbuild (12e84b5) still OK from 17.12.2024 BOOT10edgetx-tx16s-2.11.0-selfbuild (2b920a0) crash from 22.12.2024 BOOT10edgetx-tx16s-2.11.0-selfbuild (46089fe) crashed on 12.02.2025 RC1

There is nothing changed between 17.12.2024 and 22.12.2024 that would affect USB.
This is sounding more like a hardware issue with the radio.

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

@philmoz
How can this be a hardware problem. When 2.10.6 works perfectly fine and so does (5281b8b) which is an early 2.11.0 nightly?

@philmoz
Copy link
Collaborator

philmoz commented Feb 13, 2025

How can this be a hardware problem. When 2.10.6 works perfectly fine and so does

Bad RAM or bad FLASH memory.
The difference between the builds will be the memory map of where functions lie in the FLASH memory or which areas of RAM are being used.

@3djc
Copy link
Collaborator

3djc commented Feb 13, 2025

That could explain the variations in testing results

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

Why would this only effect the usb and nothing else????
Surely the chip memory mapping would change with each erase when loading new firmwares and boot loaders which would effect other parts of the programme??

Would I be right in saying STM32CUBE verifies when writing to the flash and RAM?

Is it possible to erase the chip completely on STM32CUBE or is this not a good idea as this will erase bootloader too?

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

@philmoz
This could be true as I have noticed that the early version of the 2.11.0 that the usb works on has a smaller memory footprint than the later 2.11.0's and 2.11.0 RC1.

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

@philmoz
I have looked at file sizes, and 2.10.6 is bigger than 2.11.0 RC1 as regards memory footprint but not sure how that equates as regards resources and memory usage by comparison.

@pfeerick
Copy link
Member

Is it possible to erase the chip completely on STM32CUBE or is this not a good idea as this will erase bootloader too. Why would this only effect the usb and nothing else????

Depends on what you mean by "bootloader". If you mean bootloader as it is described by EdgeTX, then yes it will be erased, and will be written back when you write the firmware back (via STM32Cube /DFU).

The DFU "bootloader" is in ROM, and CANNOT be erased. This is why these radios are generally referred to as unbeickable, as you can always use DFU to reflash firmware (except for hardware failure, naturally).

Doesn't the STM32CUBE verify when writing to the flash and RAM.

There is a specific verify option you can enable / tick where you configure firmware writing.

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

@pfeerick
@philmoz
I have checked on STM32CUBE and it has verified that firmware on the chip is the same that is in the firmware file (no corruption). It says there are no differences in the files. There appears to be no bad flash on chip.

On investigation it appears that the processors FLASH and RAM are the same but allocated by "pins" by the manufacturer !?

@Kevltan
Copy link
Author

Kevltan commented Feb 13, 2025

@pfeerick
@philmoz
Have done full chip erase in STM32CUBE and reloaded 2.11.0 RC1 - no change.

Can confirm above what Peter says radio is unbricked doing this and both firmware and bootloader are replaced.

@Kevltan
Copy link
Author

Kevltan commented Feb 20, 2025

Any update (its gone quiete) of a possible resolution for this issue devs ?🤔

I believe that once a few more people take the plunge and start updating to 2.11.0 that there are going to be few more instances of this problem arrising!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working triage Bug report awaiting review / sorting
Projects
None yet
Development

No branches or pull requests

7 participants