libmaple makefiles

Post your cool example code here.
rpav
Posts: 11
Joined: Sat Apr 29, 2023 2:37 pm

Re: libmaple makefiles

Post 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
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: libmaple makefiles

Post 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
rpav
Posts: 11
Joined: Sat Apr 29, 2023 2:37 pm

Re: libmaple makefiles

Post by rpav »

Success! It comes up as; /dev/ttyACM0
rpav
Posts: 11
Joined: Sat Apr 29, 2023 2:37 pm

Re: libmaple makefiles

Post 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?
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: libmaple makefiles

Post 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
Last edited by ag123 on Mon May 29, 2023 10:16 am, edited 2 times in total.
rpav
Posts: 11
Joined: Sat Apr 29, 2023 2:37 pm

Re: libmaple makefiles

Post 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
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: libmaple makefiles

Post 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.
rpav
Posts: 11
Joined: Sat Apr 29, 2023 2:37 pm

Re: libmaple makefiles

Post by rpav »

I will give it a try in the future, but the Makefile works great. I will be recommending these posts.
Post Reply

Return to “Code snippets”