ERSKY9X Coding

erskyTx runs on many radios and upgrade boards
ersky9x was a port of er9x for use on the sky9x board.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

MikeB wrote: Tue Mar 21, 2017 12:28 pm
The option for flashing a multi module using a serial bootloader in the module is extended to handle the Orange DSM module.

Mike.
Thanks Mike, Would this work with the Module soft power circuit I use?
Also, what about the STM32 module? Not possible yet?

Thank you

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

Should work OK with that power circuit.
The STM needs a bootloader to be written and integrated into the module. That is not easy while building the firmware in the Arduino IDE.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
KAL
Posts: 552
Joined: Thu Oct 10, 2013 4:36 pm
Country: Germany
Location: somewhere near Rothenburg ob der Tauber

Re: ERSKY9X Coding

Post by KAL »

Hi Mike,
which bootloader are you using for the multi?
Or can you please provide a HEX-File?

Klaus
( TH9X / 9XTreme / FrSky DHT / Spektrum / Multi / RotEnc )
( 9XR PRO / erSKY9x  / FrSky DHT / Spektrum / Multi / RotEnc / P3 as Slider )
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

MikeB wrote: Tue Mar 21, 2017 3:22 pm Should work OK with that power circuit.
The STM needs a bootloader to be written and integrated into the module. That is not easy while building the firmware in the Arduino IDE.

Mike.
Thanks, will try that later.. just building 2 more receivers at the moment ;) :)

For the STM, I don't understand where the problem is? Once we flash the bootloader the way we do now to the chip (Not with arduino), then the arduino can continue to produce the bin files to flash it, as far as I understand?? The bootloader doesn't have nothing to do with arduino??
Or am i missing something? Wouldn't be surprised if I was :) but would like to understand what :)

Thanks

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
KAL
Posts: 552
Joined: Thu Oct 10, 2013 4:36 pm
Country: Germany
Location: somewhere near Rothenburg ob der Tauber

Re: ERSKY9X Coding

Post by KAL »

Hi Mike,

problem solved. I was just too blind to find it in the docs ... :oops:

Klaus
( TH9X / 9XTreme / FrSky DHT / Spektrum / Multi / RotEnc )
( 9XR PRO / erSKY9x  / FrSky DHT / Spektrum / Multi / RotEnc / P3 as Slider )

User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

A bootloader really needs to be the thing that runs at power on, and decide to run the application or itself. The STM always starts from the beginning of flash. This requires the application to be located somewhere else (which is what is done on ARM processors for ersky9x/openTx). This then needs to find a way of building the application in the Arduino IDE to run from this other start address.
Basically it needs investigating to see what can be done.
The AVR and Xmega processors have fuses to set to select a dedicated bootloader start up.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Now I understand. Thanks Mike.

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: ERSKY9X Coding

Post by Kilrah »

Also on the AVR the bootloader is at the END of the flash (with the fuses telling where to start from) while the STM always starts from the bottom, so of a bootloader is used it has to be put there.
That means that on AVR the same binary can be used with and without bootloader (at the cost of losing any unused flash at the end of the bootloader block), while on the STM you need different binaries for use with or without bootloader (but could collate the application to the bootloader, and thus not lose any space).
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

But then it could not be compiled by the Arduino IDE anymore, correct?
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

Just had a look around the STM information loaded into the IDE. I've found references to using a 'maple' bootloader, and also some linker scripts and board options that suggest we might be able to get a bootloader in.
It needs investigation though.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Thank you.

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

KAL wrote: Tue Mar 21, 2017 6:22 pm Hi Mike,

problem solved. I was just too blind to find it in the docs ... :oops:

Klaus
Which docs? I can't find it..

Thanks

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Mike, flashed bootloader from here:

https://www.rcgroups.com/forums/showpos ... count=4867

Changed high fuse to D6 on my module.

Then installed the latest ersky9x test version "C2" on my Ar9x radio.
Converted the multi hex file to bin using avr-objcopy. Put file in the firmware folder on SD Card.

Start radio in maintenance mode, and select to update multi. Select the bin file.

It says FAILED. At the bottom display show 1E95 0F10

I find strange that the produced bin file is much smaller than than the hex file. Hex file is 83KB against only 30KB from the bin file.
The command I used after I openend the command window in the multiprotocol folder was:

avr-objcopy -I ihex Multiprotocol.hex -O binary Multiprotocol.bin

Any idea what might have gone wrong? Bin file attached.

Thanks

João
Attachments
Multiprotocol_07-03-2017.zip
(17.8 KiB) Downloaded 232 times
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
KAL
Posts: 552
Joined: Thu Oct 10, 2013 4:36 pm
Country: Germany
Location: somewhere near Rothenburg ob der Tauber

Re: ERSKY9X Coding

Post by KAL »

Hi João,

in the docs on github under "not for the fainthearted" :)
See here
But I did't had time to test it yet.

Klaus
( TH9X / 9XTreme / FrSky DHT / Spektrum / Multi / RotEnc )
( 9XR PRO / erSKY9x  / FrSky DHT / Spektrum / Multi / RotEnc / P3 as Slider )
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Yes, i think it is the same I've found, thanks


João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Also, it doesn't work on my PRO that has no RF power switch yet.
My module DOES NOT have the bind button as I use serial..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
midelic
Posts: 128
Joined: Mon Dec 23, 2013 9:57 pm
Country: -

Re: ERSKY9X Coding

Post by midelic »

Here is the source for the generic STM32F103 bootloader used to communicate via USB(flashing)
I think it can be modified to communicate via multi pins.

https://github.com/rogerclarkmelbourne/ ... er/STM32F1
User avatar
KAL
Posts: 552
Joined: Thu Oct 10, 2013 4:36 pm
Country: Germany
Location: somewhere near Rothenburg ob der Tauber

Re: ERSKY9X Coding

Post by KAL »

jhsa wrote: Wed Mar 22, 2017 3:40 pm My module DOES NOT have the bind button as I use serial..
Hi João,

as Mike mentions here, he has to modify the multi code to be able to
automatically switch to bootloader when entering maintenance mode.

Klaus
( TH9X / 9XTreme / FrSky DHT / Spektrum / Multi / RotEnc )
( 9XR PRO / erSKY9x  / FrSky DHT / Spektrum / Multi / RotEnc / P3 as Slider )
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Hmm, I thought he said somewhere already that he had the flashing working without the need for the bind button press.. maybe I'm mistaken then.. :(

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Mike, guys with the encoder only (ArUni Board) don't seem to be able to but the XJT in "Bind" mode using the encoder's centre button. Some of them don't have the menu or exit buttons..
Could you please check the ArUni thread..
João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
KAL
Posts: 552
Joined: Thu Oct 10, 2013 4:36 pm
Country: Germany
Location: somewhere near Rothenburg ob der Tauber

Re: ERSKY9X Coding

Post by KAL »

I think you'll have to wait 'til Mike is able to provide his changes to pascal/midelic

PS: though I have some modules from bangood they don't have bind button and dial switch. :oops:
I removed them for some other projects. :D

Klaus
( TH9X / 9XTreme / FrSky DHT / Spektrum / Multi / RotEnc )
( 9XR PRO / erSKY9x  / FrSky DHT / Spektrum / Multi / RotEnc / P3 as Slider )
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

you don't really need them with Ersky9x, so no point in having them.. That is why many people remove them before putting the module inside a case..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

Busy day! It looks like I added a bug for flashing the AVR module when adding the code to flash the Orange module. For the 'PRO, I've posted a new test version, hopefully with the bug fixed but I haven't time to test it. I'll do a "c3" build later tonight.

A .hex file is typically 2.5 times the size of a .bin file for the same data.

Quick bootloader description:
At power on or reset, the bootloader runs.
If started due to power on or reset, wait 0.5 seconds, then check the dial and bind button.
If dial at 0 and bind button pressed continue in the bootloader.
Otherwise, try to run the main application, check that flash location 0 doesn't contain 0xFF (i.e. is NOT erased). If not 0xFF, jump to address 0, else continue in the bootloader.

If the main application does NOT include the code to detect a flashing attempt, then you won't be able to use the bootloader again if you don't have the bind button to force the bootloader to keep running.

I'll try to find time to post my changes to multi 1.1.6.20 that include the flashing attempt detection.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
KAL
Posts: 552
Joined: Thu Oct 10, 2013 4:36 pm
Country: Germany
Location: somewhere near Rothenburg ob der Tauber

Re: ERSKY9X Coding

Post by KAL »

Thanks in advance

Klaus
( TH9X / 9XTreme / FrSky DHT / Spektrum / Multi / RotEnc )
( 9XR PRO / erSKY9x  / FrSky DHT / Spektrum / Multi / RotEnc / P3 as Slider )
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Thank you Mike, so if I understand I should now be able to flash the module once after I flash the bootloader. If I need to do it again, for now while you don't change the multi code, I would have to flash the bootloader via ISP again, right? In other words erase the chip..

Thanks again for all.. Will attempt now..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Flashed optiboot.
9XR-PRO in maintenance mode
After progress bar I get this:

Flashing Complete

FAILED

1E95 0F10

It seems to have flashed but it gives this error..
Nope, module does not work..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

Repeated the process without burning the bootloader, and saw the progress bar again with the same results.

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

jhsa wrote: Wed Mar 22, 2017 6:25 pm Mike, guys with the encoder only (ArUni Board) don't seem to be able to but the XJT in "Bind" mode using the encoder's centre button. Some of them don't have the menu or exit buttons..
Could you please check the ArUni thread..
João
About this situation, the problem is that they want to use only the encoder and centre buttons to control everything. With the current menu system it is not possible. Even The QX7 has some other buttons as far as I know.

To be able to do everything with the encoder only, you need a menu system where for example one of the fields is called "EXIT". Or a popup with an "EXIT" option on it..

Otherwise, the long and short presses of the centre button will clash at some point, and this is one of those situations.
I think that the "Bind" needs to be a long press to be safe. Or at least, a short press that opens a confirmation popup. Then the long press could be used as Exit..
The best would be that the guys really install 2 more buttons on their radios, MENU and EXIT, along with the encoder

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

It looks like there may be a problem in the bootloader when the application size exceeds 28672 bytes (28K i.e. 28+1024).
This requires flashing to an area that could be part of a bootloader. The optiboot bootloader has code in to handle this, but it seems something is not working or responding in time.
If you take out one or two protocols so the build is less than 28762 bytes of flash, it should then work.
I'll look into what the bootloader is doing.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ERSKY9X Coding

Post by jhsa »

I can also try that..
Will report in a little while..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

Post Reply

Return to “erskyTx (was ersky9x)”