From: jcar Date: Thu, 19 Apr 2012 14:59:24 +0000 (+0200) Subject: Generated and built in-tree examples with stm3210c and tested X-Git-Url: http://rtime.felk.cvut.cz/gitweb/arc.git/commitdiff_plain/d99e09d0903d3a84bb97dbdb766d3db5cb6c8c15 Generated and built in-tree examples with stm3210c and tested --- diff --git a/boards/stm32_stm3210c/examples/com_simple/build_config.mk b/boards/stm32_stm3210c/examples/com_simple/build_config.mk index adddeda1..c3e5fd22 100644 --- a/boards/stm32_stm3210c/examples/com_simple/build_config.mk +++ b/boards/stm32_stm3210c/examples/com_simple/build_config.mk @@ -9,8 +9,6 @@ REQUIRED_BUILD_SYSTEM_VERSION=1.0.0 # Project settings -MOD_USE += MCU KERNEL ECUM DET - SELECT_CONSOLE = RAMLOG SELECT_OPT = OPT_DEBUG diff --git a/boards/stm32_stm3210c/examples/com_simple/com_simple_stm3210c.arxml b/boards/stm32_stm3210c/examples/com_simple/com_simple_stm3210c.arxml index 51013c1d..a5d275c7 100644 --- a/boards/stm32_stm3210c/examples/com_simple/com_simple_stm3210c.arxml +++ b/boards/stm32_stm3210c/examples/com_simple/com_simple_stm3210c.arxml @@ -13,7 +13,7 @@ STM32_F107 - ${PROJECT_LOC}/config + ${fileDir}/config diff --git a/boards/stm32_stm3210c/examples/com_simple/config/CanIf_Cfg.c b/boards/stm32_stm3210c/examples/com_simple/config/CanIf_Cfg.c index 659d6c7e..655e53bb 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/CanIf_Cfg.c +++ b/boards/stm32_stm3210c/examples/com_simple/config/CanIf_Cfg.c @@ -7,10 +7,9 @@ * Configured for (MCU): STM32_F107 * * Module vendor: ArcCore -* Generator version: 2.0.5 +* Generator version: 2.0.6 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:32 CEST 2011 */ @@ -20,6 +19,10 @@ #include "CanTp.h" #include "CanTp_Cbk.h" #endif +#if defined(USE_J1939TP) +#include "J1939Tp.h" +#include "J1939Tp_Cbk.h" +#endif #if defined(USE_PDUR) #include "PduR.h" #endif @@ -136,7 +139,6 @@ const CanIf_RxPduConfigType CanIfRxPduConfigData[] = { #if ( CANIF_READTXPDU_NOTIFY_STATUS_API == STD_ON ) .CanIfReadRxPduNotifyStatus = false, #endif - .CanIfRxPduIdCanIdType = CANIF_CAN_ID_TYPE_11, .CanIfRxUserType = CANIF_USER_TYPE_CAN_PDUR, .CanIfCanRxPduHrhRef = &CanIfHrhConfigData_Hoh[0], .CanIfRxPduIdCanIdType = CANIF_CAN_ID_TYPE_11, diff --git a/boards/stm32_stm3210c/examples/com_simple/config/CanIf_Cfg.h b/boards/stm32_stm3210c/examples/com_simple/config/CanIf_Cfg.h index 72c1cee7..65790e70 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/CanIf_Cfg.h +++ b/boards/stm32_stm3210c/examples/com_simple/config/CanIf_Cfg.h @@ -7,10 +7,9 @@ * Configured for (MCU): STM32_F107 * * Module vendor: ArcCore -* Generator version: 2.0.5 +* Generator version: 2.0.6 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:31 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/CanIf_SpecialPdus.h b/boards/stm32_stm3210c/examples/com_simple/config/CanIf_SpecialPdus.h index 982b0aa1..71fda36a 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/CanIf_SpecialPdus.h +++ b/boards/stm32_stm3210c/examples/com_simple/config/CanIf_SpecialPdus.h @@ -7,10 +7,9 @@ * Configured for (MCU): STM32_F107 * * Module vendor: ArcCore -* Generator version: 2.0.5 +* Generator version: 2.0.6 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:32 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/Can_Cfg.h b/boards/stm32_stm3210c/examples/com_simple/config/Can_Cfg.h index 666eee16..bf6da4be 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/Can_Cfg.h +++ b/boards/stm32_stm3210c/examples/com_simple/config/Can_Cfg.h @@ -10,7 +10,6 @@ * Generator version: 2.0.2 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:36 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/Can_Lcfg.c b/boards/stm32_stm3210c/examples/com_simple/config/Can_Lcfg.c index 03ecf39e..9f4a8b42 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/Can_Lcfg.c +++ b/boards/stm32_stm3210c/examples/com_simple/config/Can_Lcfg.c @@ -10,7 +10,6 @@ * Generator version: 2.0.2 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:36 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/Com_Cfg.h b/boards/stm32_stm3210c/examples/com_simple/config/Com_Cfg.h index c048fa27..9c233d81 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/Com_Cfg.h +++ b/boards/stm32_stm3210c/examples/com_simple/config/Com_Cfg.h @@ -7,10 +7,9 @@ * Configured for (MCU): STM32_F107 * * Module vendor: ArcCore -* Generator version: 2.0.5 +* Generator version: 2.0.7 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:32 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/Com_PbCfg.c b/boards/stm32_stm3210c/examples/com_simple/config/Com_PbCfg.c index a66252da..8a43aad1 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/Com_PbCfg.c +++ b/boards/stm32_stm3210c/examples/com_simple/config/Com_PbCfg.c @@ -7,10 +7,9 @@ * Configured for (MCU): STM32_F107 * * Module vendor: ArcCore -* Generator version: 2.0.5 +* Generator version: 2.0.7 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:32 CEST 2011 */ @@ -47,12 +46,23 @@ const ComGroupSignal_type ComGroupSignal[] = { /* SignalGroup GroupSignals lists. */ + +/* IPdu buffers and signal group buffers */ +uint8 ComArcIPduBuffer_CanDB_Message_1[8]; +uint8 ComArcIPduDeferredRxBuffer_CanDB_Message_1[8]; + +uint8 ComArcIPduBuffer_CanDB_Message_2[8]; + + /* * Signal definitions */ + const ComSignal_type ComSignal[] = { { .ComHandleId = CanDB_Signal_32_21_BE_Tester, + .ComIPduHandleId = 0, + .Com_Arc_ShadowBuffer = NULL, .ComFirstTimeoutFactor = 0, .ComNotification = NULL, .ComTimeoutFactor = 0, @@ -77,6 +87,8 @@ const ComSignal_type ComSignal[] = { }, { .ComHandleId = CanDB_Signal_1_4_LE_Tester, + .ComIPduHandleId = 0, + .Com_Arc_ShadowBuffer = NULL, .ComFirstTimeoutFactor = 0, .ComNotification = NULL, .ComTimeoutFactor = 0, @@ -101,6 +113,8 @@ const ComSignal_type ComSignal[] = { }, { .ComHandleId = CanDB_Signal_45_12_LE_Tester, + .ComIPduHandleId = 0, + .Com_Arc_ShadowBuffer = NULL, .ComFirstTimeoutFactor = 0, .ComNotification = NULL, .ComTimeoutFactor = 0, @@ -125,6 +139,8 @@ const ComSignal_type ComSignal[] = { }, { .ComHandleId = CanDB_Signal_29_12_BE_Tester, + .ComIPduHandleId = 0, + .Com_Arc_ShadowBuffer = NULL, .ComFirstTimeoutFactor = 0, .ComNotification = NULL, .ComTimeoutFactor = 0, @@ -149,6 +165,8 @@ const ComSignal_type ComSignal[] = { }, { .ComHandleId = CanDB_Signal_32_21_BE, + .ComIPduHandleId = 1, + .Com_Arc_ShadowBuffer = NULL, .ComFirstTimeoutFactor = 0, .ComNotification = NULL, .ComTimeoutFactor = 0, @@ -173,6 +191,8 @@ const ComSignal_type ComSignal[] = { }, { .ComHandleId = CanDB_Signal_1_4_LE, + .ComIPduHandleId = 1, + .Com_Arc_ShadowBuffer = NULL, .ComFirstTimeoutFactor = 0, .ComNotification = NULL, .ComTimeoutFactor = 0, @@ -197,6 +217,8 @@ const ComSignal_type ComSignal[] = { }, { .ComHandleId = CanDB_Signal_45_12_LE, + .ComIPduHandleId = 1, + .Com_Arc_ShadowBuffer = NULL, .ComFirstTimeoutFactor = 0, .ComNotification = NULL, .ComTimeoutFactor = 0, @@ -221,6 +243,8 @@ const ComSignal_type ComSignal[] = { }, { .ComHandleId = CanDB_Signal_29_12_BE, + .ComIPduHandleId = 1, + .Com_Arc_ShadowBuffer = NULL, .ComFirstTimeoutFactor = 0, .ComNotification = NULL, .ComTimeoutFactor = 0, @@ -292,11 +316,13 @@ const ComIPdu_type ComIPdu[] = { { // CanDB_Message_1 .ArcIPduOutgoingId = PDUR_REVERSE_PDU_ID_CanDB_Message_1, .ComIPduCallout = NULL, + .ComIPduSignalProcessing = DEFERRED, .ComIPduSize = 8, .ComIPduDirection = RECEIVE, .ComIPduGroupRef = CanDbImportedPdus, + .ComIPduDeferredDataPtr = ComArcIPduDeferredRxBuffer_CanDB_Message_1, .ComTxIPdu = { .ComTxIPduMinimumDelayFactor = 0, .ComTxIPduUnusedAreasDefault = 0, @@ -309,17 +335,21 @@ const ComIPdu_type ComIPdu[] = { }, }, + .ComIPduDataPtr = ComArcIPduBuffer_CanDB_Message_1, .ComIPduSignalRef = ComIPduSignalRefs_CanDB_Message_1, + .ComIPduDynSignalRef = 0, .Com_Arc_EOL = 0 }, { // CanDB_Message_2 .ArcIPduOutgoingId = PDUR_PDU_ID_CanDB_Message_2, .ComIPduCallout = NULL, + .ComIPduSignalProcessing = DEFERRED, .ComIPduSize = 8, .ComIPduDirection = SEND, .ComIPduGroupRef = CanDbImportedPdus, + .ComIPduDeferredDataPtr = 0, .ComTxIPdu = { .ComTxIPduMinimumDelayFactor = 0, .ComTxIPduUnusedAreasDefault = 0, @@ -332,7 +362,9 @@ const ComIPdu_type ComIPdu[] = { }, }, + .ComIPduDataPtr = ComArcIPduBuffer_CanDB_Message_2, .ComIPduSignalRef = ComIPduSignalRefs_CanDB_Message_2, + .ComIPduDynSignalRef = 0, .Com_Arc_EOL = 0 }, { @@ -348,12 +380,6 @@ const Com_ConfigType ComConfiguration = { .ComGroupSignal = ComGroupSignal }; -/* IPdu buffers and signal group buffers */ -uint8 ComArcIPduBuffer_CanDB_Message_1[8]; - -uint8 ComArcIPduBuffer_CanDB_Message_2[8]; - - Com_Arc_IPdu_type Com_Arc_IPdu[] = { { // CanDB_Message_1 .Com_Arc_TxIPduTimers = { @@ -361,8 +387,7 @@ Com_Arc_IPdu_type Com_Arc_IPdu[] = { .ComTxModeRepetitionPeriodTimer = 0, .ComTxIPduMinimumDelayTimer = 0, .ComTxModeTimePeriodTimer = 0 - }, - .ComIPduDataPtr = ComArcIPduBuffer_CanDB_Message_1, + }, .Com_Arc_IpduStarted = 0 }, { // CanDB_Message_2 @@ -371,8 +396,7 @@ Com_Arc_IPdu_type Com_Arc_IPdu[] = { .ComTxModeRepetitionPeriodTimer = 0, .ComTxIPduMinimumDelayTimer = 0, .ComTxModeTimePeriodTimer = 0 - }, - .ComIPduDataPtr = ComArcIPduBuffer_CanDB_Message_2, + }, .Com_Arc_IpduStarted = 0 }, }; @@ -380,90 +404,42 @@ Com_Arc_IPdu_type Com_Arc_IPdu[] = { Com_Arc_Signal_type Com_Arc_Signal[] = { { // CanDB_Signal_32_21_BE_Tester .Com_Arc_DeadlineCounter = 0, - .ComTimeoutFactor = 0, - .ComIPduHandleId = 0, .ComSignalUpdated = 0, - .ComIPduDataPtr = NULL, - - .Com_Arc_ShadowBuffer = NULL - }, { // CanDB_Signal_1_4_LE_Tester .Com_Arc_DeadlineCounter = 0, - .ComTimeoutFactor = 0, - .ComIPduHandleId = 0, .ComSignalUpdated = 0, - .ComIPduDataPtr = NULL, - - .Com_Arc_ShadowBuffer = NULL - }, { // CanDB_Signal_45_12_LE_Tester .Com_Arc_DeadlineCounter = 0, - .ComTimeoutFactor = 0, - .ComIPduHandleId = 0, .ComSignalUpdated = 0, - .ComIPduDataPtr = NULL, - - .Com_Arc_ShadowBuffer = NULL - }, { // CanDB_Signal_29_12_BE_Tester .Com_Arc_DeadlineCounter = 0, - .ComTimeoutFactor = 0, - .ComIPduHandleId = 0, .ComSignalUpdated = 0, - .ComIPduDataPtr = NULL, - - .Com_Arc_ShadowBuffer = NULL - }, { // CanDB_Signal_32_21_BE .Com_Arc_DeadlineCounter = 0, - .ComTimeoutFactor = 0, - .ComIPduHandleId = 0, .ComSignalUpdated = 0, - .ComIPduDataPtr = NULL, - - .Com_Arc_ShadowBuffer = NULL - }, { // CanDB_Signal_1_4_LE .Com_Arc_DeadlineCounter = 0, - .ComTimeoutFactor = 0, - .ComIPduHandleId = 0, .ComSignalUpdated = 0, - .ComIPduDataPtr = NULL, - - .Com_Arc_ShadowBuffer = NULL - }, { // CanDB_Signal_45_12_LE .Com_Arc_DeadlineCounter = 0, - .ComTimeoutFactor = 0, - .ComIPduHandleId = 0, .ComSignalUpdated = 0, - .ComIPduDataPtr = NULL, - - .Com_Arc_ShadowBuffer = NULL - }, { // CanDB_Signal_29_12_BE .Com_Arc_DeadlineCounter = 0, - .ComTimeoutFactor = 0, - .ComIPduHandleId = 0, .ComSignalUpdated = 0, - .ComIPduDataPtr = NULL, - - .Com_Arc_ShadowBuffer = NULL - }, }; diff --git a/boards/stm32_stm3210c/examples/com_simple/config/Com_PbCfg.h b/boards/stm32_stm3210c/examples/com_simple/config/Com_PbCfg.h index 7596d3f6..d68ca2c6 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/Com_PbCfg.h +++ b/boards/stm32_stm3210c/examples/com_simple/config/Com_PbCfg.h @@ -7,10 +7,9 @@ * Configured for (MCU): STM32_F107 * * Module vendor: ArcCore -* Generator version: 2.0.5 +* Generator version: 2.0.7 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:32 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/Det_Cfg.h b/boards/stm32_stm3210c/examples/com_simple/config/Det_Cfg.h index 102787bf..0d978a8c 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/Det_Cfg.h +++ b/boards/stm32_stm3210c/examples/com_simple/config/Det_Cfg.h @@ -10,7 +10,6 @@ * Generator version: 2.0.1 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:33 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/EcuM.mk b/boards/stm32_stm3210c/examples/com_simple/config/EcuM.mk index 7b7f9b94..c81d73c6 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/EcuM.mk +++ b/boards/stm32_stm3210c/examples/com_simple/config/EcuM.mk @@ -1,3 +1,5 @@ MOD_USE += CANIF COM DET ECUM KERNEL PDUR MCU PORT CAN +def-y += ECUM_USE_SERVICE_PORTS=STDOFF + diff --git a/boards/stm32_stm3210c/examples/com_simple/config/EcuM_Callout_Stubs.c b/boards/stm32_stm3210c/examples/com_simple/config/EcuM_Callout_Stubs.c new file mode 100644 index 00000000..4fd8169f --- /dev/null +++ b/boards/stm32_stm3210c/examples/com_simple/config/EcuM_Callout_Stubs.c @@ -0,0 +1,332 @@ +/* +* Configuration of module: EcuM (EcuM_Callout_Stubs.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): STM32_F107 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +*/ + + +#include "EcuM.h" +#include "EcuM_Generated_Types.h" +#include "Det.h" +#if defined(USE_DEM) +#include "Dem.h" +#endif +#if defined(USE_MCU) +#include "Mcu.h" +#endif +#if defined(USE_GPT) +#include "Gpt.h" +#endif +#if defined(USE_CAN) +#include "Can.h" +#endif +#if defined(USE_CANIF) +#include "CanIf.h" +#endif +#if defined(USE_PDUR) +#include "PduR.h" +#endif +#if defined(USE_COM) +#include "Com.h" +#endif +#if defined(USE_CANTP) +#include "CanTp.h" +#endif +#if defined(USE_J1939TP) +#include "J1939Tp.h" +#endif +#if defined(USE_DCM) +#include "Dcm.h" +#endif +#if defined(USE_PWM) +#include "Pwm.h" +#endif +#if defined(USE_IOHWAB) +#include "IoHwAb.h" +#endif +#if defined(USE_FLS) +#include "Fls.h" +#endif +#if defined(USE_EEP) +#include "Eep.h" +#endif +#if defined(USE_FEE) +#include "Fee.h" +#endif +#if defined(USE_EA) +#include "Ea.h" +#endif +#if defined(USE_NVM) +#include "NvM.h" +#endif +#if defined(USE_COMM) +#include "ComM.h" +#endif +#if defined(USE_NM) +#include "Nm.h" +#endif +#if defined(USE_CANNM) +#include "CanNm.h" +#endif +#if defined(USE_CANSM) +#include "CanSM.h" +#endif +#if defined(USE_UDPNM) +#include "UdpNm.h" +#endif +#if defined(USE_LINSM) +#include "LinSM.h" +#endif +#if defined(USE_SPI) +#include "Spi.h" +#endif +#if defined(USE_WDG) +#include "Wdg.h" +#endif +#if defined(USE_WDGM) +#include "WdgM.h" +#endif + +void EcuM_AL_DriverInitZero(void) +{ + Det_Init();/** @req EcuM2783 */ + Det_Start();/** @req EcuM2634 */ +} + +extern EcuM_ConfigType EcuMConfig; + +EcuM_ConfigType* EcuM_DeterminePbConfiguration(void) +{ + return &EcuMConfig; +} + +void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr) +{ + (void)ConfigPtr; + //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules + +#if defined(USE_MCU) + Mcu_Init(ConfigPtr->McuConfig); + + /* Set up default clock (Mcu_InitClock requires initRun==1) */ + /* Ignoring return value */ + (void) Mcu_InitClock( ConfigPtr->McuConfig->McuDefaultClockSettings ); + + // Wait for PLL to sync. + while (Mcu_GetPllStatus() != MCU_PLL_LOCKED) + { + ; + } +#endif + +#if defined(USE_DEM) + // Preinitialize DEM + Dem_PreInit(); +#endif + +#if defined(USE_PORT) + // Setup Port + Port_Init(ConfigPtr->PortConfig); +#endif + + +#if defined(USE_GPT) + // Setup the GPT + Gpt_Init(ConfigPtr->GptConfig); +#endif + + // Setup watchdog +#if defined(USE_WDG) + Wdg_Init(ConfigPtr->WdgConfig); +#endif +#if defined(USE_WDGM) + WdgM_Init(ConfigPtr->WdgMConfig); +#endif + +#if defined(USE_DMA) + // Setup DMA + Dma_Init(ConfigPtr->DmaConfig); +#endif + +#if defined(USE_ADC) + // Setup ADC + Adc_Init(ConfigPtr->AdcConfig); +#endif + + // Setup ICU + // TODO + + // Setup PWM +#if defined(USE_PWM) + // Setup PWM + Pwm_Init(ConfigPtr->PwmConfig); +#endif +} + +void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr) +{ + (void)ConfigPtr; + //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules + +#if defined(USE_SPI) + // Setup SPI + Spi_Init(ConfigPtr->SpiConfig); +#endif + +#if defined(USE_EEP) + // Setup EEP + Eep_Init(ConfigPtr->EepConfig); +#endif + +#if defined(USE_FLS) + // Setup Flash + Fls_Init(ConfigPtr->FlashConfig); +#endif + +#if defined(USE_FEE) + // Setup FEE + Fee_Init(); +#endif + +#if defined(USE_EA) + // Setup EA + Ea_Init(); +#endif + +#if defined(USE_NVM) + // Setup NVRAM Manager and start the read all job + NvM_Init(); + NvM_ReadAll(); +#endif + + // Setup CAN tranceiver + // TODO + +#if defined(USE_CAN) + // Setup Can driver + Can_Init(ConfigPtr->CanConfig); +#endif + +#if defined(USE_CANIF) + // Setup CanIf + CanIf_Init(ConfigPtr->CanIfConfig); +#endif + +#if defined(USE_CANTP) + // Setup CAN TP + CanTp_Init(); +#endif + +#if defined(USE_CANSM) + CanSM_Init(ConfigPtr->CanSMConfig); +#endif + +#if defined(USE_J1939TP) + // Setup J1939Tp + J1939Tp_Init(ConfigPtr->J1939TpConfig); +#endif + + + // Setup LIN + // TODO + +#if defined(USE_PDUR) + // Setup PDU Router + PduR_Init(ConfigPtr->PduRConfig); +#endif + +#if defined(USE_CANNM) + // Setup Can Network Manager + CanNm_Init(ConfigPtr->CanNmConfig); +#endif + +#if defined(USE_UDPNM) + // Setup Udp Network Manager + UdpNm_Init(ConfigPtr->UdpNmConfig); +#endif + +#if defined(USE_NM) + // Setup Network Management Interface + Nm_Init(ConfigPtr->NmConfig); +#endif + +#if defined(USE_COM) + // Setup COM layer + Com_Init(ConfigPtr->ComConfig); +#endif + +#if defined(USE_DCM) + // Setup DCM + Dcm_Init(); +#endif + +#if defined(USE_IOHWAB) + // Setup IO hardware abstraction layer + IoHwAb_Init(); +#endif + +} + +void EcuM_AL_DriverInitThree(const EcuM_ConfigType* ConfigPtr) +{ + (void)ConfigPtr; + //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules + +#if defined(USE_DEM) + // Setup DEM + Dem_Init(); +#endif + +#if defined(USE_COMM) + // Setup Communication Manager + ComM_Init(ConfigPtr->ComMConfig); +#endif +} + +void EcuM_OnEnterRUN(void) +{ + +} + +void EcuM_OnExitRun(void) +{ + +} + +void EcuM_OnExitPostRun(void) +{ + +} + +void EcuM_OnPrepShutdown(void) +{ + +} + +void EcuM_OnGoSleep(void) +{ + +} + +void EcuM_OnGoOffOne(void) +{ + +} + +void EcuM_OnGoOffTwo(void) +{ + +} + +void EcuM_AL_SwitchOff(void) +{ + +} diff --git a/boards/stm32_stm3210c/examples/com_simple/config/EcuM_Cfg.h b/boards/stm32_stm3210c/examples/com_simple/config/EcuM_Cfg.h index 40d29c09..b1cc93f0 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/EcuM_Cfg.h +++ b/boards/stm32_stm3210c/examples/com_simple/config/EcuM_Cfg.h @@ -10,7 +10,6 @@ * Generator version: 2.0.2 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:33 CEST 2011 */ @@ -26,8 +25,6 @@ #define ECUM_VERSION_INFO_API STD_OFF #define ECUM_DEV_ERROR_DETECT STD_OFF -#include "EcuM_Generated_Types.h" - #define ECUM_MAIN_FUNCTION_PERIOD (200) #define ECUM_NVRAM_READALL_TIMEOUT (10000) #define ECUM_NVRAM_WRITEALL_TIMEOUT (10000) @@ -40,7 +37,5 @@ typedef enum { } EcuM_UserList; -extern EcuM_ConfigType EcuMConfig; - #endif /*ECUM_CFG_H_*/ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/EcuM_Generated_Types.h b/boards/stm32_stm3210c/examples/com_simple/config/EcuM_Generated_Types.h new file mode 100644 index 00000000..907fb2b4 --- /dev/null +++ b/boards/stm32_stm3210c/examples/com_simple/config/EcuM_Generated_Types.h @@ -0,0 +1,178 @@ +/* +* Configuration of module: EcuM (EcuM_Generated_Types.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): STM32_F107 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +*/ + + +#if !(((ECUM_SW_MAJOR_VERSION == 2) && (ECUM_SW_MINOR_VERSION == 0)) ) +#error EcuM: Configuration file expected BSW module version to be 2.0.* +#endif + + +#ifndef _ECUM_GENERATED_TYPES_H_ +#define _ECUM_GENERATED_TYPES_H_ + +#if (ECUM_USE_SERVICE_PORTS == STD_ON) && defined(USE_RTE) +#include "Rte_EcuM.h" +#endif + +#include "EcuM_Types.h" + +#if defined(USE_MCU) +#include "Mcu.h" +#endif +#if defined(USE_PORT) +#include "Port.h" +#endif +#if defined(USE_CAN) +#include "Can.h" +#endif +#if defined(USE_CANIF) +#include "CanIf.h" +#endif +#if defined(USE_PWM) +#include "Pwm.h" +#endif +#if defined(USE_COM) +#include "Com.h" +#endif +#if defined(USE_PDUR) +#include "PduR.h" +#endif +#if defined(USE_DMA) +#include "Dma.h" +#endif +#if defined(USE_ADC) +#include "Adc.h" +#endif +#if defined(USE_GPT) +#include "Gpt.h" +#endif +#if defined(USE_COMM) +#include "ComM.h" +#endif +#if defined(USE_NM) +#include "Nm.h" +#endif +#if defined(USE_CANNM) +#include "CanNm.h" +#endif +#if defined(USE_CANSM) +#include "CanSM.h" +#endif +#if defined(USE_J1939TP) +#include "J1939Tp.h" +#endif +#if defined(USE_UDPNM) +#include "UdpNm.h" +#endif +#if defined(USE_LINSM) +#include "LinSM.h" +#endif +#if defined(USE_FLS) +#include "Fls.h" +#endif +#if defined(USE_EEP) +#include "Eep.h" +#endif +#if defined(USE_SPI) +#include "Spi.h" +#endif +#if defined(USE_WDG) +#include "Wdg.h" +#endif +#if defined(USE_WDGM) +#include "WdgM.h" +#endif +#if defined(USE_WDGIF) +#include "WdgIf.h" +#endif + + +typedef struct +{ + EcuM_StateType EcuMDefaultShutdownTarget; + uint8 EcuMDefaultSleepMode; + AppModeType EcuMDefaultAppMode; + uint32 EcuMRunMinimumDuration; + uint32 EcuMNvramReadAllTimeout; + uint32 EcuMNvramWriteAllTimeout; + +#if defined(USE_MCU) + const Mcu_ConfigType* McuConfig; +#endif +#if defined(USE_PORT) + const Port_ConfigType* PortConfig; +#endif +#if defined(USE_CAN) + const Can_ConfigType* CanConfig; +#endif +#if defined(USE_CANIF) + const CanIf_ConfigType* CanIfConfig; +#endif +#if defined(USE_CANSM) + const CanSM_ConfigType* CanSMConfig; +#endif +#if defined(USE_NM) + const Nm_ConfigType* NmConfig; +#endif +#if defined(USE_CANNM) + const CanNm_ConfigType* CanNmConfig; +#endif +#if defined(USE_UDPNM) + const UdpNm_ConfigType* UdpNmConfig; +#endif +#if defined(USE_COMM) + const ComM_ConfigType* ComMConfig; +#endif +#if defined(USE_COM) + const Com_ConfigType* ComConfig; +#endif +#if defined(USE_J1939TP) + const J1939Tp_ConfigType* J1939TpConfig; +#endif +#if defined(USE_PDUR) + const PduR_PBConfigType* PduRConfig; +#endif +#if defined(USE_PWM) + const Pwm_ConfigType* PwmConfig; +#endif +#if defined(USE_DMA) + const Dma_ConfigType* DmaConfig; +#endif +#if defined(USE_ADC) + const Adc_ConfigType* AdcConfig; +#endif +#if defined(USE_GPT) + const Gpt_ConfigType* GptConfig; +#endif +#if defined(USE_FLS) + const Fls_ConfigType* FlashConfig; +#endif +#if defined(USE_EEP) + const Eep_ConfigType* EepConfig; +#endif +#if defined(USE_SPI) + const Spi_ConfigType* SpiConfig; +#endif +#if defined(USE_WDG) + const Wdg_ConfigType* WdgConfig; +#endif +#if defined(USE_WDGIF) + const WdgIf_ConfigType* WdgIfConfig; +#endif +#if defined(USE_WDGM) + const WdgM_ConfigType* WdgMConfig; +#endif +} EcuM_ConfigType; + +#endif /*_ECUM_GENERATED_TYPES_H_*/ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/EcuM_PBcfg.c b/boards/stm32_stm3210c/examples/com_simple/config/EcuM_PBcfg.c new file mode 100644 index 00000000..cfb351cf --- /dev/null +++ b/boards/stm32_stm3210c/examples/com_simple/config/EcuM_PBcfg.c @@ -0,0 +1,119 @@ +/* +* Configuration of module: EcuM (EcuM_PBcfg.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): STM32_F107 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +*/ + + + +#include "EcuM.h" +#include "EcuM_Generated_Types.h" + +#if defined(USE_CANSM) +extern const CanSM_ConfigType CanSM_Config; +#endif +#if defined(USE_NM) +extern const Nm_ConfigType Nm_Config; +#endif +#if defined(USE_CANNM) +extern const CanNm_ConfigType CanNm_Config; +#endif +#if defined(USE_UDPNM) +extern const UdpNm_ConfigType UdpNm_Config; +#endif +#if defined(USE_COMM) +extern const ComM_ConfigType ComM_Config; +#endif + +#if defined(USE_J1939TP) +extern const J1939Tp_ConfigType J1939Tp_Config; +#endif + + +EcuM_ConfigType EcuMConfig = +{ + .EcuMDefaultShutdownTarget = ECUM_STATE_RESET, + .EcuMDefaultSleepMode = 0, // Don't care + .EcuMDefaultAppMode = OSDEFAULTAPPMODE, + .EcuMNvramReadAllTimeout = ECUM_NVRAM_READALL_TIMEOUT, + .EcuMNvramWriteAllTimeout = ECUM_NVRAM_WRITEALL_TIMEOUT, + .EcuMRunMinimumDuration = ECUM_NVRAM_MIN_RUN_DURATION, + +#if defined(USE_MCU) + .McuConfig = McuConfigData, +#endif +#if defined(USE_PORT) + .PortConfig = &PortConfigData, +#endif +#if defined(USE_CAN) + .CanConfig = &CanConfigData, +#endif +#if defined(USE_CANIF) + .CanIfConfig = &CanIf_Config, +#endif +#if defined(USE_CANSM) + .CanSMConfig = &CanSM_Config, +#endif +#if defined(USE_CANNM) + .CanNmConfig = &CanNm_Config, +#endif +#if defined(USE_UDPNM) + .UdpNmConfig = &UdpNm_Config, +#endif +#if defined(USE_COM) + .ComConfig = &ComConfiguration, +#endif +#if defined(USE_COMM) + .ComMConfig = &ComM_Config, +#endif +#if defined(USE_J1939TP) + .J1939TpConfig = &J1939Tp_Config, +#endif +#if defined(USE_NM) + .NmConfig = &Nm_Config, +#endif +#if defined(USE_PDUR) + .PduRConfig = &PduR_Config, +#endif +#if defined(USE_J1939TP) + .J1939TpConfig = &J1939Tp_Config, +#endif +#if defined(USE_DMA) + .DmaConfig = DmaConfig, +#endif +#if defined(USE_ADC) + .AdcConfig = AdcConfig, +#endif +#if defined(USE_PWM) + .PwmConfig = &PwmConfig, +#endif +#if defined(USE_WDG) + .WdgConfig = &WdgConfig, +#endif +#if defined(USE_WDGM) + .WdgMConfig = &WdgMConfig, +#endif +#if defined(USE_WDGIF) + .WdgIfConfig = &WdgIfConfig, +#endif +#if defined(USE_GPT) + .GptConfig = GptConfigData, +#endif +#if defined(USE_FLS) + .FlashConfig = FlsConfigSet, +#endif +#if defined(USE_EEP) + .EepConfig = EepConfigData, +#endif +#if defined(USE_SPI) + .SpiConfig = &SpiConfigData, +#endif +}; diff --git a/boards/stm32_stm3210c/examples/com_simple/config/Mcu_Cfg.c b/boards/stm32_stm3210c/examples/com_simple/config/Mcu_Cfg.c index a46556ae..ca0d6eb3 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/Mcu_Cfg.c +++ b/boards/stm32_stm3210c/examples/com_simple/config/Mcu_Cfg.c @@ -10,7 +10,6 @@ * Generator version: 2.0.3 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:35 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/Mcu_Cfg.h b/boards/stm32_stm3210c/examples/com_simple/config/Mcu_Cfg.h index 4ebf5cf7..5e620a71 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/Mcu_Cfg.h +++ b/boards/stm32_stm3210c/examples/com_simple/config/Mcu_Cfg.h @@ -10,7 +10,6 @@ * Generator version: 2.0.3 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:35 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/Os_Cfg.c b/boards/stm32_stm3210c/examples/com_simple/config/Os_Cfg.c index 19041ff4..d30bcc11 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/Os_Cfg.c +++ b/boards/stm32_stm3210c/examples/com_simple/config/Os_Cfg.c @@ -10,7 +10,6 @@ * Generator version: 2.0.34 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:34 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/Os_Cfg.h b/boards/stm32_stm3210c/examples/com_simple/config/Os_Cfg.h index 19bc4bbd..4c032b7e 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/Os_Cfg.h +++ b/boards/stm32_stm3210c/examples/com_simple/config/Os_Cfg.h @@ -10,7 +10,6 @@ * Generator version: 2.0.34 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:33 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/PduR_Cfg.h b/boards/stm32_stm3210c/examples/com_simple/config/PduR_Cfg.h index 232bda75..0b76d9fe 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/PduR_Cfg.h +++ b/boards/stm32_stm3210c/examples/com_simple/config/PduR_Cfg.h @@ -7,10 +7,9 @@ * Configured for (MCU): STM32_F107 * * Module vendor: ArcCore -* Generator version: 3.0.8 +* Generator version: 3.1.10 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:34 CEST 2011 */ @@ -33,7 +32,7 @@ #define PDUR_COM_SUPPORT STD_ON #define PDUR_DCM_SUPPORT STD_OFF #define PDUR_IPDUM_SUPPORT STD_OFF /* Not supported */ -#define PDUR_SOAD_SUPPORT STD_OFF +#define PDUR_J1939TP_SUPPORT STD_OFF #define PDUR_DEV_ERROR_DETECT STD_OFF #define PDUR_VERSION_INFO_API STD_OFF @@ -44,7 +43,6 @@ #define PDUR_SINGLE_IF NULL #define PDUR_SINGLE_TP NULL - // Gateway operation #define PDUR_GATEWAY_OPERATION STD_ON #define PDUR_MEMORY_SIZE 10 /* Not used */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/PduR_PbCfg.c b/boards/stm32_stm3210c/examples/com_simple/config/PduR_PbCfg.c index e28f969d..8ff0d3cc 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/PduR_PbCfg.c +++ b/boards/stm32_stm3210c/examples/com_simple/config/PduR_PbCfg.c @@ -7,10 +7,9 @@ * Configured for (MCU): STM32_F107 * * Module vendor: ArcCore -* Generator version: 3.0.8 +* Generator version: 3.1.10 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:34 CEST 2011 */ @@ -32,13 +31,12 @@ #if PDUR_DCM_SUPPORT == STD_ON #include "Dcm.h" #endif -#if PDUR_SOAD_SUPPORT == STD_ON -#include "SoAd.h" +#if PDUR_J1939TP_SUPPORT == STD_ON +#include "J1939Tp.h" #endif - PduRTpBufferInfo_type PduRTpBuffers[] = { { .pduInfoPtr = NULL, diff --git a/boards/stm32_stm3210c/examples/com_simple/config/PduR_PbCfg.h b/boards/stm32_stm3210c/examples/com_simple/config/PduR_PbCfg.h index 93fceb3e..eddfa23c 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/PduR_PbCfg.h +++ b/boards/stm32_stm3210c/examples/com_simple/config/PduR_PbCfg.h @@ -7,10 +7,9 @@ * Configured for (MCU): STM32_F107 * * Module vendor: ArcCore -* Generator version: 3.0.8 +* Generator version: 3.1.10 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:34 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/Port_Cfg.c b/boards/stm32_stm3210c/examples/com_simple/config/Port_Cfg.c index 9872b468..8f5b354d 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/Port_Cfg.c +++ b/boards/stm32_stm3210c/examples/com_simple/config/Port_Cfg.c @@ -10,7 +10,6 @@ * Generator version: 2.0.2 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:35 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/config/Port_Cfg.h b/boards/stm32_stm3210c/examples/com_simple/config/Port_Cfg.h index 23d3a20d..f639c407 100644 --- a/boards/stm32_stm3210c/examples/com_simple/config/Port_Cfg.h +++ b/boards/stm32_stm3210c/examples/com_simple/config/Port_Cfg.h @@ -10,7 +10,6 @@ * Generator version: 2.0.2 * * Generated by Arctic Studio (http://arccore.com) -* on Wed Jul 06 13:54:35 CEST 2011 */ diff --git a/boards/stm32_stm3210c/examples/com_simple/makefile b/boards/stm32_stm3210c/examples/com_simple/makefile index 7634d2e1..81f7e9cf 100644 --- a/boards/stm32_stm3210c/examples/com_simple/makefile +++ b/boards/stm32_stm3210c/examples/com_simple/makefile @@ -2,6 +2,8 @@ # Project name, used for output files et.c. PROJECTNAME = com_simple_stm3210c +ROOTDIR?=../../../.. + # Default settings include $(ROOTDIR)/scripts/project_defaults.mk diff --git a/boards/stm32_stm3210c/examples/os_simple/build_config.mk b/boards/stm32_stm3210c/examples/os_simple/build_config.mk index c5777cdf..c3e5fd22 100644 --- a/boards/stm32_stm3210c/examples/os_simple/build_config.mk +++ b/boards/stm32_stm3210c/examples/os_simple/build_config.mk @@ -1,4 +1,15 @@ +# Version of build system +REQUIRED_BUILD_SYSTEM_VERSION=1.0.0 + +# Get configuration makefiles +-include ../config/*.mk +-include ../config/$(BOARDDIR)/*.mk + + +# Project settings + +SELECT_CONSOLE = RAMLOG + +SELECT_OPT = OPT_DEBUG -#CFG+=VLE -MOD_USE+= DET ECUM MCU KERNEL RAMLOG \ No newline at end of file diff --git a/boards/stm32_stm3210c/examples/os_simple/config/EcuM.mk b/boards/stm32_stm3210c/examples/os_simple/config/EcuM.mk new file mode 100644 index 00000000..d1ee6502 --- /dev/null +++ b/boards/stm32_stm3210c/examples/os_simple/config/EcuM.mk @@ -0,0 +1,5 @@ + +MOD_USE += MCU KERNEL ECUM + +def-y += ECUM_USE_SERVICE_PORTS=STDOFF + diff --git a/boards/stm32_stm3210c/examples/os_simple/config/EcuM_Callout_Stubs.c b/boards/stm32_stm3210c/examples/os_simple/config/EcuM_Callout_Stubs.c new file mode 100644 index 00000000..4fd8169f --- /dev/null +++ b/boards/stm32_stm3210c/examples/os_simple/config/EcuM_Callout_Stubs.c @@ -0,0 +1,332 @@ +/* +* Configuration of module: EcuM (EcuM_Callout_Stubs.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): STM32_F107 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +*/ + + +#include "EcuM.h" +#include "EcuM_Generated_Types.h" +#include "Det.h" +#if defined(USE_DEM) +#include "Dem.h" +#endif +#if defined(USE_MCU) +#include "Mcu.h" +#endif +#if defined(USE_GPT) +#include "Gpt.h" +#endif +#if defined(USE_CAN) +#include "Can.h" +#endif +#if defined(USE_CANIF) +#include "CanIf.h" +#endif +#if defined(USE_PDUR) +#include "PduR.h" +#endif +#if defined(USE_COM) +#include "Com.h" +#endif +#if defined(USE_CANTP) +#include "CanTp.h" +#endif +#if defined(USE_J1939TP) +#include "J1939Tp.h" +#endif +#if defined(USE_DCM) +#include "Dcm.h" +#endif +#if defined(USE_PWM) +#include "Pwm.h" +#endif +#if defined(USE_IOHWAB) +#include "IoHwAb.h" +#endif +#if defined(USE_FLS) +#include "Fls.h" +#endif +#if defined(USE_EEP) +#include "Eep.h" +#endif +#if defined(USE_FEE) +#include "Fee.h" +#endif +#if defined(USE_EA) +#include "Ea.h" +#endif +#if defined(USE_NVM) +#include "NvM.h" +#endif +#if defined(USE_COMM) +#include "ComM.h" +#endif +#if defined(USE_NM) +#include "Nm.h" +#endif +#if defined(USE_CANNM) +#include "CanNm.h" +#endif +#if defined(USE_CANSM) +#include "CanSM.h" +#endif +#if defined(USE_UDPNM) +#include "UdpNm.h" +#endif +#if defined(USE_LINSM) +#include "LinSM.h" +#endif +#if defined(USE_SPI) +#include "Spi.h" +#endif +#if defined(USE_WDG) +#include "Wdg.h" +#endif +#if defined(USE_WDGM) +#include "WdgM.h" +#endif + +void EcuM_AL_DriverInitZero(void) +{ + Det_Init();/** @req EcuM2783 */ + Det_Start();/** @req EcuM2634 */ +} + +extern EcuM_ConfigType EcuMConfig; + +EcuM_ConfigType* EcuM_DeterminePbConfiguration(void) +{ + return &EcuMConfig; +} + +void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr) +{ + (void)ConfigPtr; + //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules + +#if defined(USE_MCU) + Mcu_Init(ConfigPtr->McuConfig); + + /* Set up default clock (Mcu_InitClock requires initRun==1) */ + /* Ignoring return value */ + (void) Mcu_InitClock( ConfigPtr->McuConfig->McuDefaultClockSettings ); + + // Wait for PLL to sync. + while (Mcu_GetPllStatus() != MCU_PLL_LOCKED) + { + ; + } +#endif + +#if defined(USE_DEM) + // Preinitialize DEM + Dem_PreInit(); +#endif + +#if defined(USE_PORT) + // Setup Port + Port_Init(ConfigPtr->PortConfig); +#endif + + +#if defined(USE_GPT) + // Setup the GPT + Gpt_Init(ConfigPtr->GptConfig); +#endif + + // Setup watchdog +#if defined(USE_WDG) + Wdg_Init(ConfigPtr->WdgConfig); +#endif +#if defined(USE_WDGM) + WdgM_Init(ConfigPtr->WdgMConfig); +#endif + +#if defined(USE_DMA) + // Setup DMA + Dma_Init(ConfigPtr->DmaConfig); +#endif + +#if defined(USE_ADC) + // Setup ADC + Adc_Init(ConfigPtr->AdcConfig); +#endif + + // Setup ICU + // TODO + + // Setup PWM +#if defined(USE_PWM) + // Setup PWM + Pwm_Init(ConfigPtr->PwmConfig); +#endif +} + +void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr) +{ + (void)ConfigPtr; + //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules + +#if defined(USE_SPI) + // Setup SPI + Spi_Init(ConfigPtr->SpiConfig); +#endif + +#if defined(USE_EEP) + // Setup EEP + Eep_Init(ConfigPtr->EepConfig); +#endif + +#if defined(USE_FLS) + // Setup Flash + Fls_Init(ConfigPtr->FlashConfig); +#endif + +#if defined(USE_FEE) + // Setup FEE + Fee_Init(); +#endif + +#if defined(USE_EA) + // Setup EA + Ea_Init(); +#endif + +#if defined(USE_NVM) + // Setup NVRAM Manager and start the read all job + NvM_Init(); + NvM_ReadAll(); +#endif + + // Setup CAN tranceiver + // TODO + +#if defined(USE_CAN) + // Setup Can driver + Can_Init(ConfigPtr->CanConfig); +#endif + +#if defined(USE_CANIF) + // Setup CanIf + CanIf_Init(ConfigPtr->CanIfConfig); +#endif + +#if defined(USE_CANTP) + // Setup CAN TP + CanTp_Init(); +#endif + +#if defined(USE_CANSM) + CanSM_Init(ConfigPtr->CanSMConfig); +#endif + +#if defined(USE_J1939TP) + // Setup J1939Tp + J1939Tp_Init(ConfigPtr->J1939TpConfig); +#endif + + + // Setup LIN + // TODO + +#if defined(USE_PDUR) + // Setup PDU Router + PduR_Init(ConfigPtr->PduRConfig); +#endif + +#if defined(USE_CANNM) + // Setup Can Network Manager + CanNm_Init(ConfigPtr->CanNmConfig); +#endif + +#if defined(USE_UDPNM) + // Setup Udp Network Manager + UdpNm_Init(ConfigPtr->UdpNmConfig); +#endif + +#if defined(USE_NM) + // Setup Network Management Interface + Nm_Init(ConfigPtr->NmConfig); +#endif + +#if defined(USE_COM) + // Setup COM layer + Com_Init(ConfigPtr->ComConfig); +#endif + +#if defined(USE_DCM) + // Setup DCM + Dcm_Init(); +#endif + +#if defined(USE_IOHWAB) + // Setup IO hardware abstraction layer + IoHwAb_Init(); +#endif + +} + +void EcuM_AL_DriverInitThree(const EcuM_ConfigType* ConfigPtr) +{ + (void)ConfigPtr; + //lint --e{715} PC-Lint (715) - ConfigPtr usage depends on configuration of modules + +#if defined(USE_DEM) + // Setup DEM + Dem_Init(); +#endif + +#if defined(USE_COMM) + // Setup Communication Manager + ComM_Init(ConfigPtr->ComMConfig); +#endif +} + +void EcuM_OnEnterRUN(void) +{ + +} + +void EcuM_OnExitRun(void) +{ + +} + +void EcuM_OnExitPostRun(void) +{ + +} + +void EcuM_OnPrepShutdown(void) +{ + +} + +void EcuM_OnGoSleep(void) +{ + +} + +void EcuM_OnGoOffOne(void) +{ + +} + +void EcuM_OnGoOffTwo(void) +{ + +} + +void EcuM_AL_SwitchOff(void) +{ + +} diff --git a/boards/stm32_stm3210c/examples/os_simple/config/EcuM_Cfg.h b/boards/stm32_stm3210c/examples/os_simple/config/EcuM_Cfg.h new file mode 100644 index 00000000..b1cc93f0 --- /dev/null +++ b/boards/stm32_stm3210c/examples/os_simple/config/EcuM_Cfg.h @@ -0,0 +1,41 @@ +/* +* Configuration of module: EcuM (EcuM_Cfg.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): STM32_F107 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +*/ + + +#if !(((ECUM_SW_MAJOR_VERSION == 2) && (ECUM_SW_MINOR_VERSION == 0)) ) +#error EcuM: Configuration file expected BSW module version to be 2.0.* +#endif + + + +#ifndef ECUM_CFG_H_ +#define ECUM_CFG_H_ + +#define ECUM_VERSION_INFO_API STD_OFF +#define ECUM_DEV_ERROR_DETECT STD_OFF + +#define ECUM_MAIN_FUNCTION_PERIOD (200) +#define ECUM_NVRAM_READALL_TIMEOUT (10000) +#define ECUM_NVRAM_WRITEALL_TIMEOUT (10000) +#define ECUM_NVRAM_MIN_RUN_DURATION (10000) + + +typedef enum { + ECUM_USER_User_1, + ECUM_USER_ENDMARK // Must be the last in list! +} EcuM_UserList; + + +#endif /*ECUM_CFG_H_*/ + diff --git a/boards/stm32_stm3210c/examples/os_simple/config/EcuM_Generated_Types.h b/boards/stm32_stm3210c/examples/os_simple/config/EcuM_Generated_Types.h new file mode 100644 index 00000000..907fb2b4 --- /dev/null +++ b/boards/stm32_stm3210c/examples/os_simple/config/EcuM_Generated_Types.h @@ -0,0 +1,178 @@ +/* +* Configuration of module: EcuM (EcuM_Generated_Types.h) +* +* Created by: +* Copyright: +* +* Configured for (MCU): STM32_F107 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +*/ + + +#if !(((ECUM_SW_MAJOR_VERSION == 2) && (ECUM_SW_MINOR_VERSION == 0)) ) +#error EcuM: Configuration file expected BSW module version to be 2.0.* +#endif + + +#ifndef _ECUM_GENERATED_TYPES_H_ +#define _ECUM_GENERATED_TYPES_H_ + +#if (ECUM_USE_SERVICE_PORTS == STD_ON) && defined(USE_RTE) +#include "Rte_EcuM.h" +#endif + +#include "EcuM_Types.h" + +#if defined(USE_MCU) +#include "Mcu.h" +#endif +#if defined(USE_PORT) +#include "Port.h" +#endif +#if defined(USE_CAN) +#include "Can.h" +#endif +#if defined(USE_CANIF) +#include "CanIf.h" +#endif +#if defined(USE_PWM) +#include "Pwm.h" +#endif +#if defined(USE_COM) +#include "Com.h" +#endif +#if defined(USE_PDUR) +#include "PduR.h" +#endif +#if defined(USE_DMA) +#include "Dma.h" +#endif +#if defined(USE_ADC) +#include "Adc.h" +#endif +#if defined(USE_GPT) +#include "Gpt.h" +#endif +#if defined(USE_COMM) +#include "ComM.h" +#endif +#if defined(USE_NM) +#include "Nm.h" +#endif +#if defined(USE_CANNM) +#include "CanNm.h" +#endif +#if defined(USE_CANSM) +#include "CanSM.h" +#endif +#if defined(USE_J1939TP) +#include "J1939Tp.h" +#endif +#if defined(USE_UDPNM) +#include "UdpNm.h" +#endif +#if defined(USE_LINSM) +#include "LinSM.h" +#endif +#if defined(USE_FLS) +#include "Fls.h" +#endif +#if defined(USE_EEP) +#include "Eep.h" +#endif +#if defined(USE_SPI) +#include "Spi.h" +#endif +#if defined(USE_WDG) +#include "Wdg.h" +#endif +#if defined(USE_WDGM) +#include "WdgM.h" +#endif +#if defined(USE_WDGIF) +#include "WdgIf.h" +#endif + + +typedef struct +{ + EcuM_StateType EcuMDefaultShutdownTarget; + uint8 EcuMDefaultSleepMode; + AppModeType EcuMDefaultAppMode; + uint32 EcuMRunMinimumDuration; + uint32 EcuMNvramReadAllTimeout; + uint32 EcuMNvramWriteAllTimeout; + +#if defined(USE_MCU) + const Mcu_ConfigType* McuConfig; +#endif +#if defined(USE_PORT) + const Port_ConfigType* PortConfig; +#endif +#if defined(USE_CAN) + const Can_ConfigType* CanConfig; +#endif +#if defined(USE_CANIF) + const CanIf_ConfigType* CanIfConfig; +#endif +#if defined(USE_CANSM) + const CanSM_ConfigType* CanSMConfig; +#endif +#if defined(USE_NM) + const Nm_ConfigType* NmConfig; +#endif +#if defined(USE_CANNM) + const CanNm_ConfigType* CanNmConfig; +#endif +#if defined(USE_UDPNM) + const UdpNm_ConfigType* UdpNmConfig; +#endif +#if defined(USE_COMM) + const ComM_ConfigType* ComMConfig; +#endif +#if defined(USE_COM) + const Com_ConfigType* ComConfig; +#endif +#if defined(USE_J1939TP) + const J1939Tp_ConfigType* J1939TpConfig; +#endif +#if defined(USE_PDUR) + const PduR_PBConfigType* PduRConfig; +#endif +#if defined(USE_PWM) + const Pwm_ConfigType* PwmConfig; +#endif +#if defined(USE_DMA) + const Dma_ConfigType* DmaConfig; +#endif +#if defined(USE_ADC) + const Adc_ConfigType* AdcConfig; +#endif +#if defined(USE_GPT) + const Gpt_ConfigType* GptConfig; +#endif +#if defined(USE_FLS) + const Fls_ConfigType* FlashConfig; +#endif +#if defined(USE_EEP) + const Eep_ConfigType* EepConfig; +#endif +#if defined(USE_SPI) + const Spi_ConfigType* SpiConfig; +#endif +#if defined(USE_WDG) + const Wdg_ConfigType* WdgConfig; +#endif +#if defined(USE_WDGIF) + const WdgIf_ConfigType* WdgIfConfig; +#endif +#if defined(USE_WDGM) + const WdgM_ConfigType* WdgMConfig; +#endif +} EcuM_ConfigType; + +#endif /*_ECUM_GENERATED_TYPES_H_*/ diff --git a/boards/stm32_stm3210c/examples/os_simple/config/EcuM_PBcfg.c b/boards/stm32_stm3210c/examples/os_simple/config/EcuM_PBcfg.c new file mode 100644 index 00000000..cfb351cf --- /dev/null +++ b/boards/stm32_stm3210c/examples/os_simple/config/EcuM_PBcfg.c @@ -0,0 +1,119 @@ +/* +* Configuration of module: EcuM (EcuM_PBcfg.c) +* +* Created by: +* Copyright: +* +* Configured for (MCU): STM32_F107 +* +* Module vendor: ArcCore +* Generator version: 2.0.2 +* +* Generated by Arctic Studio (http://arccore.com) +*/ + + + +#include "EcuM.h" +#include "EcuM_Generated_Types.h" + +#if defined(USE_CANSM) +extern const CanSM_ConfigType CanSM_Config; +#endif +#if defined(USE_NM) +extern const Nm_ConfigType Nm_Config; +#endif +#if defined(USE_CANNM) +extern const CanNm_ConfigType CanNm_Config; +#endif +#if defined(USE_UDPNM) +extern const UdpNm_ConfigType UdpNm_Config; +#endif +#if defined(USE_COMM) +extern const ComM_ConfigType ComM_Config; +#endif + +#if defined(USE_J1939TP) +extern const J1939Tp_ConfigType J1939Tp_Config; +#endif + + +EcuM_ConfigType EcuMConfig = +{ + .EcuMDefaultShutdownTarget = ECUM_STATE_RESET, + .EcuMDefaultSleepMode = 0, // Don't care + .EcuMDefaultAppMode = OSDEFAULTAPPMODE, + .EcuMNvramReadAllTimeout = ECUM_NVRAM_READALL_TIMEOUT, + .EcuMNvramWriteAllTimeout = ECUM_NVRAM_WRITEALL_TIMEOUT, + .EcuMRunMinimumDuration = ECUM_NVRAM_MIN_RUN_DURATION, + +#if defined(USE_MCU) + .McuConfig = McuConfigData, +#endif +#if defined(USE_PORT) + .PortConfig = &PortConfigData, +#endif +#if defined(USE_CAN) + .CanConfig = &CanConfigData, +#endif +#if defined(USE_CANIF) + .CanIfConfig = &CanIf_Config, +#endif +#if defined(USE_CANSM) + .CanSMConfig = &CanSM_Config, +#endif +#if defined(USE_CANNM) + .CanNmConfig = &CanNm_Config, +#endif +#if defined(USE_UDPNM) + .UdpNmConfig = &UdpNm_Config, +#endif +#if defined(USE_COM) + .ComConfig = &ComConfiguration, +#endif +#if defined(USE_COMM) + .ComMConfig = &ComM_Config, +#endif +#if defined(USE_J1939TP) + .J1939TpConfig = &J1939Tp_Config, +#endif +#if defined(USE_NM) + .NmConfig = &Nm_Config, +#endif +#if defined(USE_PDUR) + .PduRConfig = &PduR_Config, +#endif +#if defined(USE_J1939TP) + .J1939TpConfig = &J1939Tp_Config, +#endif +#if defined(USE_DMA) + .DmaConfig = DmaConfig, +#endif +#if defined(USE_ADC) + .AdcConfig = AdcConfig, +#endif +#if defined(USE_PWM) + .PwmConfig = &PwmConfig, +#endif +#if defined(USE_WDG) + .WdgConfig = &WdgConfig, +#endif +#if defined(USE_WDGM) + .WdgMConfig = &WdgMConfig, +#endif +#if defined(USE_WDGIF) + .WdgIfConfig = &WdgIfConfig, +#endif +#if defined(USE_GPT) + .GptConfig = GptConfigData, +#endif +#if defined(USE_FLS) + .FlashConfig = FlsConfigSet, +#endif +#if defined(USE_EEP) + .EepConfig = EepConfigData, +#endif +#if defined(USE_SPI) + .SpiConfig = &SpiConfigData, +#endif +}; diff --git a/boards/stm32_stm3210c/examples/os_simple/os_simple_stm32_stm3210c.arxml b/boards/stm32_stm3210c/examples/os_simple/os_simple_stm32_stm3210c.arxml index 4113daff..ca686acb 100644 --- a/boards/stm32_stm3210c/examples/os_simple/os_simple_stm32_stm3210c.arxml +++ b/boards/stm32_stm3210c/examples/os_simple/os_simple_stm32_stm3210c.arxml @@ -21,6 +21,7 @@ /os_simple_stm32_stm3210c/Mcu /os_simple_stm32_stm3210c/Os + /os_simple_stm32_stm3210c/EcuM @@ -623,6 +624,67 @@ + + EcuM + + + + + true + 2.0.2 + + + + /ArcCore/EcuM + + + EcuMGeneral + /ArcCore/EcuM/EcuMGeneral + + + /ArcCore/EcuM/EcuMGeneral/EcuMDevErrorDetect + false + + + /ArcCore/EcuM/EcuMGeneral/EcuMIncludeNvramMgr + false + + + /ArcCore/EcuM/EcuMGeneral/EcuMVersionInfoApi + false + + + /ArcCore/EcuM/EcuMGeneral/EcuMMainFunctionPeriod + 0.2 + + + + + EcuMConfiguration + /ArcCore/EcuM/EcuMConfiguration + + + /ArcCore/EcuM/EcuMConfiguration/EcuMNvramReadallTimeout + 10.0 + + + /ArcCore/EcuM/EcuMConfiguration/EcuMRunMinimumDuration + 10.0 + + + /ArcCore/EcuM/EcuMConfiguration/EcuMNvramWriteallTimeout + 10.0 + + + + + User_1 + /ArcCore/EcuM/EcuMConfiguration/EcuMUserConfig + + + + +