Skip to content

Commit 8a34f8e

Browse files
Merge branch 'Serasidis-master'
2 parents 9d46a1c + 4ea490e commit 8a34f8e

File tree

8 files changed

+60
-4
lines changed

8 files changed

+60
-4
lines changed

STM32F1/boards.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,12 @@ genericSTM32F103C.menu.upload_method.jlinkMethod.upload.protocol=jlink
399399
genericSTM32F103C.menu.upload_method.jlinkMethod.upload.tool=jlink_upload
400400
genericSTM32F103C.menu.upload_method.jlinkMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER
401401

402+
genericSTM32F103C.menu.upload_method.HIDUploadMethod=HID bootloader 2.0
403+
genericSTM32F103C.menu.upload_method.HIDUploadMethod.upload.tool=hid_upload
404+
genericSTM32F103C.menu.upload_method.HIDUploadMethod.build.upload_flags=-DSERIAL_USB -DGENERIC_BOOTLOADER
405+
genericSTM32F103C.menu.upload_method.HIDUploadMethod.build.vect=VECT_TAB_ADDR=0x8001000
406+
genericSTM32F103C.menu.upload_method.HIDUploadMethod.build.ldscript=ld/hid_bootloader.ld
407+
402408
#-- CPU Clock frequency
403409
genericSTM32F103C.menu.cpu_speed.speed_72mhz=72Mhz (Normal)
404410
genericSTM32F103C.menu.cpu_speed.speed_72mhz.build.f_cpu=72000000L

STM32F1/platform.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,14 @@ tools.jlink_upload.upload.params.verbose=-d
162162
tools.jlink_upload.upload.params.quiet=n
163163
tools.jlink_upload.upload.pattern="{path}/{cmd}" "{build.path}/{build.project_name}.bin"
164164

165-
# HID upload
165+
# HID upload 2.0
166166
tools.hid_upload.cmd=hid_upload
167-
tools.hid_upload.cmd.windows=hid_upload.bat
168-
tools.hid_upload.cmd.macosx=hid_upload
167+
tools.hid_upload.cmd.windows=hid-flash.exe
168+
tools.hid_upload.cmd.macosx=hid_flash
169169
tools.hid_upload.path={runtime.hardware.path}/tools/win
170170
tools.hid_upload.path.macosx={runtime.hardware.path}/tools/macosx
171171
tools.hid_upload.path.linux={runtime.hardware.path}/tools/linux
172172
tools.hid_upload.path.linux64={runtime.hardware.path}/tools/linux64
173173
tools.hid_upload.upload.params.verbose=-d
174174
tools.hid_upload.upload.params.quiet=n
175-
tools.hid_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"
175+
tools.hid_upload.upload.pattern="{path}/{cmd}" "{build.path}/{build.project_name}.bin" {serial.port.file}

STM32F1/system/libmaple/stm32f1/include/series/dma.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,10 @@ static inline void dma_clear_isr_bits(dma_dev *dev, dma_tube tube) {
538538
dev->regs->IFCR = (1U << (4 * (tube - 1)));
539539
}
540540

541+
static inline uint16 dma_get_count(dma_dev *dev, dma_tube tube) {
542+
return dma_channel_regs(dev, tube)->CNDTR;
543+
}
544+
541545
/**
542546
* @brief Deprecated
543547
* STM32F1 mode flags for dma_setup_xfer(). Use dma_tube_cfg() instead.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* libmaple linker script for "Flash" builds.
3+
*
4+
* A Flash build puts .text (and .rodata) in Flash, and
5+
* .data/.bss/heap (of course) in SRAM, but offsets the sections by
6+
* enough space to store the Maple bootloader, which lives in low
7+
* Flash and uses low memory.
8+
*/
9+
10+
/*
11+
* This pulls in the appropriate MEMORY declaration from the right
12+
* subdirectory of stm32/mem/ (the environment must call ld with the
13+
* right include directory flags to make this happen). Boards can also
14+
* use this file to use any of libmaple's memory-related hooks (like
15+
* where the heap should live).
16+
*/
17+
MEMORY
18+
{
19+
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
20+
rom (rx) : ORIGIN = 0x08001000, LENGTH = 124K
21+
}
22+
23+
/* Provide memory region aliases for common.inc */
24+
REGION_ALIAS("REGION_TEXT", rom);
25+
REGION_ALIAS("REGION_DATA", ram);
26+
REGION_ALIAS("REGION_BSS", ram);
27+
REGION_ALIAS("REGION_RODATA", rom);
28+
29+
/* Let common.inc handle the real work. */
30+
INCLUDE common.inc

STM32F4/boards.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ generic_f407v.menu.upload_method.STLinkMethod.upload.tool=stlink_upload
111111
generic_f407v.menu.upload_method.STLinkMethod.upload.dfuse_addr=0x08004000
112112
generic_f407v.menu.upload_method.STLinkMethod.build.vect_flags=-DVECT_TAB_FLASH -DUSER_ADDR_ROM=(uint32)0x08000000
113113

114+
generic_f407v.menu.upload_method.HIDUploadMethod=HID bootloader 2.0
115+
generic_f407v.menu.upload_method.HIDUploadMethod.upload.tool=hid_upload
116+
generic_f407v.menu.upload_method.HIDUploadMethod.build.vect_flags=-DVECT_TAB_FLASH -DUSER_ADDR_ROM=(uint32)0x08004000 -DVECT_TAB_OFFSET=0x4000
117+
generic_f407v.menu.upload_method.HIDUploadMethod.build.ldscript=ld/bootloader_8004000.ld
114118

115119
generic_f407v.menu.upload_method.DFUUploadMethod=STM32duino bootloader
116120
generic_f407v.menu.upload_method.DFUUploadMethod.upload.protocol=maple_dfu

STM32F4/platform.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,15 @@ tools.stlink_upload.path.linux64={runtime.hardware.path}/tools/linux64
123123
tools.stlink_upload.upload.params.verbose=-d
124124
tools.stlink_upload.upload.params.quiet=
125125
tools.stlink_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"
126+
127+
# HID upload 2.0 (HID bootloader 2.0 This bootloader will cover the STM32F1 and STM32F4 MCUs)
128+
tools.hid_upload.cmd=hid_upload
129+
tools.hid_upload.cmd.windows=hid-flash.exe
130+
tools.hid_upload.cmd.macosx=hid_flash
131+
tools.hid_upload.path={runtime.hardware.path}/tools/win
132+
tools.hid_upload.path.macosx={runtime.hardware.path}/tools/macosx
133+
tools.hid_upload.path.linux={runtime.hardware.path}/tools/linux
134+
tools.hid_upload.path.linux64={runtime.hardware.path}/tools/linux64
135+
tools.hid_upload.upload.params.verbose=-d
136+
tools.hid_upload.upload.params.quiet=n
137+
tools.hid_upload.upload.pattern="{path}/{cmd}" "{build.path}/{build.project_name}.bin" {serial.port.file}

tools/win/hid-flash.exe

69.8 KB
Binary file not shown.

tools/win/hid_flash/hid-flash.exe

-73.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)