Eslipse and DFU

mgrunt
Mon Jul 11, 2016 8:20 am
Hello, I’m playing with SMT32 + SPL and Eclipse over two years… Now I can using DFU for upload firmware. I try upload to chip Arduino-SMT32 bootloader and test simple blink LED example in Arduino IDE. It is working without any problem. Bud I can using this bootloader (DFU and VCP) in Eclipse (using SPL, no Arduino library). What I must change for example in LD script or somewhere else for successful uploading? Chip is STM32F103C8T6 (64 KB FLASH, 20 KB SRAM).

Thanks, MG


mrburnette
Mon Jul 11, 2016 1:24 pm
Too many forum references for Eclipse… but the site is fully indexed.

Click for Google search The first results looks promising.

Ray


mgrunt
Mon Jul 11, 2016 1:48 pm
OK, forgot to Eclipse (I’m using Eclipse only as IDE with external makefile)…

I want to use makefile + SPL, *.LD, *.S. Nothing else and of course dfu-util.exe.

For example: I have main.c for simple LED blink and makefile (plus SPL, LD and S). No Arduino library or source, no Arduino IDE. Command “make” generate hex file. This file I uploading with st-link to MCU and LED blinking. What I must make when I can upload this hex file with DFU util. Burn Arduino-stm32 bootloader and? Edit LD script (set right start address – skip bootloader)? Anything else?

Thanks


Rick Kimball
Mon Jul 11, 2016 1:56 pm
Add a custom post build step in the property dialog:

http://help.eclipse.org/mars/index.jsp? … _steps.htm


mgrunt
Mon Jul 11, 2016 2:26 pm
I think this is not too simple only edit post step (do you mean dfu-util.exe). I think it is necessarily edit LD script too (currently I’m not using arduino bootloader).

Rick Kimball
Mon Jul 11, 2016 2:29 pm
Yes make the last step an upload step using dfu

Rick Kimball
Mon Jul 11, 2016 2:35 pm
Or you could just configure an external tool menu item (Run menu)

http://help.eclipse.org/kepler/index.js … unning.htm

Or you could create a custom makefile for your project instead of using the one eclipse auto-generates.


mgrunt
Wed Jul 13, 2016 10:32 am
Maybe we do not understand… This is not as easy as I found.

LD script is must be modified – ROM (rx) : ORIGIN = 0x08002000…
After make hex respectively binary (-Obinary) it is necessarily make MCU reset (reset.py – through VCP).
Then I can upload binary to MCU (dfu-util -a 2 -d 1eaf:0003 -D xxx.bin).
It is working.

Bud there is a small problem. The part of the main program must have VCP init because after upload binary to MCU, MCU (USB) stay in Maple DFU mode and I can’t make software restart when I can upload another firmware…


ekawahyu
Wed Jul 13, 2016 4:19 pm
mgrunt wrote:Bud there is a small problem. The part of the main program must have VCP init because after upload binary to MCU, MCU (USB) stay in Maple DFU mode and I can’t make software restart when I can upload another firmware…

mgrunt
Mon Jul 18, 2016 7:34 am
Yes, bud from Aurduino IDE/Arduino sources. As I said I can using DFU and VCP outside Arduino environment, only with SPL (no Arduino IDE, no Arduino sources etc.)…

Nutsy
Thu Feb 09, 2017 1:34 pm
Sorry for bringing up an old thread.

But, im strugging to get this working.

Trouble is I dont know the arguments to pass to the dfu util… in mac.

Ive got eclipse mostly working now but I cant upload using the normal arduino serial method and I cant time the manual reset correctly. As manually resetting turns off the board and hides the serial port.

So , what arguments do i put in?


leavesw
Thu Feb 09, 2017 5:13 pm
dfu-util is a open-source package that is available on Mac, Linux and Windows.
Here is the manual page for it:
http://dfu-util.sourceforge.net/dfu-util.1.html

I assume that you are using it with the maple bootloader (https://github.com/rogerclarkmelbourne/ … bootloader)
Then you need to
1. pass VID:PID of the USB device using “-d” option
2. pass alternate settings using “-a”. There are three alternate settings available in the bootloader which points to three different locations.
0: RAM
1: Flash 0x8005000
2: Flash 0x8002000
The choice of these depends on where your user application is compiled at.
3. pass the user application binary file you want to download using “-D”

Then you need to manual reset it as I believe the bootloader goes into dfuMANIFEST-WAIT-RESET state (I might be wrong here).


Nutsy
Thu Feb 09, 2017 5:36 pm
Thanks, sadly i have a new problem…

I discovered that for some reason it was trying to trigger the WIN version of the dfu… And i couldnt find an option that forced it to use macosx, so i basically copied the MAC files into the win dir…

Kinda worked, managed to get it to upload. But I have a new problem… I think its either corrupting the upload or the builder in eclipse is compiling a damaged file. As once its uploaded. The board doesnt run the program or is crashed. And i even have trouble with getting serial to see it after this.

Reuploading using DFU from the arduino IDE fixes this. I assume corrects the bootloader or programme.

Is eclipse system getting flagged as windows and performing bad builds or something?

I really want to get this to work…


victor_pv
Thu Feb 09, 2017 8:10 pm
Nutsy wrote:Thanks, sadly i have a new problem…

I discovered that for some reason it was trying to trigger the WIN version of the dfu… And i couldnt find an option that forced it to use macosx, so i basically copied the MAC files into the win dir…

Kinda worked, managed to get it to upload. But I have a new problem… I think its either corrupting the upload or the builder in eclipse is compiling a damaged file. As once its uploaded. The board doesnt run the program or is crashed. And i even have trouble with getting serial to see it after this.

Reuploading using DFU from the arduino IDE fixes this. I assume corrects the bootloader or programme.

Is eclipse system getting flagged as windows and performing bad builds or something?

I really want to get this to work…


Nutsy
Thu Feb 09, 2017 8:22 pm
Well really interestingly… If i upload the same sketch from the arduino ide it uploads and runs fine.

if i upload from eclipse(sloeber) i get it to upload, but doesnt seem to run. And the serial port disappears as if its crashed or something…

So i assumed that eclipse is building a bad binary… However. i uploaded blink through Eclipse and it ran fine.

Really confusing.

i only have a few libraries included.
#include <Adafruit_NeoPixel.h>
#include <ThreadController.h>

Maybe eclipse is reading from a different library or something. its rather confusing me.


Leave a Reply

Your email address will not be published. Required fields are marked *