DanielMartensson/Open-SAE-J1939

Problems importing to Keil

kaiqued opened this issue · 1 comments

When building with keil I'm having some trouble... Don't know if I'm doing something wrong :/

Rebuild started: Project: BLUEPILL_CAN
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'BLUEPILL_CAN'
assembling startup_stm32f103xb.s...
compiling stm32f1xx_it.c...
compiling stm32f1xx_hal_msp.c...
compiling main.c...
compiling stm32f1xx_hal.c...
compiling stm32f1xx_hal_gpio_ex.c...
compiling stm32f1xx_hal_can.c...
compiling stm32f1xx_hal_rcc_ex.c...
compiling stm32f1xx_hal_gpio.c...
compiling stm32f1xx_hal_rcc.c...
compiling stm32f1xx_hal_cortex.c...
compiling stm32f1xx_hal_pwr.c...
compiling stm32f1xx_hal_dma.c...
compiling stm32f1xx_hal_flash.c...
compiling stm32f1xx_hal_exti.c...
compiling stm32f1xx_hal_flash_ex.c...
compiling stm32f1xx_hal_tim_ex.c...
compiling stm32f1xx_hal_tim.c...
compiling stm32f1xx_hal_uart.c...
compiling Request.c...
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-21_Transport_Layer../../ISO_11783/ISO_11783-7_Application_Layer/../../SAE_J1939/SAE_J1939-21_Transport_Layer/../SAE_J1939-71_Application_Layer/Application_Layer.h(13): error: #5: cannot open source input file "../SAE_J1939-21_Transport_Layer/Transport_Layer.h": No such file or directory
#include "../SAE_J1939-21_Transport_Layer/Transport_Layer.h"
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-21_Transport_Layer\Request.c: 0 warnings, 1 error
compiling Acknowledgement.c...
compiling Transport_Protocol_Connection_Management.c...
compiling Transport_Protocol_Data_Transfer.c...
compiling Request_Component_Identification.c...
compiling Request_ECU_Identification.c...
compiling Request_Software_Identification.c...
compiling DM16.c...
compiling system_stm32f1xx.c...
compiling DM15.c...
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM15.c(18): error: #18: expected a ")"
response_data[1] = (number_of_allowed_bytes >> 3) | (0b1 << 4) | (status << 1) | 0b1; /* bit 5 and 1 are reserved /
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM15.c(18): error: #65: expected a ";"
response_data[1] = (number_of_allowed_bytes >> 3) | (0b1 << 4) | (status << 1) | 0b1; /
bit 5 and 1 are reserved /
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM15.c(34): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm15.status = (data[1] >> 1) & 0b0000111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM15.c: 0 warnings, 3 errors
compiling DM14.c...
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM14.c(18): error: #65: expected a ";"
data[1] = (number_of_requested_bytes >> 3) | (pointer_type << 4) | (command << 1) | 0b1;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM14.c(34): error: #18: expected a ")"
uint16_t number_of_requested_bytes = ((data[1] & 0b11100000) << 3) | data[0];
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM14.c(35): error: #65: expected a ";"
uint8_t pointer_type = (data[1] >> 4) & 0b0001;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM14.c(36): error: #65: expected a ";"
uint8_t command = (data[1] >> 1) & 0b0000111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM14.c(63): warning: #188-D: enumerated type mixed with another type
return status;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM14.c: 1 warning, 4 errors
compiling DM3.c...
compiling DM2.c...
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM2.c(30): error: #18: expected a ")"
data[4] = ((j1939->this_dm.dm2.SPN >> 11) & 0b11100000) | j1939->this_dm.dm2.FMI;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM2.c(44): error: #18: expected a ")"
data[4] = ((j1939->this_dm.dm2.SPN >> 11) & 0b11100000) | j1939->this_dm.dm2.FMI;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM2.c(62): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm2.SAE_lamp_status_red_stop = (data[0] >> 4) & 0b00000011;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM2.c(63): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm2.SAE_lamp_status_amber_warning = (data[0] >> 2) & 0b00000011;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM2.c(64): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm2.SAE_lamp_status_protect_lamp = data[0] & 0b00000011;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM2.c(66): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm2.SAE_flash_lamp_red_stop = (data[1] >> 4) & 0b00000011;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM2.c(67): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm2.SAE_flash_lamp_amber_warning = (data[1] >> 2) & 0b00000011;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM2.c(68): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm2.SAE_flash_lamp_protect_lamp = data[1] & 0b00000011;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM2.c(69): error: #18: expected a ")"
j1939->from_other_ecu_dm.dm2.SPN = ((data[4] & 0b11100000) << 11) | (data[3] << 8) | data[2];
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM2.c(70): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm2.FMI = data[4] & 0b00011111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM2.c(72): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm2.occurrence_count = data[5] & 0b01111111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM2.c: 0 warnings, 11 errors
compiling DM1.c...
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM1.c(30): error: #18: expected a ")"
data[4] = ((j1939->this_dm.dm1.SPN >> 11) & 0b11100000) | j1939->this_dm.dm1.FMI;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM1.c(44): error: #18: expected a ")"
data[4] = ((j1939->this_dm.dm1.SPN >> 11) & 0b11100000) | j1939->this_dm.dm1.FMI;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM1.c(62): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm1.SAE_lamp_status_red_stop = (data[0] >> 4) & 0b00000011;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM1.c(63): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm1.SAE_lamp_status_amber_warning = (data[0] >> 2) & 0b00000011;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM1.c(64): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm1.SAE_lamp_status_protect_lamp = data[0] & 0b00000011;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM1.c(66): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm1.SAE_flash_lamp_red_stop = (data[1] >> 4) & 0b00000011;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM1.c(67): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm1.SAE_flash_lamp_amber_warning = (data[1] >> 2) & 0b00000011;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM1.c(68): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm1.SAE_flash_lamp_protect_lamp = data[1] & 0b00000011;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM1.c(69): error: #18: expected a ")"
j1939->from_other_ecu_dm.dm1.SPN = ((data[4] & 0b11100000) << 11) | (data[3] << 8) | data[2];
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM1.c(70): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm1.FMI = data[4] & 0b00011111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM1.c(72): error: #65: expected a ";"
j1939->from_other_ecu_dm.dm1.occurrence_count = data[5] & 0b01111111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-73_Diagnostics_Layer\DM1.c: 0 warnings, 11 errors
compiling Address_Claimed.c...
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Address_Claimed.c(46): error: #18: expected a ")"
j1939->from_other_ecu_name.identity_number = ((data[2] & 0b00011111) << 16) | (data[1] << 8) | data[0];
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Address_Claimed.c(49): error: #65: expected a ";"
j1939->from_other_ecu_name.ECU_instance = data[4] & 0b00000111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Address_Claimed.c(53): error: #65: expected a ";"
j1939->from_other_ecu_name.industry_group = (data[7] >> 4) & 0b0111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Address_Claimed.c(54): error: #65: expected a ";"
j1939->from_other_ecu_name.vehicle_system_instance = data[7] & 0b00001111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Address_Claimed.c: 0 warnings, 4 errors
compiling Address_Delete.c...
compiling Address_Not_Claimed.c...
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Address_Not_Claimed.c(33): error: #18: expected a ")"
j1939->from_other_ecu_name.identity_number = ((data[2] & 0b00011111) << 16) | (data[1] << 8) | data[0];
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Address_Not_Claimed.c(36): error: #65: expected a ";"
j1939->from_other_ecu_name.ECU_instance = data[4] & 0b00000111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Address_Not_Claimed.c(40): error: #65: expected a ";"
j1939->from_other_ecu_name.industry_group = (data[7] >> 4) & 0b0111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Address_Not_Claimed.c(41): error: #65: expected a ";"
j1939->from_other_ecu_name.vehicle_system_instance = data[7] & 0b00001111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Address_Not_Claimed.c: 0 warnings, 4 errors
compiling Commanded_Address.c...
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Commanded_Address.c(46): error: #18: expected a ")"
j1939->this_name.identity_number = ((data[2] & 0b00011111) << 16) | (data[1] << 8) | data[0];
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Commanded_Address.c(49): error: #65: expected a ";"
j1939->this_name.ECU_instance = data[4] & 0b00000111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Commanded_Address.c(53): error: #65: expected a ";"
j1939->this_name.industry_group = (data[7] >> 4) & 0b0111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Commanded_Address.c(54): error: #65: expected a ";"
j1939->this_name.vehicle_system_instance = data[7] & 0b00001111;
..\Core\Inc\Open_J1939\SAE_J1939\SAE_J1939-81_Network_Management_Layer\Commanded_Address.c: 0 warnings, 4 errors
compiling Listen_For_Messages.c...
..\Core\Inc\Open_J1939\Open_SAE_J1939../ISO_11783/ISO_11783-7_Application_Layer/../../SAE_J1939/SAE_J1939-21_Transport_Layer/../SAE_J1939-73_Diagnostics_Layer/../../Hardware/Memory/FLASH_EEPROM_RAM_Memory.h(14): error: #5: cannot open source input file "../../SAE_J1939/SAE_J1939_Enums/Enum_DM14_DM15.h": No such file or directory
#include "../../SAE_J1939/SAE_J1939_Enums/Enum_DM14_DM15.h"
..\Core\Inc\Open_J1939\Open_SAE_J1939\Listen_For_Messages.c: 0 warnings, 1 error
compiling Auxiliary_Valve_Command.c...
..\Core\Inc\Open_J1939\ISO_11783\ISO_11783-7_Application_Layer\Auxiliary_Valve_Command.c(19): error: #18: expected a ")"
data[2] = (fail_safe_mode << 6) | (0b11 << 4) | valve_state; /
Bit 5 and 6 are reserved /
..\Core\Inc\Open_J1939\ISO_11783\ISO_11783-7_Application_Layer\Auxiliary_Valve_Command.c(31): error: #65: expected a ";"
j1939->from_other_ecu_auxiliary_valve_command[valve_number].valve_state = data[2] & 0b00001111;
..\Core\Inc\Open_J1939\ISO_11783\ISO_11783-7_Application_Layer\Auxiliary_Valve_Command.c: 0 warnings, 2 errors
compiling Auxiliary_Valve_Estimated_Flow.c...
..\Core\Inc\Open_J1939\ISO_11783\ISO_11783-7_Application_Layer\Auxiliary_Valve_Estimated_Flow.c(27): error: #18: expected a ")"
data[2] = (j1939->this_auxiliary_valve_estimated_flow[valve_number].fail_safe_mode << 6) | (0b11 << 4) | j1939->this_auxiliary_valve_estimated_flow[valve_number].valve_state; /
Bit 5 and 6 are reserved /
..\Core\Inc\Open_J1939\ISO_11783\ISO_11783-7_Application_Layer\Auxiliary_Valve_Estimated_Flow.c(41): error: #65: expected a ";"
j1939->from_other_ecu_auxiliary_valve_estimated_flow[valve_number].valve_state = data[2] & 0b00001111;
..\Core\Inc\Open_J1939\ISO_11783\ISO_11783-7_Application_Layer\Auxiliary_Valve_Estimated_Flow.c: 0 warnings, 2 errors
compiling Auxiliary_Valve_Measured_Position.c...
compiling General_Purpose_Valve_Estimated_Flow.c...
..\Core\Inc\Open_J1939\ISO_11783\ISO_11783-7_Application_Layer\General_Purpose_Valve_Estimated_Flow.c(27): error: #18: expected a ")"
data[2] = (j1939->this_general_purpose_valve_estimated_flow.fail_safe_mode << 6) | (0b11 << 4) | j1939->this_general_purpose_valve_estimated_flow.valve_state; /
Bit 5 and 6 are reserved for further use /
..\Core\Inc\Open_J1939\ISO_11783\ISO_11783-7_Application_Layer\General_Purpose_Valve_Estimated_Flow.c(44): error: #65: expected a ";"
j1939->from_other_ecu_general_purpose_valve_estimated_flow.valve_state = data[2] & 0b00001111;
..\Core\Inc\Open_J1939\ISO_11783\ISO_11783-7_Application_Layer\General_Purpose_Valve_Estimated_Flow.c: 0 warnings, 2 errors
compiling General_Purpose_Valve_Command.c...
..\Core\Inc\Open_J1939\ISO_11783\ISO_11783-7_Application_Layer\General_Purpose_Valve_Command.c(19): error: #18: expected a ")"
data[2] = (fail_safe_mode << 6) | (0b11 << 4) | valve_state; /
Bit 5 and 6 are reserved */
..\Core\Inc\Open_J1939\ISO_11783\ISO_11783-7_Application_Layer\General_Purpose_Valve_Command.c(33): error: #65: expected a ";"
j1939->from_other_ecu_general_purpose_valve_command.valve_state = data[2] & 0b00001111;
..\Core\Inc\Open_J1939\ISO_11783\ISO_11783-7_Application_Layer\General_Purpose_Valve_Command.c: 0 warnings, 2 errors
compiling FLASH_EEPROM_RAM_Memory.c...
compiling CAN_Network.c...
..\Core\Inc\Open_J1939\Hardware\CAN_Network\CAN_Network.c(71): warning: #223-D: function "STM32_PLC_CAN_Transmit" declared implicitly
status = STM32_PLC_CAN_Transmit(data, &TxHeader);
..\Core\Inc\Open_J1939\Hardware\CAN_Network\CAN_Network.c(71): warning: #188-D: enumerated type mixed with another type
status = STM32_PLC_CAN_Transmit(data, &TxHeader);
..\Core\Inc\Open_J1939\Hardware\CAN_Network\CAN_Network.c(101): warning: #223-D: function "STM32_PLC_CAN_Transmit" declared implicitly
status = STM32_PLC_CAN_Transmit(PGN, &TxHeader);
..\Core\Inc\Open_J1939\Hardware\CAN_Network\CAN_Network.c(101): warning: #188-D: enumerated type mixed with another type
status = STM32_PLC_CAN_Transmit(PGN, &TxHeader);
..\Core\Inc\Open_J1939\Hardware\CAN_Network\CAN_Network.c(122): warning: #223-D: function "STM32_PLC_CAN_Get_ID_Data" declared implicitly
STM32_PLC_CAN_Get_ID_Data(ID, data, &is_new_message);
..\Core\Inc\Open_J1939\Hardware\CAN_Network\CAN_Network.c: 5 warnings, 0 errors
"BLUEPILL_CAN\BLUEPILL_CAN.axf" - 51 Error(s), 6 Warning(s).
Target not created.
Build Time Elapsed: 00:00:15

You are using Kiel's compiler.
Try to use GNU's compiler instead. For example use STM32CubeIDE.

The reason is that Kiel cannot handle 0b10101 binary numbers, but all other C-compilers can.
The future C23 standard will handle binary numbers, but that's about 2 years.