Replace Devo7E bootloader?
- FDR
- Offline
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.
- mwm
- Topic Author
- Offline
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.
- FDR
- Offline
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.
- mwm
- Topic Author
- Offline
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.
- FDR
- Offline
I only realized when I wanted to flash...
Please Log in or Create an account to join the conversation.
- FDR
- Offline
Please Log in or Create an account to join the conversation.
- FDR
- Offline
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.
- mwm
- Topic Author
- Offline
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.
- FDR
- Offline
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.
- mwm
- Topic Author
- Offline
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.
- vlad_vy
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- mwm
- Topic Author
- Offline
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.
- silpstream
- Offline
- Posts: 244
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.
- Deal57
- Offline
- Posts: 857
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!!
Please Log in or Create an account to join the conversation.
- silpstream
- Offline
- Posts: 244
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.
- Deal57
- Offline
- Posts: 857
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.
- silpstream
- Offline
- Posts: 244
Please Log in or Create an account to join the conversation.
- mwm
- Topic Author
- Offline
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.
- silpstream
- Offline
- Posts: 244
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?
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- Replace Devo7E bootloader?