PlatformIO Community

Can't compile Marlin bugfix firmware for ender 5 pro

Hi all.
I’m having some trouble compiling firmware for my ender 5 pro 3D printer with mainboard V4.2.2. I downloaded VSC for the first time yesterday, installed platformio IDE and Auto Build Marlin, just like Teaching Tech suggested (Updated Marlin firmware setup guide - VS Code and Auto Build Marlin - YouTube) and it actually worked fine.
Today it didn’t work like yesterday, despite that I’ve only turned off the PC for the night.
I thought that perhaps if I posted my uncompiled firmware here, then one of you guys could try and compile it, see what errors pops up, and then try to sort out the threads. It’s not that i want you to do all the work here, i just think it’s the easiest and fastest way to let you know what the issue is, needless to say I’m not good with coding.

Anyway, take a look at the dropbox, the files should be available for you to download. (Dropbox - Marlin-firmware - Simplify your life)
Also, this is where the errors starts appearing;

Compiling .pio\build\STM32F103RET6_creality_maple\src\src\libs\vector_3.cpp.o
Compiling .pio\build\STM32F103RET6_creality_maple\src\src\module\endstops.cpp.o
In file included from Marlin\src\libs…/inc/…/HAL/HAL.h:30:0,
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/./STM32F1/HAL.h:183:40: error: ‘primask’ was not declared in this scope
#define CRITICAL_SECTION_END() if (!primask) (void)__iSeiRetVal()
^
Marlin\src\libs\buzzer.cpp:75:9: note: in expansion of macro ‘CRITICAL_SECTION_END’
CRITICAL_SECTION_END();
^~~~~~~~~~~~~~~~~~~~
Marlin\src\libs…/inc/…/HAL/./STM32F1/HAL.h:183:40: note: suggested alternative: ‘fd_mask’
#define CRITICAL_SECTION_END() if (!primask) (void)__iSeiRetVal()
^
Marlin\src\libs\buzzer.cpp:75:9: note: in expansion of macro ‘CRITICAL_SECTION_END’
CRITICAL_SECTION_END();
^~~~~~~~~~~~~~~~~~~~
Marlin\src\libs…/inc/…/HAL/./STM32F1/HAL.h:182:46: warning: unused variable ‘irqon’ [-Wunused-variable]
#define CRITICAL_SECTION_START() const bool irqon = !__get_primask(); (void)__iCliRetVal()
^
Marlin\src\libs\buzzer.cpp:73:9: note: in expansion of macro ‘CRITICAL_SECTION_START’
CRITICAL_SECTION_START();
^~~~~~~~~~~~~~~~~~~~~~
Compiling .pio\build\STM32F103RET6_creality_maple\src\src\module\motion.cpp.o
Compiling .pio\build\STM32F103RET6_creality_maple\src\src\module\planner.cpp.o
*** [.pio\build\STM32F103RET6_creality_maple\src\src\libs\buzzer.cpp.o] Error 1
=========================================== [FAILED] Took 45.60 seconds ===========================================

Environment Status Duration


STM32F103RET6_creality_maple FAILED 00:00:45.596
====================================== 1 failed, 0 succeeded in 00:00:45.596 ======================================
PS C:\Users\Kevin\Desktop\Marlin-firmware\Marlin-2.0.x> echo “done” >“C:\Users\Kevin\AppData\Local\Temp\ipc”
PS C:\Users\Kevin\Desktop\Marlin-firmware\Marlin-2.0.x>

This download is incomplete – it’s missing Marlin’s platformio.ini and entire folders within Marlin/, like src/HAL.

I’d suggest you redownload Marlin and try it from a clean copy.

Additionally, the folder name Marlin-2.0.x in the archive suggests that you have downloaded the 2.0.x of Marlin, not the bugfix-2.0.x branch suggested in the topic.

Hi.
I think that Dropbox doesn’t handle certain folders, they are on my PC.

Anyway I actually got it to work. For people who hit this post with google, what I did was the following;

  1. open up the platformio.ini file in a text editor, it’s located somewhere in the marlin file that you downloaded.

  2. change the “default_envs” from mega2560 to either;
    STM32F103RET6_creality
    Or
    STM32F103RET6_creality_maple

Case closed. :slight_smile: