[SOLVED] tone() not working on F072-Discovery

Please post bugs and enhancements for the STM core here
User avatar
ekawahyu
Posts: 107
Joined: Wed Apr 13, 2016 6:17 am

Re: tone() not working on F072-Discovery

Post by ekawahyu » Sun Sep 24, 2017 3:30 pm

Yes, it is for the Makefile and debugging purposes. It is not in the main branch anyway, but I tend to keep it later in case I need to do debugging with ST-Link through OpenOCD. I just don't know a better way of keeping Makefile and CMSIS of the main branch later on.

I would actually propose to keep the Makefile in the main branch if you guys ok with adding it. I can modify it to look for 4.5.0 header files in the Arduino package. Just let me know what would be the best on the roadmap and I can do PR that way. Thank you.

fpiSTM
Posts: 192
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: tone() not working on F072-Discovery

Post by fpiSTM » Mon Sep 25, 2017 11:33 am

Issue has been identified.
Some irq handler name was wrong (TIM1 for ex) and some are missing.
Patch will be done soon.

About adding the Makefile, why not but it seems very specific to one target.
For CMSIS header it should be fine to use one from the CMSIS package to avoid having twice the same file.

User avatar
ekawahyu
Posts: 107
Joined: Wed Apr 13, 2016 6:17 am

Re: tone() not working on F072-Discovery

Post by ekawahyu » Mon Sep 25, 2017 2:57 pm

Cool! Looking forward to the fix!

The Makefile needs some work to build all device drivers as libraries, build it once, keep it somewhere, and rebuild it only when there is version update. Unfortunately, I don't have all of those boards to test the Makefile builds, but I can try to make it generic before doing PR.

The only confusing thing right now is where to build the USB libraries for HID and CDC supports. Should it be put as part of the device driver or individually in each variant? What is the status of HID and CDC support? I am trying to build CDC ACM stack from STM32CubeMX, but it does not seem generic enough.

User avatar
Rick Kimball
Posts: 1014
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: tone() not working on F072-Discovery

Post by Rick Kimball » Mon Sep 25, 2017 3:13 pm

ekawahyu wrote:
Sun Sep 24, 2017 3:30 pm
Yes, it is for the Makefile and debugging purposes. It is not in the main branch anyway, but I tend to keep it later in case I need to do debugging with ST-Link through OpenOCD. I just don't know a better way of keeping Makefile and CMSIS of the main branch later on.
You can debug the arduino .elf files without doing your own make. Just go to the build output directory (/tmp/arduino_build_xxx for linux) start up gdb and debug away.

I'm opposed to putting this type of thing into the arduino core. I don't think this stuff is in the spirit of Arduino. Arduino uses the builder application and goes out of its way to avoid make and makefiles.

If you want to do your own thing while retaining the ability to customize your copy you might look at this:
http://stm32duino.com/viewtopic.php?t=1741
-rick

User avatar
ekawahyu
Posts: 107
Joined: Wed Apr 13, 2016 6:17 am

Re: tone() not working on F072-Discovery

Post by ekawahyu » Mon Sep 25, 2017 3:24 pm

Rick Kimball wrote:
Mon Sep 25, 2017 3:13 pm
ekawahyu wrote:
Sun Sep 24, 2017 3:30 pm
Yes, it is for the Makefile and debugging purposes. It is not in the main branch anyway, but I tend to keep it later in case I need to do debugging with ST-Link through OpenOCD. I just don't know a better way of keeping Makefile and CMSIS of the main branch later on.
You can debug the arduino .elf files without doing your own make. Just go to the build output directory (/tmp/arduino_build_xxx for linux) start up gdb and debug away.
Ok, will look into it. I know that Arduino has its build somewhere in /tmp, but I didn't have the time to find out how it works with all those random generated _xxx thing. I has to be documented somewhere because looking for the .elf itself is already troublesome and it keeps changing location.

User avatar
Rick Kimball
Posts: 1014
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: tone() not working on F072-Discovery

Post by Rick Kimball » Mon Sep 25, 2017 3:34 pm

Just flip the checkbox in preferences to view the compile output directory. It will show you where the .elf is going.
-rick

User avatar
ekawahyu
Posts: 107
Joined: Wed Apr 13, 2016 6:17 am

Re: tone() not working on F072-Discovery

Post by ekawahyu » Mon Sep 25, 2017 4:19 pm

And how to take the path and fire up Eclipse debugging without doing it manually every time? I don't know how to configure the debugging launch with the .elf location that keeps changing. That's the reason why I had the separate Makefile from the first place.

Ultimately the goal is being able to use both Arduino and SystemWorkbench side-by-side. If that's the path we wanted to go to. I am not the decision maker here though.

EDIT: Hmmm... there should be a script that automatically generates Eclipse debug launch every time a .elf is built

User avatar
Rick Kimball
Posts: 1014
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: tone() not working on F072-Discovery

Post by Rick Kimball » Mon Sep 25, 2017 4:55 pm

viewtopic.php?f=35&t=113#p837 although personally I just use the command line arm-none-eabi-gdb
-rick

User avatar
ekawahyu
Posts: 107
Joined: Wed Apr 13, 2016 6:17 am

Re: tone() not working on F072-Discovery

Post by ekawahyu » Mon Sep 25, 2017 6:51 pm

Rick Kimball wrote:
Mon Sep 25, 2017 4:55 pm
viewtopic.php?f=35&t=113#p837 although personally I just use the command line arm-none-eabi-gdb
Your GitHub links are dead, so where can I get the script from?
Last edited by ekawahyu on Tue Sep 26, 2017 9:02 pm, edited 1 time in total.

User avatar
ekawahyu
Posts: 107
Joined: Wed Apr 13, 2016 6:17 am

Re: [SOLVED]tone() not working on F072-Discovery

Post by ekawahyu » Tue Sep 26, 2017 5:52 pm

@fpiSTM I merged changes from @fprwi6labs and TIM14 seems to be working just fine. Thanks!

Post Reply