Hi all! Did anybody try to upload the compiled sketch without the Maple bootloader? I naively thinked, that I can grab the compiled binary from the temporary folder, and flash it via UART1 instead of Maple bootloader, as described in the "bootloader" section of docs. But when I tried, the device didn't work... Any ideas?
flash a sketch without bootloader
(10 posts) (4 voices)-
Posted 2 years ago #
-
You have to compile for the JTAG target, then it works.
The FLASH target adds an offset at linking time so your binary comes lying after the boot loader and can be jumped to by the latter.
If you want to upload the sketch directly, you're sketch won't start with this offset. You need to link your binary without the offset, what the JTAG target is for.
When using the unix toolchain:
-> BOARD=maple MEMORY_TARGET=jtag makeWhen you compile from within the IDE, you only have the FLASH and RAM targets by default, but the jtag linker scripts are included in the IDE, you just have to duplicate the description of your board in "maple-ide-v0.0.12/hardware/leaflabs/boards.txt" and replace the linker script "flash.ld" with "jtag.ld" and adjust the maximum RAM and FLASH sizes accordingly to 20k and 128k and you'll get a new entry in the Board drop down list.
e.g. like that:
mapleJTAG.name=LeafLabs Maple Rev 3+ to JTAG
mapleJTAG.upload.file_type=bin
mapleJTAG.upload.maximum_size=20000
mapleJTAG.upload.ram.maximum_size=20000
mapleJTAG.upload.flash.maximum_size=128000
mapleJTAG.upload.usbID=1EAF:0003
mapleJTAG.upload.altID=0
mapleJTAG.upload.uploader=dfu-util
mapleJTAG.upload.auto_reset=true
mapleJTAG.build.board=maple
mapleJTAG.build.mcu=STM32F103RB
mapleJTAG.build.family=cortex-m3
mapleJTAG.build.f_cpu=72000000L
mapleJTAG.build.core=maple
mapleJTAG.build.submdl=stm32f103
mapleJTAG.build.vect=VECT_TAB_FLASH
mapleJTAG.build.linker=maple/jtag.ld
mapleJTAG.build.using=armcompiler
mapleJTAG.build.density=STM32_MEDIUM_DENSITY
mapleJTAG.build.error_led_port=GPIOA
mapleJTAG.build.error_led_pin=5
Posted 2 years ago # -
Thanks, but it still don't work. I copied the "Maple to Flash" entry, so maximum_size is 128000 and altID is 1, is it critical? My compiled sketch is about 30k size, and I need to upload it to flash, not RAM.
Posted 2 years ago # -
Sorry, there were some errors in my code.
altID should be 1 of course (I think I've accidentally copied the RAM description)
and I forgot that VECT_TAB_FLASH has to be changed also to VECT_TAB_BASE
and the sizes are not important for small sketchesthe needed lines to change
mapleJTAG.upload.altID=1
mapleJTAG.build.vect=VECT_TAB_BASE
mapleJTAG.build.linker=maple/jtag.ldgive it another try, I hope that this does the trick..
Posted 2 years ago # -
not work,
Binary sketch size is reported above. Check it against a 20000 byte maximum.
Loading via dfu-util
Resetting to bootloader via DTR pulseReset via USB Serial Failed! Did you select the serial right serial port?
Assuming the board is in perpetual bootloader mode and continuing to attempt dfu programming...Searching for DFU device [1EAF:0003]...
dfu-util - (C) 2007-2008 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTYCouldn't find the DFU device: [1EAF:0003]
thx
Posted 2 years ago # -
@stafil, this thread is about building and downloading a sketch directly to the Maple board (and therefore overwriting the DFU bootloader with your sketch). By doing so, there won't be anymore a bootloader on the Maple board and hence the downloading precedure built into the IDE won't work anymore (that's what youre error log is all about).
Have a look here what the bootloader is all about: http://leaflabs.com/docs/bootloader.html
Posted 2 years ago # -
Yes, work without bootloader. Nice work. thx
Posted 2 years ago # -
yes, everything works ok. thanks for help
Posted 2 years ago # -
mapleJTAG.upload.maximum_size=128000
Posted 2 years ago # -
Ventosus, awesome work! Now to look into running it up with the serial loader.
Posted 2 years ago #
Reply
You must log in to post.