Replace Devo7E bootloader?

More
15 Oct 2015 21:15 #38885 by FDR
Replied by FDR on topic Replace Devo7E bootloader?
Still no joy.

The pill target gives this:
$ make TARGET=pill
arm-none-eabi-gcc -DAPP_ADDRESS=0x08002000 -DLED_INVERTED -DLED_PORT=GPIOC -DLED
_TIMER=RCC_GPIOC -DLED_PIN=GPIO13 -DBUTTON_INVERTED -DBUTTON_PORT=GPIOB -DBUTTON
_TIMER=RCC_GPIOB -DBUTTON_PIN=GPIO2 -Os -g -Wextra -Wshadow -Wimplicit-function-
declaration -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes -fno-comm
on -ffunction-sections -fdata-sections -MD -Wall -Wundef -I../libopencm3//includ
e -DSTM32F1 -mthumb -mcpu=cortex-m3 -msoft-float -mfix-cortex-m3-ldrd -o pill.o
-c usbdfu.c
usbdfu.c: In function 'usbdfu_set_config':
usbdfu.c:242:5: warning: passing argument 4 of 'usbd_register_control_callback'
from incompatible pointer type [enabled by default]
     usbdfu_control_request);
     ^
In file included from usbdfu.c:26:0:
../libopencm3//include/libopencm3/usb/usbd.h:127:12: note: expected 'usbd_contro
l_callback' but argument is of type 'int (*)(struct usbd_device *, struct usb_se
tup_data *, uint8_t **, uint16_t *, int (**)(struct usbd_device *, struct usb_se
tup_data *))'
 extern int usbd_register_control_callback(usbd_device *usbd_dev, uint8_t type,
            ^
usbdfu.c: In function 'main':
usbdfu.c:312:24: error: 'stm32f103_usb_driver' undeclared (first use in this fun
ction)
  usbd_dev = usbd_init(&stm32f103_usb_driver, &dev, &config, usb_strings, 4, usb
d_control_buffer, sizeof(usbd_control_buffer));
                        ^
usbdfu.c:312:24: note: each undeclared identifier is reported only once for each
 function it appears in
make: *** [pill.o] Error 1

...and this is for the devo7e target:
$ make TARGET=devo7e
arm-none-eabi-gcc -DAPP_ADDRESS=0x08002000 -DLED_PORT=GPIOB -DLED_TIMER=RCC_GPIO
B -DLED_PIN=GPIO1 -DBUTTON_PORT=GPIOC -DBUTTON_TIMER=RCC_GPIOC -DBUTTON_PIN=GPIO
9 -DMATRIX_PORT=GPIOB -DMATRIX_TIMER=RCC_GPIOB -DMATRIX_PIN=GPIO8 -Os -g -Wextra
 -Wshadow -Wimplicit-function-declaration -Wredundant-decls -Wmissing-prototypes
 -Wstrict-prototypes -fno-common -ffunction-sections -fdata-sections -MD -Wall -
Wundef -I../libopencm3//include -DSTM32F1 -mthumb -mcpu=cortex-m3 -msoft-float -
mfix-cortex-m3-ldrd -o devo7e.o -c usbdfu.c
usbdfu.c: In function 'usbdfu_set_config':
usbdfu.c:242:5: warning: passing argument 4 of 'usbd_register_control_callback'
from incompatible pointer type [enabled by default]
     usbdfu_control_request);
     ^
In file included from usbdfu.c:26:0:
../libopencm3//include/libopencm3/usb/usbd.h:127:12: note: expected 'usbd_contro
l_callback' but argument is of type 'int (*)(struct usbd_device *, struct usb_se
tup_data *, uint8_t **, uint16_t *, int (**)(struct usbd_device *, struct usb_se
tup_data *))'
 extern int usbd_register_control_callback(usbd_device *usbd_dev, uint8_t type,
            ^
usbdfu.c: In function 'main':
usbdfu.c:312:24: error: 'stm32f103_usb_driver' undeclared (first use in this fun
ction)
  usbd_dev = usbd_init(&stm32f103_usb_driver, &dev, &config, usb_strings, 4, usb
d_control_buffer, sizeof(usbd_control_buffer));
                        ^
usbdfu.c:312:24: note: each undeclared identifier is reported only once for each
 function it appears in
make: *** [devo7e.o] Error 1

Thank you for your support! I really appreciate it.

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

More
16 Oct 2015 01:03 #38889 by mwm
Replied by mwm on topic Replace Devo7E bootloader?
Hmm. Both have the same warning/errors. Not surprising, as the different targets mostly just change the GPIO pins used, and maybe the test.

Aargh. I didn't have the "latest" version - just close to it. The actual latest included a major breaking change. I've pushed an update to the repository to fix that.

I hope this doesn't mean I need to include all of libopencm3 in my repository.....

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
16 Oct 2015 04:27 #38895 by FDR
Replied by FDR on topic Replace Devo7E bootloader?
Thank you, now it's fine.

Please do confirm that I need to flash the .elf file directly with the ST-Link to the 0x08000000 starting address.
What starting address will it need through the DFU afterwards? 0x08002000 perhaps?

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

More
16 Oct 2015 07:58 #38908 by mwm
Replied by mwm on topic Replace Devo7E bootloader?
Courtesy on both counts. The booloader runs at 0x8000000, and the application it loads runs at 0x08002000. The former is set in the .ld file, and the largest of the APP_ADDRESS value in the makefile.

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
16 Oct 2015 19:17 #38932 by FDR
Replied by FDR on topic Replace Devo7E bootloader?
I think something still isn't right, because there is no .bin file as a result, only .d, .elf, .map and .o
I only realized when I wanted to flash... :lol:

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

More
16 Oct 2015 19:42 #38933 by FDR
Replied by FDR on topic Replace Devo7E bootloader?
Sorry, I should have read the readme... :blush:

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

More
16 Oct 2015 20:38 #38934 by FDR
Replied by FDR on topic Replace Devo7E bootloader?
So finally I flashed the bootloader into the bluepill.
It flashes the LED properly (I've added two more cycle to make it easier to notice) at startup, and the LED goes on after that.
I can turn it on in DFU mode with the jumper, however the DfuSe Demo doesn't see it as a DFU device, probably because Windows only detected it as an unknown device...

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

More
16 Oct 2015 22:38 #38939 by mwm
Replied by mwm on topic Replace Devo7E bootloader?
I just rebuilt it using the new version of libopencm3, flashed that, and it works for me - at least well enough to be recognized.

The usb device manager shows it as:
ugen3.8: <STM32 STLink STMicroelectronics> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)

And the dfu-util command lists it as:
Found DFU: [0483:df11] ver=0200, devnum=7, cfg=1, intf=0, alt=0, name="@Internal Flash   /0x08000000/8*001Ka,56*001Kg", serial="0.1"

In fact, if I connect it to the Windows VM I use for flashing Tx's, Walkera's DFuse recognizes it as well. Does it at least show up in the Windows device manager? Possibly installing the appropriate dfuse device driver from STM?

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
17 Oct 2015 11:09 #38957 by FDR
Replied by FDR on topic Replace Devo7E bootloader?
I tested it again.
When I tried first, there was the bootloader installed, plus a little LED flashing program (which I flashed with the ST-Link to 0x80002000) to see if the bootloader would start it properly (it does).
So I started the pill in DFU mode when neither the DfuSe Demo, nor the Walkera DfuSe Upgrade Tool has seen it.

Then I cleared the pill, and flased only the bootloder, in wich case when it starts it will stay in DFU mode, and this way both progams has seen the device.
I couldn't flash a DFU than, because i didn't have one, but next time I will try to load the 7E fw... :)

BTW the two DFU modes seem to differ: the automatic one, when there is no valid program flashes the LED and leaves it on, while the normal (starting with the jumper on) doesn't light the LED at all.

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

More
17 Oct 2015 15:42 #38967 by mwm
Replied by mwm on topic Replace Devo7E bootloader?
I've opened a ticket for that on the issue tracker: chiselapp.com/user/mwm/repository/DFU_Fl...df01991303e18eddd3bc

Someone suggested using dfu boot loaders the entire way, instead of having to flash a new boot loader. I believe that will work, and am going to try adding targets a "devo* bootstrap loader" that will build a dfu that can be loaded by the walkera bootloader. That will then let you use standard dfu tools to install things at the boot loader address, which will let you install a new boot loader without having to open your Tx.. I'll be testing on my Devo 10 (since I have a walkera boot loader for it), but it may take a while to get to 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.

More
23 Oct 2015 14:22 #39142 by vlad_vy
Replied by vlad_vy on topic Replace Devo7E bootloader?
I think it has not great future. I don't know how work Deviation internally but probably will be better to develop external configuration application and use Devo 7e as dumb parser only, with several essential display pages only.

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

More
25 Mar 2016 19:57 #45185 by mwm
Replied by mwm on topic Replace Devo7E bootloader?
For the record, I'm officially declaring this project dead. One way or another, I'm through worrying about deviation fitting on the 7E.

The source is still out there, and was working on my dev board. If someone wants to pick it up and see if they can get it to work, I'd be happy to help them.

If we continue seeing problems with the Walkera dfuse tool, I may get back to it to avoid that on the 6/8/10, but I'm not planning on continuing it at this time.

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
28 Mar 2016 20:16 #45352 by silpstream
Replied by silpstream on topic Replace Devo7E bootloader?
I managed to get the boot loader code to compile for both "pill" and "devo7e". It works on the pill and I can get stm's dfuse to recognise the board in dfu mode. However no luck on the devo7e, basically the lcd backlight flashes once then goes blank and nothing else happens after that. Looking in the devices area of both windows and OS X shows nothing.

I also tried the built in UART boot loader as mentioned by MWM a few posts back. This actually works! We need to hook up TX, RX and GND (pin1, pin3 and pin4 respectively with the black wire being pin1) to an USB to serial board, short BOOT0, short the power bypass pins (battery must be connected), and STM Flash Demonstrator detects the board (115200 baud).

This leads me to think that we could instead implement a software based invocation of the system memory boot loader so that we don't have to open up the transmitter. It could still be attached to a signal toggled by holding the EXT button down on power on (similar to how the USB FS is brought up). We could then use stm32flash or the flash demonstrator to upload FW. There are a few things that I can't seem to get my head around.

1) I read somewhere that the 3.5mm port shorts pins 3 and 4. If so we can't use it cause RX would get shorted to GND.
2) We could effectively get rid of the walkera boot loader, but I can't really say if we'll save any space.
3) If someone messes up here, they would need to open the transmitter up to try again either using SWD or UART.

Also, I tried using Cleanflight Configurator (Chrome app) to see if it could detect the devo7e. It can in DFU mode, however we can't actually do uploads as CFC requires a Intel HEX file and I couldn't figure out how to create an encrypted HEX that the walkera boot loader needs. Of course if we get rid of the walkera boot loader then things look a lot better.

Since CFC flashes to the various FCs using both UART boot loader and DFU boot loader , I think that our hopes of having a GUI based select, build, download (from a build server), flash and configure platform built as a cross platform Chrome app looks promising.

@mwm, I know you declared this project dead, but I'm hoping some of my findings bring you back to it. IMHO, the possibility of both saving a bit of space by getting rid of the boot loader and the possibility that a chrome app could bring, very much falls in line with some of the reasons you laid out for wanting to fork as well as the various suggestions you've been making in your various "Suggested Changes" posts.

Until I can figure out how to get around pins 3 and 4 being shorted in the 3.5mm socket, I'm still gonna try to get the DFU boot loader working cause that could still work with a chrome app. Any help or direction you guys can provide would be much appreciated. Thanks!

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

More
29 Mar 2016 01:14 #45364 by Deal57
Replied by Deal57 on topic Replace Devo7E bootloader?
Yes, there is a short jumper and cable mod that can help fix the DSC port problem. This idea was discussed a couple of years back.

Basically, you disable the feature that shorts out the "ring" of the stereo cable and that signal is routed to the RX side of the cable. A drawing might be better than I am explaining it! I guess Walkera designed this so their tx could easily detect when a device is plugged in, and it does that by shorting the RX to ground.



So remove the short and you get both RX, TX as well as ground.



I assembled this cable to make it work, in addition to adding a short wire to the DSC assembly. I think I could also just swap the two middle pins in the header of the cable coming off the DSC.




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

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

More
29 Mar 2016 02:24 #45366 by silpstream
Replied by silpstream on topic Replace Devo7E bootloader?
@deal57, thanks so much for the information about the port mod!

Am I safe to assume that Deviation does NOT need to use the same mechanism to detect if a cable is plugged in?

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

More
29 Mar 2016 03:15 #45367 by Deal57
Replied by Deal57 on topic Replace Devo7E bootloader?
I've only done some basic testing in my Devo 6s, and it does seem to work with the voice prompt hardware. But it seems to open up the UART.

Here is the original MadCat thread from 2013.

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
29 Mar 2016 04:14 #45368 by silpstream
Replied by silpstream on topic Replace Devo7E bootloader?
Thanks very much again! I'll read through the stuff and probe in the code a bit to see if anything will break.

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

More
29 Mar 2016 16:19 #45386 by mwm
Replied by mwm on topic Replace Devo7E bootloader?
Correct, deviation doesn't use this feature. We don't have a "trainer" modes that need to be switched to automatically, etc.

And yeah, getting rid of the walkera boot loader is also a goal and why I might come back to this. But not soon.

There are some articles about how to jump to the system boot loader if you can get that working. And yeah, you could detect EXT down (just like the Walkera boot loader does) to do that. And that would save pretty much all the memory used by the boot loader!

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
31 Mar 2016 17:14 - 31 Mar 2016 17:14 #45504 by silpstream
Replied by silpstream on topic Replace Devo7E bootloader?
Thanks for the info about the trainer mode not needing auto switching!

I was doing some experimentation on getting rid of the walkera bootloader and shifting deviation up to 0x8000000. I made changes to the 2 ld files and the makefile by changing 0x8003000 to 0x8000000. I then used SWD to flash it.

Unfortunately it won't seem to power on. I'm thinking it has to do with the way the power switch is wired. Do I need some sort of startup to turn it on that the original bootloader used to handle?
Last edit: 31 Mar 2016 17:14 by silpstream.

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

Time to create page: 0.128 seconds
Powered by Kunena Forum