Page 3 of 3

Re: libmaple makefiles

Posted: Mon May 29, 2023 6:27 am
by rpav
I am sorry, I did not know there was another page started.
dmesg:
[ 562.369009] usb 1-2: new full-speed USB device number 9 using xhci_hcd
[ 562.522910] usb 1-2: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
[ 562.522930] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 562.522938] usb 1-2: Product: FT232R USB UART
[ 562.522944] usb 1-2: Manufacturer: FTDI
[ 562.522950] usb 1-2: SerialNumber: A10JPDOO
[ 562.526815] ftdi_sio 1-2:1.0: FTDI USB Serial Device converter detected
[ 562.526885] usb 1-2: Detected FT232R
[ 562.527670] usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB0

Re: libmaple makefiles

Posted: Mon May 29, 2023 6:31 am
by ag123
apparently that is your FTDI dongle, that isn't the default Serial in stm32duino.
for the default Serial, simply connect the (micro) usb cable to the bluepill stm32f103c8, no dongle is needed

for the UART serial, try Serial1 (pa9 tx, pa10 rx) instead

Re: libmaple makefiles

Posted: Mon May 29, 2023 6:49 am
by rpav
Success! It comes up as; /dev/ttyACM0

Re: libmaple makefiles

Posted: Mon May 29, 2023 7:01 am
by rpav
For informational purposes, I flash the broad using the dongle on pins(pa9 tx, pa10 rx). Can you flash the broad using the micro usb?

Re: libmaple makefiles

Posted: Mon May 29, 2023 7:25 am
by ag123
you need a bootloader, e.g.
https://github.com/rogerclarkmelbourne/ ... bootloader
get the generic_boot20_pc13.bin or generic_boot20_pc13_fastboot.bin
https://github.com/rogerclarkmelbourne/ ... r/binaries

that
-DVECT_TAB_ADDR=0x8002000 to -DVECT_TAB_ADDR=0x8000000
has to go back to -DVECT_TAB_ADDR=0x8002000
your ldscript in the makefile should be

Code: Select all

ldscript := bootloader_20.ld
(there are different ld scripts with different start address as like that VECT_TAB_ADDR,
https://github.com/rogerclarkmelbourne/ ... 32f103c/ld
choose the appropriate ld script e.g. bootloader_20.ld is for the bootloader)
rebuild your sketch

you need to install the bootloader 1st using your FTDI dongle, as like how you install your sketch. (normally only once would do)

then you need dfu-util
https://dfu-util.sourceforge.net/
(it is also there in tools if you downloaded the stm32duino repository)

normally after pressing reset, run (that is lower case -L)

Code: Select all

dfu-util -l
it should show you a list of possible selections

get the command ready

Code: Select all

dfu-util -a 2 -RD mysketch.bin
connect usb, press reset, the led start blinking, you have about 3 seconds when the led blinks to *press enter*, it should flash away

Re: libmaple makefiles

Posted: Mon May 29, 2023 10:05 am
by rpav
I followed your instructions and now I am able to flash through the micro usb.
The only command that did not work was dfu-util -l (did not show a list), but everything else worked.
Thanks

Re: libmaple makefiles

Posted: Mon May 29, 2023 10:11 am
by ag123
These days this is probably the 'preferred' way to use the 'old' Libmaple core, e.g. you can use that makefile with eclipse. requires eclipse-CDT (c developers toolkit)
it is much more usable with reference jumps for symbols and even debug (requires st-link dongle)
the alternative is the 'old' Arduino IDE that is java based.

Re: libmaple makefiles

Posted: Mon May 29, 2023 10:26 am
by rpav
I will give it a try in the future, but the Makefile works great. I will be recommending these posts.