Errors when BUILD_MODULE_ENABLE_CONTACTOR set to 0
Closed this issue · 1 comments
When setting the BUILD_MODULE_ENABLE_CONTACTOR
switch to 0
I get the following errors when attempting to recompile the primary MCU binary:
err: embedded-software\mcu-primary\src\application\libfoxbms-application.a(bms.c.1.o): In function `BMS_CheckCurrent':
C:\Programming\foxbms\build\primary/..\..\embedded-software\mcu-primary\src\application\bms/bms.c:977: undefined reference to `CONT_GetActivePowerLine'
collect2.exe: error: ld returned 1 exit status
The problem seems to be the reference to the BMS_CheckCurrent
function in bms.c
. The function CONT_GetActivePowerLine
is being referenced without a declaration or definition due to it being effectively removed from the code base by pre-processor(s) when BUILD_MODULE_ENABLE_CONTACTOR
is set to 0.
Adding the following lines of code (in bms.c
) fixes the problem, but this seems temporary at best:
- Above line 976:
#if BUILD_MODULE_ENABLE_CONTACTOR == 1
- Above line 1029:
#endif
I can create a pull request to remedy the issue if necessary.
Relevant files:
Dear @AVanDeBrook,
thanks for pointing us at this compile error.
For safety reasons a BMS application is usually not built without a contactor (or at least a similar controllable disconnecting device).
However there might be valid reasons to do so, and therefore it is now (since v1.6.6) possible to build the BMS application without enabling any contactors on the primary MCU.
If the contactor module is now disabled, the current limits are now (per default) checked against configured current limits of the power line 0.
Thanks for your input.
Best regards,
The foxBMS Team