-
Notifications
You must be signed in to change notification settings - Fork 983
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
the enum constants is not possible to use in preprocessor conditions #587
Comments
Hi @linvinus |
In this year several new the electronic board,based on SMT32 , for 3D printers was released. For example: So marlin port for STM32 will be more and more popular.
Yes marlin 2.0 (bugfix-2.0.x branch) is already supporting STM32F1 and STM32F4 based electronic boards, but currently it in alpha state, mostly working but have some problems, not all of them may reveal at compiling time. Official status is here MarlinFirmware/Marlin#14345 |
OK, thanks for the feedback. |
@linvinus The issues you have linked seem to affect the STM32F1 HAL (HAL_STM32F1), which uses another Arduino Core. Are you sure that it also affects the STM32 HAL? (HAL_STM32) Marlin right now has THREE STM32 HALs. I and some other developers added a generalized STM32 HAL, but not all boards made the switch yet. |
@hasenbanck Oopse, you are right! marlin use platformio which have ststm32 module, I'm sorry, my mistake! But any way the same problem is present here. |
Do you simply assume that the problem is there (when using this core) or
did you test it? The issue you linked also seem to fix the problem inside
Marlin (referenced PR).
|
As I said above, I did not know that Marlin uses three different HALs, so no, I have not tested stm32duino as a core yet. |
Well, until a clear the status. @hasenbanck IIRW you told me Marlin waited for a Hardware Timer library, FYI the PR was submitted. |
I think this has already been fixed. Most boards add a set of #defines similar to this:
And that hardware timer library should make it possible to support most ST boards from one HAL. Good stuff. |
Ok, looking deeply in issues referenced by @linvinus. So I close this one as already solved. |
Because of most constants (like pins Px[0-16], AFIO_, STM_PIN_ ) defined as enum, it is not possible to use them in preprocessor conditions.
Because of that Marlin port for STM32 have unpredictable behavior
MarlinFirmware/Marlin#14777
MarlinFirmware/Marlin#14711
MarlinFirmware/Marlin#14732
In contrast the arduino port for LPC176x, where pins and other constants is defined as macro definitions https://github.com/p3p/pio-framework-arduino-lpc176x/blob/b3635e53cbd2b6481b207eda668e47dbe712f1e7/cores/arduino/pinmapping.h
Marlin developers has make workaround to resolve this problem https://github.com/MarlinFirmware/Marlin/pull/14785/files
But i believe that problem must be resolved on stm32duino side, i think implementation similar to LPC176x port will be nice.
Similar problem already was discussed earlier, for example here #140 (comment)
The text was updated successfully, but these errors were encountered: