Skip to content
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

[BUG] MKS TinyBee build error: HAL.h: 'spinlock' was not declared in this scope #24440

Closed
2 tasks done
eduard-sukharev opened this issue Jul 2, 2022 · 3 comments
Closed
2 tasks done

Comments

@eduard-sukharev
Copy link
Contributor

eduard-sukharev commented Jul 2, 2022

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

When attempting to build Marlin bugfix-2.1.x for MKS TinyBee board I get error

In file included from /home/kraplax/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/portable.h:94:0,
                 from /home/kraplax/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/FreeRTOS.h:105,
                 from /home/kraplax/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:32,
                 from Marlin/src/libs/../inc/../HAL/./ESP32/../shared/Marduino.h:36,
                 from Marlin/src/libs/../inc/../HAL/./ESP32/HAL.h:30,
                 from Marlin/src/libs/../inc/../HAL/HAL.h:30,
                 from Marlin/src/libs/../inc/MarlinConfig.h:31,
                 from Marlin/src/libs/buzzer.cpp:23:
Marlin/src/libs/buzzer.cpp: In static member function 'static void Buzzer::tick()':
Marlin/src/libs/../inc/../HAL/./ESP32/HAL.h:63:54: error: 'spinlock' was not declared in this scope
 #define CRITICAL_SECTION_START() portENTER_CRITICAL(&spinlock)
                                                      ^
/home/kraplax/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/portmacro.h:232:59: note: in definition of macro 'portENTER_CRITICAL'
 #define portENTER_CRITICAL(mux)        vTaskEnterCritical(mux)
                                                           ^
Marlin/src/libs/buzzer.cpp:73:9: note: in expansion of macro 'CRITICAL_SECTION_START'
         CRITICAL_SECTION_START();
         ^

I have tried with 2.1 and the error is pretty much the same.

Bug Timeline

MKS TinyBee support introduced in 2.0.9.3
Somewhere between 2.0.9.3 and 2.0.9.4 this extern was removed:
https://github.com/MarlinFirmware/Marlin/blame/2.0.9.3/Marlin/src/HAL/ESP32/HAL.h#L52 which, according to my understanding, led to this error.
I have hunted down the issue root cause and it seem to be this PR with HAL refactoring by @thinkyhead

Expected behavior

I expected Marlin firmware to either build, or provide me with hints on which config parameters to alter so that it can be built.

Actual behavior

Build failed with obscure compilation error

Steps to Reproduce

  1. Checkout bugfix-2.1.x
  2. set MOTHERBOARD to BOARD_MKS_TINYBEE
  3. enable MKS_MINI_12864 and SPEAKER support
  4. Set default_envs = mks_tinybee in platformio.ini
  5. Build with pio run

Version of Marlin Firmware

2.1, also bugfix-2.1.x

Don't forget to include

@eduard-sukharev
Copy link
Contributor Author

Ok, I have managed to strip down all the unrelated changes and it seems like build fails for BOARD_MKS_TINYBEE when MKS_MINI_12864 and SPEAKER are enabled.
I'll update the issue to reflect that.

eduard-sukharev added a commit to eduard-sukharev/Marlin that referenced this issue Jul 5, 2022
See Issue MarlinFirmware#24440:

Build error: HAL.h: 'spinlock' was not declared in this scope
@ellensp
Copy link
Contributor

ellensp commented Jul 6, 2022

Your Pr has been merged, closing.

@github-actions
Copy link

github-actions bot commented Sep 4, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2022
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