udoklein / dcf77

Noise resilient DCF77 decoder library for Arduino
http://blog.blinkenlight.net/experiments/dcf77/dcf77-library/
GNU General Public License v3.0
93 stars 28 forks source link

Compiles, uploads but doesn't run on black pill #37

Open ratkins opened 5 years ago

ratkins commented 5 years ago

I'm attempting to run the library on an STM32 "black pill". I see #defines in the code, and a couple of closed issues here, indicating at least one other person has made this work. There are two issues:

1) The Arduino IDE places the dcf77_xtal examples under an INCOMPATIBLE submenu, indicating the "Generic STM32F103C series" board's architecture isn't supported. I think fixing this is just a matter of adding "arm" to the architectures list in library.properties?

2) In any case when I select one of the examples (like DCF77_Scope) and change the pin assignments for my board, it compiles and uploads fine but doesn't run. I don't get any output in the serial monitor and the LED doesn't flash. I've made both of those things work independently with other sketches uploaded by the same method so I'm pretty sure the board itself works fine.

Any idea what I could try to debug this?

udoklein commented 5 years ago

I was reluctant to add STM32 support because I have no boards to test it. Now you confirm that there are issues. My stance is: if you figure it out and say it is good for you I would merge a pull request. But I am sorry I have no idea how to debug this.

I also do not know what happens if I add arm to the architectures. Since you state that it does not work 100% I would rather not add it. Once I add it people will rightfully expect that it works.

ratkins commented 5 years ago

I've got a bunch of STM32 boards here and would be happy to send you one if you're interested (no obligation to actually fix my issue, of course.)

udoklein commented 5 years ago

Yeah, you can send me a board. However at this time I am moving to a new flat --> I will be slow to respond. Also I will not send the board back when I am done. If this is OK for you then send me a board. Is the board supported out of the box by the IDE or do I need something special to install?

ratkins commented 5 years ago

You can either upload directly with a USB serial adapter or flash a bootloader. I've made it work with both methods, but it's a bit fiddly (esp. on macOS, there's no one place with all the instructions in a sensible order.)

Send me an email (my GitHub handle @fastmail.fm) with your address.

udoklein commented 5 years ago

My Mail account is currently inaccessible. You can find my address here though: https://blog.blinkenlight.net/licenses/

udoklein commented 5 years ago

As I said I will take very long because I have some issues :( Anyway today I found some time to look into it. The latest merge should have added support for blue pill which should be compatible with black pill. Do you have version 3.3.3? If so, does the DCF77 scope work as it should? What output does it generate?

I am still digging in my huge pile of electronics for some 3V3 serial adapter. I know I own at least 3, but I am still digging. So I have not yet tested on my own. Anyway can you tell me which version of the library you are using?

nameoftherose commented 4 years ago

You might like to know that the library compiles for and runs on the Arduino Nano 33 IOT. Incidentally 33 IOT is crystal-less. No modifications to the DUE code were needed, one simply has to also enable the relevant code in dcf77.cpp for the __SAMD21G18A__ mcu.

udoklein commented 4 years ago

Interesting. Does it lock to DCF77 without a crystal? Or does it just execute?

nameoftherose commented 4 years ago

It does lock to DCF77. But SAMD21 may derive a reference clock from USB and Arduino seems to use this feature. This means that if it is used standalone, clock stability will suffer. During the test Nano 33iot was connected to a PC. I also operated the IOT33 standalone for a few hours, as expected, it did not sync afterwards and time error reached 5min. I have since terminated the experiment. The library can be considered as successfully operating on SAMD21 boards, provided they have a stable clock.