deviation-devo10-v4.0.1-265430d USB wont turn off

More
08 Feb 2016 16:13 #42779 by aperseghin
Once you activate USB drive from inside the booted firmware, you cant turn USB off (or exit that screen) its just stuck.

Please Log in or Create an account to join the conversation.

More
08 Feb 2016 16:17 - 08 Feb 2016 16:17 #42780 by vlad_vy
Devo8s = the same problem.
Last edit: 08 Feb 2016 16:17 by vlad_vy.

Please Log in or Create an account to join the conversation.

More
08 Feb 2016 16:20 #42781 by aperseghin
Replied by aperseghin on topic deviation-devo10-v4.0.1-265430d USB wont turn off
Same nightly? so deviation-emu_devo8-v4.0.1-265430d?

Please Log in or Create an account to join the conversation.

More
08 Feb 2016 16:23 #42782 by Sero
Same behavior on a 6s. I haven't noticed, because I start my TX to USB the old fashioned way :whistle:

A day without flying can't be called a day.

Please Log in or Create an account to join the conversation.

More
08 Feb 2016 18:23 #42790 by Serg_S
The problem began with the nightly build ef0d76d from 07.26.2015.
In this build honored PhracturedBlue make changes related to USB in src/misc.c module.
Present USB behavior is consequet to these changes.
I've checked: if DFU is compiled using an old version of misc.c (before commit ef0d76d), the USB will be turned OFF.
So we must ask the forum's gurus to replace misc.c in bitbucket.org/deviationtx/ repository with the old version of misc.c.

PS
I have DEVO 10.

Please Log in or Create an account to join the conversation.

More
08 Feb 2016 18:24 #42791 by Deal57
This was reported as an issue last fall (that Bug Tracker can be interesting reading!). There wasn't any resolution, and arguably it is a minor issue, as you can simply cycle power. It's certainly a bit of a time saving to start USB mode from a menu rather than from cold start, but since this isn't a flying activity I'm not sure of any real benefit.

For developers: is it possible someone could use the menu to start the USB, then edit a file that deviation has already loaded, causing some potential conflict? IF that's the case, I suggest we remove the menu item, as the current behavior seems confusing. Given the code size for the Devo7e, does that save us any more space?

Deviation Devo7e 3way switch mod, A7105, NRF24L01
Devo6s 2x2 switch mod, trim mod, haptic, multimodule, A7105, NRF24L01, CC2500
Devo12e 4-in-1 with voice mod -- it speaks!!

Please Log in or Create an account to join the conversation.

More
08 Feb 2016 18:35 #42792 by aperseghin
Replied by aperseghin on topic deviation-devo10-v4.0.1-265430d USB wont turn off
That does not cause an issue as the "loaded" files are in memory. Changing them only effects the next boot (transmitter.ini, hw.ini)
the USB functionality has never had a problem until, as you have expressed, last fall. the nice thing about it is that it allows you to program and test in a much more efficient way. Removing it is not the solution.

where are the links for the repo (is it on github) ill give try to drill down and see it i can find any issues.

Please Log in or Create an account to join the conversation.

More
08 Feb 2016 18:54 - 08 Feb 2016 19:09 #42794 by aperseghin
Replied by aperseghin on topic deviation-devo10-v4.0.1-265430d USB wont turn off
it seems like that once USB is on, it stops listening (may be stuck in a loop)

The same thing happens in the EMU also

once you click USB on the console prints
wait release
and thats it.

what does "wait release" mean
Last edit: 08 Feb 2016 19:09 by aperseghin.

Please Log in or Create an account to join the conversation.

More
08 Feb 2016 19:11 - 08 Feb 2016 19:40 #42795 by aperseghin
Replied by aperseghin on topic deviation-devo10-v4.0.1-265430d USB wont turn off
static struct usb_page * const up = &pagemem.u.usb_page;

static void _draw_page(u8 enable);

void wait_release();
void wait_press();

unsigned usb_cb(u32 button, unsigned flags, void *data)
{
    (void)button;
    (void)data;
    if(flags == BUTTON_RELEASE) {
        _draw_page(1);
        GUI_RefreshScreen();
        USB_Enable(0, 1);
        wait_release();
        wait_press();
        wait_release();
        USB_Disable();
        _draw_page(0);
    }
    return 1;
}

void PAGE_USBInit(int page)
{
    (void)page;
    PAGE_SetModal(0);
    _draw_page(0);
    BUTTON_RegisterCallback(&up->action, CHAN_ButtonMask(BUT_ENTER), BUTTON_PRESS | BUTTON_RELEASE | BUTTON_PRIORITY, usb_cb, NULL);
}

void PAGE_USBExit()
{
    BUTTON_UnregisterCallback(&up->action);
}

is this right? is wait_release there to many times or in the wrong order?
Last edit: 08 Feb 2016 19:40 by aperseghin.

Please Log in or Create an account to join the conversation.

More
08 Feb 2016 19:27 #42796 by FDR
I think the point of the change was, that you have to release (unmount) the USB drive before you switch it off, but it doesn't work...

Please Log in or Create an account to join the conversation.

More
08 Feb 2016 19:34 - 08 Feb 2016 19:43 #42797 by aperseghin
Replied by aperseghin on topic deviation-devo10-v4.0.1-265430d USB wont turn off
why is a released button waiting for release?
unsigned usb_cb(u32 button, unsigned flags, void *data)
{
    (void)button;
    (void)data;
    if(flags == BUTTON_RELEASE) { # here
        _draw_page(1);
        GUI_RefreshScreen();
        USB_Enable(0, 1);
        wait_release();  #here
        wait_press();
        wait_release(); #here
        USB_Disable();
        _draw_page(0);
    }
    return 1;
}

shouldn't it be waiting for a "press" then "release" not release-press-release
Last edit: 08 Feb 2016 19:43 by aperseghin.

Please Log in or Create an account to join the conversation.

More
09 Feb 2016 02:26 #42815 by mwm
There is a potential running problem with USB while the transmitter is active. If you a file in USB mode, and the transmitter thinks it needs to be saved for some reason before you read in the new version, then your edits will be overwritten when the file is saved.

I believe the current sequence is correct. The button is pressed, so we enable USB and then wait for it to be pressed and released again. But that could also be problematic.

My temptation is to change the message to say "unmount the drive and power off" rather than allowing it to be turned off. Or as suggrested, just remove this feature. It's missing on the 7e (space issues), and was taken out on the 10 with that change and nobody noticed for over a year.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
09 Feb 2016 02:48 #42817 by aperseghin
Replied by aperseghin on topic deviation-devo10-v4.0.1-265430d USB wont turn off
In that case, how about making it mount read only, or just rip it out. But don't leave it broken.

Please Log in or Create an account to join the conversation.

More
09 Feb 2016 02:59 #42818 by hexfet
I just pushed a fix for this. The problem was a bad logic test. Thanks very much for the following comment - knowing the exact build that broke is very helpful.

Serg_S wrote: The problem began with the nightly build ef0d76d from 07.26.2015.


I've never had a problem with corrupted files or filesystem on my devo10. In any case this change is unrelated to any problems with mounting/unmounting - it was just an invalid test.

Please Log in or Create an account to join the conversation.

More
09 Feb 2016 12:22 - 09 Feb 2016 12:27 #42834 by aperseghin
Replied by aperseghin on topic deviation-devo10-v4.0.1-265430d USB wont turn off
SWEET, just flashed today's (last night) build and its fixed :) thanks
Last edit: 09 Feb 2016 12:27 by aperseghin.

Please Log in or Create an account to join the conversation.

More
09 Feb 2016 13:50 - 09 Feb 2016 13:51 #42839 by aperseghin
Replied by aperseghin on topic deviation-devo10-v4.0.1-265430d USB wont turn off
I noticed in the new version
667678f
that when I calibrate the screen does not clear before writing "calibration done" to the screen

NOTE: i am using small fonts
this does not effect the ability to calibrate.
not sure if this is only with small fonts
Last edit: 09 Feb 2016 13:51 by aperseghin.

Please Log in or Create an account to join the conversation.

More
09 Feb 2016 16:15 - 09 Feb 2016 16:28 #42846 by dalgibbard
Replied by dalgibbard on topic deviation-devo10-v4.0.1-265430d USB wont turn off
Not sure if it's related, but in the latest nightly (667678f) PPM output via the trainer port isn't working on my Devo 7E. Sometimes there's just no output (pressing Re-Init does nothing), another time it rebooted on pressing Re-Init, and occasionally I can get it to say "Bad or Missing Module" when pressing Re-Init. Is this my controller being dodgy, or a bug? It was working fine before updating.

Edit: Seems like using the 'PPM' or 'USBHID' protocols don't work?
Edit2: I get a "Bad/Missing modules" error when powering on my TX also; but only protocols requiring CC2500 module are flagged (I don't have this module) - i'm using the tx.ini and hardware.ini from the previous build I was using.
Edit3: Flashed 'b381655' over the top - all works OK.
Last edit: 09 Feb 2016 16:28 by dalgibbard.

Please Log in or Create an account to join the conversation.

More
10 Feb 2016 01:21 - 10 Feb 2016 01:36 #42903 by Deal57
On my Devo 6S, version v4.0.1-667678f, the USB file system turns on with 'ENT' and off with a second 'ENT'. That seems to be what its supposed to do now!

Additionally, I've got both PPM output and HID. On HID, reinit seems to reinitialize the USB port.

So this looks really good to me.

It really does work as expected... in my haste to test a few other things I used this feature and turned on the USB to edit the Hardware.ini file, saved the file, then turned off the USB... and shutdown... oooh, what did I forget? Yeah, had to reformat the USB drive and restore from backup. This is dangerous, but it works exactly as expected.

Deviation Devo7e 3way switch mod, A7105, NRF24L01
Devo6s 2x2 switch mod, trim mod, haptic, multimodule, A7105, NRF24L01, CC2500
Devo12e 4-in-1 with voice mod -- it speaks!!
Last edit: 10 Feb 2016 01:36 by Deal57. Reason: Keyboard-Groundstrap error

Please Log in or Create an account to join the conversation.

More
10 Feb 2016 04:07 #42906 by vlad_vy
About Devo 7e, do you renew "protocol" folder to nightly release?

Please Log in or Create an account to join the conversation.

More
10 Feb 2016 05:23 #42911 by mwm
Deal57's description of editing the hardware.ini file points out that we don't reload any files after turning off USB.

The only really safe way to get all the config files reloaded is a reset. Well, we could rewrite the reset code to have a mode that checks all the file dates and optionally reloaded them, but that's a bit much just for this. Makes me think we ought to either take out USB mode, make exiting it reset the Tx, or maybe make it read-only.

But if everyone else is happy with it as is, I'll leave it

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

Time to create page: 0.067 seconds
Powered by Kunena Forum