Skip to content

Variant.h for RUMBA32 #731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MagoKimbra opened this issue Oct 24, 2019 · 10 comments
Closed

Variant.h for RUMBA32 #731

MagoKimbra opened this issue Oct 24, 2019 · 10 comments
Labels
answered question ❓ Usually converted as a discussion

Comments

@MagoKimbra
Copy link

Please enter the TIMER_SERIAL define in variant.h of rumba32.
If the SoftwareSerial.h library is included, as is the case with the TMCStepper library, SoftwareSerial takes the timer 7 for the STM32F446 processor which is the same one used by the servo and in fact no longer works.
I put #define TIMER_SERIAL 8 in variant.h so the servo works, but I don't know if the SoftwareSerial library works, it should be verified ...

@fpistm
Copy link
Member

fpistm commented Oct 24, 2019

Hi @MagoKimbra
in this case you could provide a PR.
This is well explained here:

#define HALFDUPLEX_SWITCH_DELAY 5
// It's best to define TIMER_SERIAL in variant.h. If not defined, we choose one here
// The order is based on (lack of) features and compare channels, we choose the simplest available
// because we only need an update interrupt
#if !defined(TIMER_SERIAL)
#if defined (TIM18_BASE)
#define TIMER_SERIAL TIM18
#elif defined (TIM7_BASE)
#define TIMER_SERIAL TIM7
#elif defined (TIM6_BASE)

So I guess there is no TIM18 for F446 and then TIM7 is used.

@MagoKimbra
Copy link
Author

Yes, TIM18 not define for STM32F466 and use the first TIM7.
I tried to put the define in my HAL firmware, but it is not seen by SoftwareSerial.cpp.

@fpistm
Copy link
Member

fpistm commented Oct 24, 2019

Don't know your HAL firmware but if set in variant.h this should be ok

@MagoKimbra
Copy link
Author

Yes yes in variant.h the servo works perfectly. I tried to put the define in my firmware which includes the TMCstepper.h library which in turn includes the Softwareserial.h library, but unfortunately the define is not seen, I said this.

@fpistm
Copy link
Member

fpistm commented Oct 24, 2019

ok.
Other way is to use build_opt.h or maybe the hat_conf_extra.h.

@fpistm
Copy link
Member

fpistm commented Oct 28, 2019

@MagoKimbra
which timer you want for TIMER_Serial per default ?

@fpistm fpistm added the waiting feedback Further information is required label Oct 28, 2019
@MagoKimbra
Copy link
Author

TIM9. Thank's.
I use TIM2 for stepper, SysTick for the rest. There are still TIM5 32bit, TIM3, TIM4, TIM10-TIM14 at 16bit for other things.

@fpistm
Copy link
Member

fpistm commented Oct 28, 2019

Well, I will not modify the variant as this will fix it for all users and they do not want necessarily to use this one.
In your case you have to add hal_conf_extra.h with
#define TIMER_SERIAL TIM9

@fpistm fpistm closed this as completed Oct 28, 2019
@fpistm fpistm added answered question ❓ Usually converted as a discussion and removed waiting feedback Further information is required labels Oct 28, 2019
@MagoKimbra
Copy link
Author

Where i add hal_conf_extra.h??? in Myfirmware or in library STM32???

@fpistm
Copy link
Member

fpistm commented Oct 28, 2019

When using Arduino IDE, simply adding it at sketch level works.
While the file is in the include path this will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered question ❓ Usually converted as a discussion
Projects
None yet
Development

No branches or pull requests

2 participants