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] Can't Compile (STM32F4-RUMBA32) fails SPI / DMA #16029

Closed
BoHoehne opened this issue Nov 27, 2019 · 10 comments
Closed

[BUG] Can't Compile (STM32F4-RUMBA32) fails SPI / DMA #16029

BoHoehne opened this issue Nov 27, 2019 · 10 comments

Comments

@BoHoehne
Copy link

Description

Trying to compile Marlin 2.x for RUMBA32 (STM32F4).
The stepper drivers are TMC5160 with SPI connection.
Environment: VSCode / PlatformIO

Error:
Marlin\src\HAL\HAL_STM32_F4_F7\HAL_SPI.cpp:125:9: error: 'class SPIClass' has no member named 'dmaTransfer'; did you mean 'transfer'?
SPI.dmaTransfer(0, const_cast<uint8_t*>(buf), nbyte);
^~~~~~~~~~~
transfer
Marlin\src\HAL\HAL_STM32_F4_F7\HAL_SPI.cpp: In function 'void spiSendBlock(uint8_t, const uint8_t*)':
Marlin\src\HAL\HAL_STM32_F4_F7\HAL_SPI.cpp:158:9: error: 'class SPIClass' has no member named 'dmaSend'
SPI.dmaSend(const_cast<uint8_t*>(buf), 512);
^~~~~~~

  1. Working VSCode with PlatformIO
  2. Settings in platform.ini: -> [platformio] -> default_envs = STM32F4
  3. Configured "configuration.h" as follows:

#define MOTHERBOARD BOARD_RUMBA32
..
#define X_DRIVER_TYPE TMC5160
#define Y_DRIVER_TYPE TMC5160
#define Z_DRIVER_TYPE TMC5160
#define E0_DRIVER_TYPE TMC5160
#define E1_DRIVER_TYPE TMC5160
#define E2_DRIVER_TYPE TMC5160

Expected behavior:
Successful compilation

Actual behavior:
Compile aborts with above errors.

@sjasonsmith
Copy link
Contributor

The STM32 HALs get pretty confusing.

I believe that when you build for a Rumba32 inside Arduino IDE it uses HAL_STM32, whereas that STM32F4 environment uses HAL_STM32_F4_F7.

The SKR Pro is the best example of an STM32F4 building with HAL_STM32. The FYSETC S6 does also, but it was just added yesterday and isn't fully tested.

There will likely be more work needed than simply copying and editing a new environment, but that is not a process I am familiar with.

@LinoBarreca
Copy link
Contributor

just retarget the board to stm32 hal

@boelle
Copy link
Contributor

boelle commented Dec 7, 2019

@BoHoehne did you figure the issue?

@BoHoehne
Copy link
Author

BoHoehne commented Dec 7, 2019

When I set the board in platformio.ini as "STM32_hal" I get the following error:

Error: BoardConfig: Board is not defined

Unsure what to configure:
[env:STM32_hal]
board = ???

Unsure what to insert there.
Hints are welcome.

@LinoBarreca
Copy link
Contributor

@BoHoehne I don't know how to build rumba but to change the hal change

[env:STM32F4]
platform      = ststm32
framework     = arduino
board         = disco_f407vg
build_flags   = ${common.build_flags} -DUSE_STM32GENERIC -DSTM32GENERIC -DSTM32F4 -DMENU_USB_SERIAL -DMENU_SERIAL=SerialUSB -DHAL_IWDG_MODULE_ENABLED
lib_deps      = ${common.lib_deps}
lib_ignore    = Adafruit NeoPixel, TMCStepper
src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32_F4_F7> -<src/HAL/HAL_STM32_F4_F7/STM32F7>
monitor_speed = 250000

into

[env:STM32F4]
platform      = ststm32
framework     = arduino
board         = disco_f407vg
build_flags   = ${common.build_flags}  -DTARGET_STM32F4 -DSTM32F4 -DMENU_USB_SERIAL -DMENU_SERIAL=SerialUSB
  -IMarlin/src/HAL/HAL_STM32
lib_deps      = ${common.lib_deps}
lib_ignore    = Adafruit NeoPixel, TMCStepper
src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32>
monitor_speed = 250000

@BoHoehne
Copy link
Author

BoHoehne commented Dec 9, 2019

Thank you.
That changed something. Now the error looks like this:

Marlin\src\HAL\shared\backtrace../../../core/../inc/../HAL/./HAL_STM32/HAL.h:54:21: error: 'SerialUSB' was not declared in this scope

@wap32
Copy link

wap32 commented Dec 10, 2019

Check Aus3D/RUMBA32#11, I posted my platformio config which works for me.

@BoHoehne
Copy link
Author

@wap32 <- Thank you so much !!!

Compile went thru without any problem. Yippie !!

@boelle
Copy link
Contributor

boelle commented Dec 11, 2019

will close as this is most likely a config problem and not a marlin problem

@github-actions
Copy link

github-actions bot commented Jul 3, 2020

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 Jul 3, 2020
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

5 participants