[SOLVED]Interesting problem

Post here all questions related to LibMaple core if you can't find a relevant section!
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Interesting problem

Post by ag123 »

another way i'd think is to use roger's libmaple boot loader that one needs none of uart, st-link etc
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Interesting problem

Post by stevestrong »

If you use maple lib I assume you are using Roger's core.
There is a difference in using the two upload meethods in boards.txt:

Code: Select all

genericSTM32F103C.menu.upload_method.serialMethod=Serial
genericSTM32F103C.menu.upload_method.serialMethod.upload.protocol=maple_serial
genericSTM32F103C.menu.upload_method.serialMethod.upload.tool=serial_upload
genericSTM32F103C.menu.upload_method.serialMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG

genericSTM32F103C.menu.upload_method.STLinkMethod=STLink
genericSTM32F103C.menu.upload_method.STLinkMethod.upload.protocol=STLink
genericSTM32F103C.menu.upload_method.STLinkMethod.upload.tool=stlink_upload
genericSTM32F103C.menu.upload_method.STLinkMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER
Eventually try to use the same upload flags in STLink upload case as in serial upload case, maybe it has something to do with them.
miki
Posts: 26
Joined: Mon Jan 27, 2020 3:39 pm

Re: Interesting problem

Post by miki »

If you use maple lib I assume you are using Roger's core.
There is a difference in using the two upload methods in boards.txt:
Yes I use roger core.I was sure somebody would raise eventually the uploading issue,
I used the same binary file for flashing.
I compiled the program with serial option not with STlink one in Tools/Board and used to flash with Stlink.I used Flashing with FTDI serial after as debug tool see what is the problem.Found out that after flashing with serial, the program is working.

If I compile with ST link option and flash the program is messed up and have unpredictable behaviour.I don't upload via arduino ide.

About roger bootloader that is USB based, my project has no USB port.
I mention also that my project doesn't use SWD pins they are not defined.
Last edited by miki on Tue Jan 28, 2020 9:41 am, edited 1 time in total.
User avatar
Bakisha
Posts: 139
Joined: Fri Dec 20, 2019 6:50 pm
Answers: 5
Contact:

Re: Interesting problem

Post by Bakisha »

In your code, do you use pins PA13 or PA14? (SWDIO and SWCLK) Or in some way set them as inputs/output (individually or as portA manipulation). Maybe it's in conflict with st-link's pins.
miki
Posts: 26
Joined: Mon Jan 27, 2020 3:39 pm

Re: Interesting problem

Post by miki »

I replied already.I was thinking about that when I saw first time the problem.
No they are not defined.Maybe they are affected somehow but I don't see it right now.I have some PA pins defined as analog pins but not those.
I have activated some priority interrupts on maybe that can be a problem I will play with that to check.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Interesting problem

Post by ag123 »

try roger's bootloader, that's probably a effective solution, no need for uart, boot0 pins, st-link etc, just a usb cable solves it. triggering reset is simply the DTR + 'LEAF' magic code, search in tools folder for the utilities
for uart one should preferably control the boot0 and reset pins as well for a complete solution, if those pins are not accessible i'd think roger's libmaple boot loader is an effective way out
miki
Posts: 26
Joined: Mon Jan 27, 2020 3:39 pm

Re: Interesting problem

Post by miki »

I thought roger bootloader needs usb to work.If it works without I'm definitely interested.

I hope it is not using too much time to boot.These bootloaders have a check at start some waiting for 2 seconds waiting for command before switching to main program.I need to enter in main program in max 100-200ms.
Last edited by miki on Tue Jan 28, 2020 10:06 am, edited 2 times in total.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Interesting problem

Post by ag123 »

but i'd guess one can also write a 'boot loader' if one is so inclined, just that it'd take some effort to do so
roger's is the libmaple usb DFU updater. it is a simplest way to install a sketch with just a usb cable
miki
Posts: 26
Joined: Mon Jan 27, 2020 3:39 pm

Re: Interesting problem

Post by miki »

STM32 has already its own internal bootloader.If I have already an easy method to jump in from application there is no point to make a new bootloader.
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Interesting problem

Post by stevestrong »

Well, if you build with serial upload method and upload with serial method, and it works, then I do not see any reason why to build using the STLink method. Just keep the working scheme.

OTOH, Roger's core is designed to be used with Arduino IDE. If you are using a different IDE, then please understand that support cannot be guaranteed.
Post Reply

Return to “General discussion”