Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

cannot use stm32's built in timers #6

Open
Joshy-2010 opened this issue May 18, 2021 · 5 comments
Open

cannot use stm32's built in timers #6

Joshy-2010 opened this issue May 18, 2021 · 5 comments

Comments

@Joshy-2010
Copy link

Then I try any example sketch what needlessly compiled on my windows machine i get the following error:
'TIMERX_BASE' was not declared in this scope; did you mean 'TIMX_BASE'? (x for timer number)
Then I use TIMX_BASE instead as suggest I get the following error:
TIMX_BASE is not a pointer

Is there any way to solve this issue other than definig all the pointers myself?

PS: Not meant to sound rude, amazing work getting stm32 support to run on Raspberry Pi at all!

@koendv
Copy link
Owner

koendv commented May 18, 2021 via email

@Joshy-2010
Copy link
Author

Yes, i am setting the registers directly. Thank you for your tip, i will look into that

@koendv
Copy link
Owner

koendv commented May 18, 2021 via email

@Joshy-2010
Copy link
Author

Joshy-2010 commented May 30, 2021

Ok, sorry for the previous post, now I understand the matter better. I was just getting into stm32 programming again and opened some of my over 2 years old programms and wondered why I was getting tons of error messages, especially relating to timers and I2C.

I now realised that I had previously used some (outdated?) stm32-core, as opposed to the new (and in many ways better, for example software serial and the ability to change Hardware serial pins to Alt) stm32duino cores (https://github.com/stm32duino/Arduino_Core_STM32), on which this raspberry core is also based, right??? Unfortunately quite a few definitions have changed since then. That's why it was working on the windows machine (which used the old core) and not the raspberry.
(BTW: for anyone wondering why the heck I program stm32's on a raspberry: I have a workshop in the basement and recently installed a raspberry there to debug stuff and quickly change small lines of code)

Anyway I found the definitions for the addresses of the timer registers in the old core and will be collecting and pasting them in a small, custom file which I can include every time I want to control timers directly (like a small library, if that makes sense).
I will also look into the new, much nicer library (https://github.com/stm32duino/wiki/wiki/HardwareTimer-library???) which is nowadays used to control the timers, but I just don't have the nerves to rewrite hundreds of lines of old code.

If your interested I can post my little timer definitions file here afterwards.

@koendv
Copy link
Owner

koendv commented Jun 1, 2021

Glad you found it. Yes, this is a port of the "official" STMicroelectronics stm32 core to raspberry.
Among the differences: downloading firmware to stm32 using open source tools instead of using proprietary STM "ST-Link" soft- and hardware.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants