diff --git a/.gitignore b/.gitignore index 91bebf9..9b75be0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ Debug/** Debug/ +build/ /Release/ diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index c6d18b7..96f97e9 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -6,7 +6,7 @@ - + @@ -18,7 +18,7 @@ - + diff --git a/.settings/stm32cubeide.project.prefs b/.settings/stm32cubeide.project.prefs index 3ed0cc6..72c497b 100644 --- a/.settings/stm32cubeide.project.prefs +++ b/.settings/stm32cubeide.project.prefs @@ -1,5 +1,5 @@ -2F62501ED4689FB349E356AB974DBE57=3C8163665DC52502E88D788B0CED9B35 +2F62501ED4689FB349E356AB974DBE57=E4D6F48A5E072BF280AE61DC22F0EFF9 66BE74F758C12D739921AEA421D593D3=4 -8DF89ED150041C4CBC7CB9A9CAA90856=3C8163665DC52502E88D788B0CED9B35 -DC22A860405A8BF2F2C095E5B6529F12=3C6A73657F8CAB85FF62A66955B31FC6 +8DF89ED150041C4CBC7CB9A9CAA90856=E4D6F48A5E072BF280AE61DC22F0EFF9 +DC22A860405A8BF2F2C095E5B6529F12=F216BE080F2C17807F72AFE2348FF317 eclipse.preferences.version=1 diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..fcf9e1e --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,24 @@ +{ + "configurations": [ + { + "name": "STM32", + "includePath": [ + "Core", + "Core/Application", + "Core/Drivers", + "Core/Inc", + "Core/Toolbox", + "Drivers/CMSIS/Device/ST/STM32L4xx/Include", + "Drivers/CMSIS/Include", + "Drivers/STM32L4xx_HAL_Driver/Inc", + "Drivers/STM32L4xx_HAL_Driver/Inc/Legacy", + "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2", + "Middlewares/Third_Party/FreeRTOS/Source/include", + "Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F" + ], + "defines": [], + "compilerPath": "/Users/noahpique/Library/Application Support/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/arm-none-eabi-gcc/10.3.1-2.3.1/.content/bin/arm-none-eabi-gcc" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..c8fcb09 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "showDevDebugOutput": true, + "cwd": "${workspaceRoot}", + "executable": "./build/.elf", + "name": "Debug STM32", + "request": "launch", + "type": "cortex-debug", + "servertype": "openocd", + "preLaunchTask": "Build STM", + "device": "stlink", + "configFiles": [ + "openocd.cfg" + ] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 64639f3..7ff9dc0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,8 @@ { "C_Cpp.errorSquiggles": "Disabled", "cortex-debug.armToolchainPath": "/Users/noahpique/Library/Application Support/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/arm-none-eabi-gcc/10.3.1-2.3.1/.content/bin", - "cortex-debug.openocdPath": "/Users/noahpique/Library/Application Support/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/openocd/0.11.0-2.1/.content/bin/openocd" + "cortex-debug.openocdPath": "/Users/noahpique/Library/Application Support/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/openocd/0.11.0-2.1/.content/bin/openocd", + "files.associations": { + "peco_peltiercontroller.h": "c" + } } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..39d8d34 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,50 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Build STM", + "type": "process", + "command": "${command:stm32-for-vscode.build}", + "options": { + "cwd": "${workspaceRoot}" + }, + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ] + }, + { + "label": "Build Clean STM", + "type": "process", + "command": "${command:stm32-for-vscode.cleanBuild}", + "options": { + "cwd": "${workspaceRoot}" + }, + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ] + }, + { + "label": "Flash STM", + "type": "process", + "command": "${command:stm32-for-vscode.flash}", + "options": { + "cwd": "${workspaceRoot}" + }, + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ] + } + ] +} \ No newline at end of file diff --git a/Core/Application/MAIN_MainApplication.c b/Core/Application/MAIN_MainApplication.c index a7798d5..38f5dc2 100644 --- a/Core/Application/MAIN_MainApplication.c +++ b/Core/Application/MAIN_MainApplication.c @@ -57,17 +57,17 @@ // Description: Definition of local constants (visible by this module only). //================================================================================================= -#define SLOW_TEXT (U32)0x83767987 -#define FAST_TEXT (U32)0x46415354 - #define MSG_QUEUE_SIZE 8 - #define EVENT_NEW_MESSAGE ((U32)(1<<0)) #define EVENT_TIMER_UPDATE ((U32)(1<<1)) #define EVENT_FLAGS_ALL ( EVENT_NEW_MESSAGE | EVENT_TIMER_UPDATE ) +#define MESSAGE_TYPE_READ 0 +#define MESSAGE_TYPE_WRITE 1 +#define MESSAGE_TYPE_COMMAND 2 + //================================================================================================= // Section: MACROS // Description: Definition of local macros (visible by this module only). @@ -107,13 +107,8 @@ LOCAL osThreadId_t m_pstThreadID = NULL; LOCAL osMessageQueueId_t m_pstCANRxMsgQueueID = NULL; LOCAL osEventFlagsId_t m_pstEventID = NULL; - - LOCAL osTimerId_t m_pstUpdateTimer = NULL; - -LOCAL U32 m_u32DataCnt = 0; - //================================================================================================= // Section: LOCAL CONSTANTS // Description: Definition of local constants (visible by this module only). @@ -230,15 +225,19 @@ PRIVATE VOID vTask( PVOID arg ) // TODO: implement new protocol CAND_Message stMessage; - osMessageQueueGet( m_pstCANRxMsgQueueID, &stMessage, NULL, 0 ); + osMessageQueueGet( m_pstCANRxMsgQueueID, &stMessage, NULL, 0 ); + + U8 u8Register = stMessage.au8Data[0]; + U8 u8Typ = stMessage.au8Data[1]; + U32 u32Data = *(PU32)&stMessage.au8Data[2]; - if( stMessage.u8Id == 0x12 ){ + if( u8Register == 0x12 ){ S16 s16Voltage = stMessage.au8Data[0] << 8; s16Voltage |= stMessage.au8Data[1]; VARH_vSetVariableDataFloat( VARH_eControlVoltage, (FLOAT)s16Voltage / 1000 ); - } else if( stMessage.u8Id == 0x13 ){ + } else if( u8Register == 0x13 ){ S16 SupplyVoltage24V = (S16) ( VARH_flGetVariableData( VARH_eSupply_U ) * 1000 ); S16 SupplyCurrent24V = (S16) ( VARH_flGetVariableData( VARH_eSupply_I ) * 1000 ); @@ -256,7 +255,7 @@ PRIVATE VOID vTask( PVOID arg ) CAND_boSendMessage( 0x14, 8, au8Buffer ); - } else if( stMessage.u8Id == 0x15 ){ + } else if( u8Register == 0x15 ){ S16 Cold = (S16) ( VARH_flGetVariableData( VARH_eTemp_C ) * 100 ); S16 Hot = (S16) ( VARH_flGetVariableData( VARH_eTemp_H ) * 100 ); @@ -268,11 +267,11 @@ PRIVATE VOID vTask( PVOID arg ) CAND_boSendMessage( 0x16, 4, au8Buffer ); - } else if( stMessage.u8Id == 0x17 ){ + } else if( u8Register == 0x17 ){ PECO_Enable( TRUE ); - } else if( stMessage.u8Id == 0x18 ){ + } else if( u8Register == 0x18 ){ PECO_Enable( FALSE ); diff --git a/Core/Application/VARH_VariableHandler.c b/Core/Application/VARH_VariableHandler.c index 1fdd6cc..03337d1 100644 --- a/Core/Application/VARH_VariableHandler.c +++ b/Core/Application/VARH_VariableHandler.c @@ -342,7 +342,7 @@ U8 VARH_uGetVariableFlags( U8 u8Variable ) VOID VARH_vSetVariableToInitData( U8 u8Variable ) { osMutexAcquire( m_pstMutexID, osWaitForever ); // aquire mutex - VARH_vSetVariableDataFromSystem( u8Variable, m_astVarInfo[u8Variable].uInitData ); + vSetVariableDataFromSystem( u8Variable, m_astVarInfo[u8Variable].uInitData ); osMutexRelease( m_pstMutexID ); // release mutex } diff --git a/Core/Drivers/ANPO_AnalogPortsOut.c b/Core/Drivers/ANPO_AnalogPortsOut.c index b29a5f5..8be842d 100644 --- a/Core/Drivers/ANPO_AnalogPortsOut.c +++ b/Core/Drivers/ANPO_AnalogPortsOut.c @@ -139,9 +139,9 @@ BOOL ANPO_boInitializeModule( VOID ) BOOL ANPO_boSetVoltage( FLOAT Voltage ){ BOOL boOK = TRUE; - U32 RawData = u32ConvertVoltagetoRaw( Voltage ); + U32 u32RawData = u32ConvertVoltagetoRaw( Voltage ); - boOK &= HAL_DAC_SetValue( &hdac1, DAC_CHANNEL_1, DAC_ALIGN_12B_R, RawDatab ); + boOK &= HAL_DAC_SetValue( &hdac1, DAC_CHANNEL_1, DAC_ALIGN_12B_R, u32RawData ); return( boOK ); } diff --git a/Core/Drivers/CAND_CanDriver.c b/Core/Drivers/CAND_CanDriver.c index fe1db0a..4148438 100644 --- a/Core/Drivers/CAND_CanDriver.c +++ b/Core/Drivers/CAND_CanDriver.c @@ -7,7 +7,7 @@ //------------------------------------------------------------------------------------------------- // // Project: Peltier Controller V2 -// Author: Noah Piqu� (noah.pique@psi.ch) +// Author: Noah Piqué (noah.pique@psi.ch) // //------------------------------------------------------------------------------------------------- // @@ -36,6 +36,9 @@ // Toolbox #include "../Toolbox/UTIL_Utility.h" +// Driver +#include "DIPO_DigitalPorts.h" + // include STM32 drivers #include "stm32l4xx_hal.h" @@ -46,7 +49,11 @@ // Description: Definition of local constants (visible by this module only). //================================================================================================= +#define CAND_SHIFT 0x0 // Shift address space (0-3) +#define CAND_BOARD_GROUP 0x03 // Board group (0-127 / 0x00-0x7F) +#define CAND_PRIVATE 1 +#define CAND_PUBLIC 0 //================================================================================================= // Section: MACROS @@ -61,14 +68,10 @@ //================================================================================================= - - //================================================================================================= // Section: STRUCTURES // Description: Definition of local Structures (visible by this module only). //================================================================================================= - - //================================================================================================= @@ -77,6 +80,19 @@ //================================================================================================= CAND_pfnRxCallback m_pfnRxCallback = NULL; +CAN_FilterTypeDef stFilter = { + (CAND_SHIFT<<6)|(CAND_PUBLIC<<5)|(CAND_BOARD_GROUP<<1), // FilterIdHigh + 0x00, // FilterIdLow + (CAND_SHIFT<<6)|(CAND_PRIVATE<<5)|(CAND_BOARD_GROUP<<1), // FilterMaskIdHigh + 0x00, // FilterMaskIdLow + CAN_FILTER_FIFO0, // FilterFIFOAssignment + 0x00, // FilterBank + CAN_FILTERMODE_IDLIST, // FilterMode + CAN_FILTERSCALE_32BIT, // FilterScale + CAN_FILTER_ENABLE, // FilterActivation + 0x00 // SlaveStartFilterBank +}; + //================================================================================================= // Section: LOCAL CONSTANTS // Description: Definition of local constants (visible by this module only). @@ -117,6 +133,17 @@ extern CAN_HandleTypeDef hcan1; BOOL CAND_boInitializeModule( VOID ) { BOOL boOK = TRUE; + + U8 u8BoardId = 0x00; + u8BoardId |= DIPO_boGetInput(DIPO_eADR0) << 0; + u8BoardId |= DIPO_boGetInput(DIPO_eADR1) << 1; + u8BoardId |= DIPO_boGetInput(DIPO_eADR2) << 2; + //u8BoardId |= DIPO_boGetInput(DIPO_eADR0) << 3; // TODO: New HW + + stFilter.FilterIdHigh |= u8BoardId >> 3; + stFilter.FilterIdLow |= u8BoardId << 5; + + HAL_CAN_ConfigFilter(&hcan1, &stFilter); boOK &= ( HAL_CAN_Start(&hcan1) == HAL_OK ) ? TRUE : FALSE; @@ -161,7 +188,6 @@ BOOL CAND_boSendMessage( U8 u8Id, U8 u8Len, PU8 pu8Buffer ){ // Returns: none //------------------------------------------------------------------------------------------------- VOID CAND_vSetRxCallback( CAND_pfnRxCallback pfnRxCallback ){ - m_pfnRxCallback = pfnRxCallback; } @@ -188,7 +214,6 @@ void HAL_CAN_RxFifo0MsgPendingCallback( CAN_HandleTypeDef *hcan ){ CAND_Message stMessage; - stMessage.u8Id = header.StdId; stMessage.u8Len = header.DLC; UTIL_vMemCopy( au8Data,stMessage.au8Data,stMessage.u8Len ); diff --git a/Core/Drivers/CAND_CanDriver.h b/Core/Drivers/CAND_CanDriver.h index 0b98937..49d13e3 100644 --- a/Core/Drivers/CAND_CanDriver.h +++ b/Core/Drivers/CAND_CanDriver.h @@ -62,7 +62,6 @@ extern "C" { //================================================================================================= typedef struct { - U8 u8Id; U8 au8Data[8]; U8 u8Len; } CAND_Message; diff --git a/PeltierControllerV3.ioc b/PeltierControllerV3.ioc index ae97ef4..3d64c0c 100644 --- a/PeltierControllerV3.ioc +++ b/PeltierControllerV3.ioc @@ -1,294 +1,293 @@ -#MicroXplorer Configuration settings - do not modify -ADC1.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_6 -ADC1.Channel-1\#ChannelRegularConversion=ADC_CHANNEL_16 -ADC1.Channel-2\#ChannelRegularConversion=ADC_CHANNEL_7 -ADC1.Channel-3\#ChannelRegularConversion=ADC_CHANNEL_15 -ADC1.ContinuousConvMode=ENABLE -ADC1.DMAContinuousRequests=ENABLE -ADC1.EOCSelection=ADC_EOC_SEQ_CONV -ADC1.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,NbrOfConversionFlag,NbrOfConversion,ContinuousConvMode,DMAContinuousRequests,Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,OffsetNumber-1\#ChannelRegularConversion,Rank-2\#ChannelRegularConversion,Channel-2\#ChannelRegularConversion,SamplingTime-2\#ChannelRegularConversion,OffsetNumber-2\#ChannelRegularConversion,Rank-3\#ChannelRegularConversion,Channel-3\#ChannelRegularConversion,SamplingTime-3\#ChannelRegularConversion,OffsetNumber-3\#ChannelRegularConversion,EOCSelection,OversamplingMode,RightBitShift,Ratio,master -ADC1.NbrOfConversion=4 -ADC1.NbrOfConversionFlag=1 -ADC1.OffsetNumber-0\#ChannelRegularConversion=ADC_OFFSET_NONE -ADC1.OffsetNumber-1\#ChannelRegularConversion=ADC_OFFSET_NONE -ADC1.OffsetNumber-2\#ChannelRegularConversion=ADC_OFFSET_NONE -ADC1.OffsetNumber-3\#ChannelRegularConversion=ADC_OFFSET_NONE -ADC1.OversamplingMode=ENABLE -ADC1.Rank-0\#ChannelRegularConversion=1 -ADC1.Rank-1\#ChannelRegularConversion=2 -ADC1.Rank-2\#ChannelRegularConversion=3 -ADC1.Rank-3\#ChannelRegularConversion=4 -ADC1.Ratio=ADC_OVERSAMPLING_RATIO_256 -ADC1.RightBitShift=ADC_RIGHTBITSHIFT_4 -ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_640CYCLES_5 -ADC1.SamplingTime-1\#ChannelRegularConversion=ADC_SAMPLETIME_640CYCLES_5 -ADC1.SamplingTime-2\#ChannelRegularConversion=ADC_SAMPLETIME_640CYCLES_5 -ADC1.SamplingTime-3\#ChannelRegularConversion=ADC_SAMPLETIME_640CYCLES_5 -ADC1.master=1 -CAN1.BS1=CAN_BS1_3TQ -CAN1.CalculateBaudRate=1000000 -CAN1.CalculateTimeBit=1000.00 -CAN1.CalculateTimeQuantum=200.0 -CAN1.IPParameters=CalculateTimeQuantum,CalculateTimeBit,CalculateBaudRate,BS1,Prescaler -CAN1.Prescaler=16 -Dma.ADC1.2.Direction=DMA_PERIPH_TO_MEMORY -Dma.ADC1.2.Instance=DMA2_Channel3 -Dma.ADC1.2.MemDataAlignment=DMA_MDATAALIGN_HALFWORD -Dma.ADC1.2.MemInc=DMA_MINC_ENABLE -Dma.ADC1.2.Mode=DMA_CIRCULAR -Dma.ADC1.2.PeriphDataAlignment=DMA_PDATAALIGN_HALFWORD -Dma.ADC1.2.PeriphInc=DMA_PINC_DISABLE -Dma.ADC1.2.Priority=DMA_PRIORITY_HIGH -Dma.ADC1.2.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority -Dma.Request0=SPI1_RX -Dma.Request1=SPI1_TX -Dma.Request2=ADC1 -Dma.RequestsNb=3 -Dma.SPI1_RX.0.Direction=DMA_PERIPH_TO_MEMORY -Dma.SPI1_RX.0.Instance=DMA1_Channel2 -Dma.SPI1_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE -Dma.SPI1_RX.0.MemInc=DMA_MINC_ENABLE -Dma.SPI1_RX.0.Mode=DMA_NORMAL -Dma.SPI1_RX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE -Dma.SPI1_RX.0.PeriphInc=DMA_PINC_DISABLE -Dma.SPI1_RX.0.Priority=DMA_PRIORITY_LOW -Dma.SPI1_RX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority -Dma.SPI1_TX.1.Direction=DMA_MEMORY_TO_PERIPH -Dma.SPI1_TX.1.Instance=DMA1_Channel3 -Dma.SPI1_TX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE -Dma.SPI1_TX.1.MemInc=DMA_MINC_ENABLE -Dma.SPI1_TX.1.Mode=DMA_NORMAL -Dma.SPI1_TX.1.PeriphDataAlignment=DMA_PDATAALIGN_BYTE -Dma.SPI1_TX.1.PeriphInc=DMA_PINC_DISABLE -Dma.SPI1_TX.1.Priority=DMA_PRIORITY_LOW -Dma.SPI1_TX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority -FREERTOS.FootprintOK=true -FREERTOS.IPParameters=Tasks01,FootprintOK,configTOTAL_HEAP_SIZE,configUSE_NEWLIB_REENTRANT -FREERTOS.Tasks01=Default,24,128,vDefaultTask,Default,NULL,Dynamic,NULL,NULL -FREERTOS.configTOTAL_HEAP_SIZE=32768 -FREERTOS.configUSE_NEWLIB_REENTRANT=1 -File.Version=6 -GPIO.groupedBy=Group By Peripherals -KeepUserPlacement=false -Mcu.Family=STM32L4 -Mcu.IP0=ADC1 -Mcu.IP1=CAN1 -Mcu.IP2=DAC1 -Mcu.IP3=DMA -Mcu.IP4=FREERTOS -Mcu.IP5=NVIC -Mcu.IP6=RCC -Mcu.IP7=SPI1 -Mcu.IP8=SYS -Mcu.IPNb=9 -Mcu.Name=STM32L432K(B-C)Ux -Mcu.Package=UFQFPN32 -Mcu.Pin0=PA0 -Mcu.Pin1=PA1 -Mcu.Pin10=PA10 -Mcu.Pin11=PA11 -Mcu.Pin12=PA12 -Mcu.Pin13=PA13 (JTMS-SWDIO) -Mcu.Pin14=PA14 (JTCK-SWCLK) -Mcu.Pin15=PA15 (JTDI) -Mcu.Pin16=PB3 (JTDO-TRACESWO) -Mcu.Pin17=PB4 (NJTRST) -Mcu.Pin18=PB5 -Mcu.Pin19=PB6 -Mcu.Pin2=PA2 -Mcu.Pin20=PB7 -Mcu.Pin21=VP_FREERTOS_VS_CMSIS_V2 -Mcu.Pin22=VP_SYS_VS_Systick -Mcu.Pin3=PA4 -Mcu.Pin4=PA5 -Mcu.Pin5=PA6 -Mcu.Pin6=PA7 -Mcu.Pin7=PB0 -Mcu.Pin8=PB1 -Mcu.Pin9=PA8 -Mcu.PinsNb=23 -Mcu.ThirdPartyNb=0 -Mcu.UserConstants= -Mcu.UserName=STM32L432KBUx -MxCube.Version=6.3.0 -MxDb.Version=DB.6.0.30 -NVIC.ADC1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true -NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false -NVIC.CAN1_RX0_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true -NVIC.CAN1_RX1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true -NVIC.CAN1_SCE_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true -NVIC.CAN1_TX_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true -NVIC.DMA1_Channel2_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true -NVIC.DMA1_Channel3_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true -NVIC.DMA2_Channel3_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true -NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false -NVIC.ForceEnableDMAVector=true -NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false -NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false -NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false -NVIC.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:false -NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 -NVIC.SPI1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true -NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false -NVIC.SavedPendsvIrqHandlerGenerated=false -NVIC.SavedSvcallIrqHandlerGenerated=false -NVIC.SavedSystickIrqHandlerGenerated=false -NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:true\:false\:true -NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false -PA0.Mode=HSE-External-Clock-Source-for-LittleOrca -PA0.Signal=RCC_CK_IN -PA1.Locked=true -PA1.Signal=ADCx_IN6 -PA10.GPIOParameters=GPIO_Label -PA10.GPIO_Label=LED -PA10.Locked=true -PA10.Signal=GPIO_Output -PA11.Mode=CAN_Activate -PA11.Signal=CAN1_RX -PA12.Mode=CAN_Activate -PA12.Signal=CAN1_TX -PA13\ (JTMS-SWDIO).Mode=Serial_Wire -PA13\ (JTMS-SWDIO).Signal=SYS_JTMS-SWDIO -PA14\ (JTCK-SWCLK).Mode=Serial_Wire -PA14\ (JTCK-SWCLK).Signal=SYS_JTCK-SWCLK -PA15\ (JTDI).GPIOParameters=GPIO_Label -PA15\ (JTDI).GPIO_Label=ADR0 -PA15\ (JTDI).Locked=true -PA15\ (JTDI).Signal=GPIO_Input -PA2.Locked=true -PA2.Signal=ADCx_IN7 -PA4.Locked=true -PA4.Signal=COMP_DAC11_group -PA5.Mode=Full_Duplex_Master -PA5.Signal=SPI1_SCK -PA6.Mode=Full_Duplex_Master -PA6.Signal=SPI1_MISO -PA7.Mode=Full_Duplex_Master -PA7.Signal=SPI1_MOSI -PA8.GPIOParameters=GPIO_Label -PA8.GPIO_Label=EN -PA8.Locked=true -PA8.Signal=GPIO_Output -PB0.Locked=true -PB0.Signal=ADCx_IN15 -PB1.Locked=true -PB1.Signal=ADCx_IN16 -PB3\ (JTDO-TRACESWO).GPIOParameters=GPIO_Label -PB3\ (JTDO-TRACESWO).GPIO_Label=ADR1 -PB3\ (JTDO-TRACESWO).Locked=true -PB3\ (JTDO-TRACESWO).Signal=GPIO_Input -PB4\ (NJTRST).GPIOParameters=GPIO_Label -PB4\ (NJTRST).GPIO_Label=ADR2 -PB4\ (NJTRST).Locked=true -PB4\ (NJTRST).Signal=GPIO_Input -PB5.GPIOParameters=GPIO_Label -PB5.GPIO_Label=CS1 -PB5.Locked=true -PB5.Signal=GPIO_Output -PB6.GPIOParameters=GPIO_Label -PB6.GPIO_Label=CS2 -PB6.Locked=true -PB6.Signal=GPIO_Output -PB7.GPIOParameters=GPIO_Label -PB7.GPIO_Label=PG -PB7.Locked=true -PB7.Signal=GPIO_Input -PinOutPanel.RotationAngle=0 -ProjectManager.AskForMigrate=true -ProjectManager.BackupPrevious=false -ProjectManager.CompilerOptimize=6 -ProjectManager.ComputerToolchain=false -ProjectManager.CoupleFile=false -ProjectManager.CustomerFirmwarePackage= -ProjectManager.DefaultFWLocation=true -ProjectManager.DeletePrevious=true -ProjectManager.DeviceId=STM32L432KBUx -ProjectManager.FirmwarePackage=STM32Cube FW_L4 V1.17.0 -ProjectManager.FreePins=false -ProjectManager.HalAssertFull=false -ProjectManager.HeapSize=0x200 -ProjectManager.KeepUserCode=true -ProjectManager.LastFirmware=false -ProjectManager.LibraryCopy=1 -ProjectManager.MainLocation=Core/Src -ProjectManager.NoMain=false -ProjectManager.PreviousToolchain=STM32CubeIDE -ProjectManager.ProjectBuild=false -ProjectManager.ProjectFileName=PeltierControllerV3.ioc -ProjectManager.ProjectName=PeltierControllerV3 -ProjectManager.RegisterCallBack= -ProjectManager.StackSize=0x400 -ProjectManager.TargetToolchain=STM32CubeIDE -ProjectManager.ToolChainLocation= -ProjectManager.UnderRoot=true -ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_ADC1_Init-ADC1-false-HAL-true,5-MX_CAN1_Init-CAN1-false-HAL-true,6-MX_DAC1_Init-DAC1-false-HAL-true,7-MX_SPI1_Init-SPI1-false-HAL-true -RCC.ADCCLockSelection=RCC_ADCCLKSOURCE_SYSCLK -RCC.ADCFreq_Value=80000000 -RCC.AHBFreq_Value=80000000 -RCC.APB1Freq_Value=80000000 -RCC.APB1TimFreq_Value=80000000 -RCC.APB2Freq_Value=80000000 -RCC.APB2TimFreq_Value=80000000 -RCC.CortexFreq_Value=80000000 -RCC.FCLKCortexFreq_Value=80000000 -RCC.FamilyName=M -RCC.HCLKFreq_Value=80000000 -RCC.HSE_VALUE=40000000 -RCC.HSI48_VALUE=48000000 -RCC.HSI_VALUE=16000000 -RCC.I2C1Freq_Value=80000000 -RCC.I2C3Freq_Value=80000000 -RCC.IPParameters=ADCCLockSelection,ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,MSI_VALUE,PLLM,PLLN,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USART2Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value -RCC.LPTIM1Freq_Value=80000000 -RCC.LPTIM2Freq_Value=80000000 -RCC.LPUART1Freq_Value=80000000 -RCC.LSCOPinFreq_Value=32000 -RCC.LSE_VALUE=32768 -RCC.LSI_VALUE=32000 -RCC.MCO1PinFreq_Value=80000000 -RCC.MSI_VALUE=4000000 -RCC.PLLM=4 -RCC.PLLN=16 -RCC.PLLPoutputFreq_Value=22857142.85714286 -RCC.PLLQoutputFreq_Value=80000000 -RCC.PLLRCLKFreq_Value=80000000 -RCC.PLLSAI1PoutputFreq_Value=11428571.42857143 -RCC.PLLSAI1QoutputFreq_Value=40000000 -RCC.PLLSAI1RoutputFreq_Value=40000000 -RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE -RCC.PWRFreq_Value=80000000 -RCC.RNGFreq_Value=40000000 -RCC.SAI1Freq_Value=11428571.42857143 -RCC.SWPMI1Freq_Value=80000000 -RCC.SYSCLKFreq_VALUE=80000000 -RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK -RCC.USART1Freq_Value=80000000 -RCC.USART2Freq_Value=80000000 -RCC.USBFreq_Value=40000000 -RCC.VCOInputFreq_Value=10000000 -RCC.VCOOutputFreq_Value=160000000 -RCC.VCOSAI1OutputFreq_Value=80000000 -SH.ADCx_IN15.0=ADC1_IN15,IN15-Single-Ended -SH.ADCx_IN15.ConfNb=1 -SH.ADCx_IN16.0=ADC1_IN16,IN16-Single-Ended -SH.ADCx_IN16.ConfNb=1 -SH.ADCx_IN6.0=ADC1_IN6,IN6-Single-Ended -SH.ADCx_IN6.ConfNb=1 -SH.ADCx_IN7.0=ADC1_IN7,IN7-Single-Ended -SH.ADCx_IN7.ConfNb=1 -SH.COMP_DAC11_group.0=DAC1_OUT1,DAC_OUT1 -SH.COMP_DAC11_group.ConfNb=1 -SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_128 -SPI1.CLKPhase=SPI_PHASE_2EDGE -SPI1.CalculateBaudRate=625.0 KBits/s -SPI1.DataSize=SPI_DATASIZE_8BIT -SPI1.Direction=SPI_DIRECTION_2LINES -SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,DataSize,BaudRatePrescaler,CLKPhase -SPI1.Mode=SPI_MODE_MASTER -SPI1.VirtualType=VM_MASTER -VP_FREERTOS_VS_CMSIS_V2.Mode=CMSIS_V2 -VP_FREERTOS_VS_CMSIS_V2.Signal=FREERTOS_VS_CMSIS_V2 -VP_SYS_VS_Systick.Mode=SysTick -VP_SYS_VS_Systick.Signal=SYS_VS_Systick -board=custom -isbadioc=false +#MicroXplorer Configuration settings - do not modify +ADC1.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_6 +ADC1.Channel-1\#ChannelRegularConversion=ADC_CHANNEL_16 +ADC1.Channel-2\#ChannelRegularConversion=ADC_CHANNEL_7 +ADC1.Channel-3\#ChannelRegularConversion=ADC_CHANNEL_15 +ADC1.ContinuousConvMode=ENABLE +ADC1.DMAContinuousRequests=ENABLE +ADC1.EOCSelection=ADC_EOC_SEQ_CONV +ADC1.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,NbrOfConversionFlag,NbrOfConversion,ContinuousConvMode,DMAContinuousRequests,Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,OffsetNumber-1\#ChannelRegularConversion,Rank-2\#ChannelRegularConversion,Channel-2\#ChannelRegularConversion,SamplingTime-2\#ChannelRegularConversion,OffsetNumber-2\#ChannelRegularConversion,Rank-3\#ChannelRegularConversion,Channel-3\#ChannelRegularConversion,SamplingTime-3\#ChannelRegularConversion,OffsetNumber-3\#ChannelRegularConversion,EOCSelection,OversamplingMode,RightBitShift,Ratio,master +ADC1.NbrOfConversion=4 +ADC1.NbrOfConversionFlag=1 +ADC1.OffsetNumber-0\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC1.OffsetNumber-1\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC1.OffsetNumber-2\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC1.OffsetNumber-3\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC1.OversamplingMode=ENABLE +ADC1.Rank-0\#ChannelRegularConversion=1 +ADC1.Rank-1\#ChannelRegularConversion=2 +ADC1.Rank-2\#ChannelRegularConversion=3 +ADC1.Rank-3\#ChannelRegularConversion=4 +ADC1.Ratio=ADC_OVERSAMPLING_RATIO_256 +ADC1.RightBitShift=ADC_RIGHTBITSHIFT_4 +ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_640CYCLES_5 +ADC1.SamplingTime-1\#ChannelRegularConversion=ADC_SAMPLETIME_640CYCLES_5 +ADC1.SamplingTime-2\#ChannelRegularConversion=ADC_SAMPLETIME_640CYCLES_5 +ADC1.SamplingTime-3\#ChannelRegularConversion=ADC_SAMPLETIME_640CYCLES_5 +ADC1.master=1 +CAN1.BS1=CAN_BS1_3TQ +CAN1.CalculateBaudRate=1000000 +CAN1.CalculateTimeBit=1000 +CAN1.CalculateTimeQuantum=200.0 +CAN1.IPParameters=CalculateTimeQuantum,CalculateTimeBit,CalculateBaudRate,BS1,Prescaler +CAN1.Prescaler=16 +Dma.ADC1.2.Direction=DMA_PERIPH_TO_MEMORY +Dma.ADC1.2.Instance=DMA2_Channel3 +Dma.ADC1.2.MemDataAlignment=DMA_MDATAALIGN_HALFWORD +Dma.ADC1.2.MemInc=DMA_MINC_ENABLE +Dma.ADC1.2.Mode=DMA_CIRCULAR +Dma.ADC1.2.PeriphDataAlignment=DMA_PDATAALIGN_HALFWORD +Dma.ADC1.2.PeriphInc=DMA_PINC_DISABLE +Dma.ADC1.2.Priority=DMA_PRIORITY_HIGH +Dma.ADC1.2.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority +Dma.Request0=SPI1_RX +Dma.Request1=SPI1_TX +Dma.Request2=ADC1 +Dma.RequestsNb=3 +Dma.SPI1_RX.0.Direction=DMA_PERIPH_TO_MEMORY +Dma.SPI1_RX.0.Instance=DMA1_Channel2 +Dma.SPI1_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.SPI1_RX.0.MemInc=DMA_MINC_ENABLE +Dma.SPI1_RX.0.Mode=DMA_NORMAL +Dma.SPI1_RX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.SPI1_RX.0.PeriphInc=DMA_PINC_DISABLE +Dma.SPI1_RX.0.Priority=DMA_PRIORITY_LOW +Dma.SPI1_RX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority +Dma.SPI1_TX.1.Direction=DMA_MEMORY_TO_PERIPH +Dma.SPI1_TX.1.Instance=DMA1_Channel3 +Dma.SPI1_TX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.SPI1_TX.1.MemInc=DMA_MINC_ENABLE +Dma.SPI1_TX.1.Mode=DMA_NORMAL +Dma.SPI1_TX.1.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.SPI1_TX.1.PeriphInc=DMA_PINC_DISABLE +Dma.SPI1_TX.1.Priority=DMA_PRIORITY_LOW +Dma.SPI1_TX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority +FREERTOS.FootprintOK=true +FREERTOS.IPParameters=Tasks01,FootprintOK,configTOTAL_HEAP_SIZE,configUSE_NEWLIB_REENTRANT +FREERTOS.Tasks01=Default,24,128,vDefaultTask,Default,NULL,Dynamic,NULL,NULL +FREERTOS.configTOTAL_HEAP_SIZE=32768 +FREERTOS.configUSE_NEWLIB_REENTRANT=1 +File.Version=6 +GPIO.groupedBy=Group By Peripherals +KeepUserPlacement=false +Mcu.Family=STM32L4 +Mcu.IP0=ADC1 +Mcu.IP1=CAN1 +Mcu.IP2=DAC1 +Mcu.IP3=DMA +Mcu.IP4=FREERTOS +Mcu.IP5=NVIC +Mcu.IP6=RCC +Mcu.IP7=SPI1 +Mcu.IP8=SYS +Mcu.IPNb=9 +Mcu.Name=STM32L432K(B-C)Ux +Mcu.Package=UFQFPN32 +Mcu.Pin0=PA0 +Mcu.Pin1=PA1 +Mcu.Pin10=PA10 +Mcu.Pin11=PA11 +Mcu.Pin12=PA12 +Mcu.Pin13=PA13 (JTMS-SWDIO) +Mcu.Pin14=PA14 (JTCK-SWCLK) +Mcu.Pin15=PA15 (JTDI) +Mcu.Pin16=PB3 (JTDO-TRACESWO) +Mcu.Pin17=PB4 (NJTRST) +Mcu.Pin18=PB5 +Mcu.Pin19=PB6 +Mcu.Pin2=PA2 +Mcu.Pin20=PB7 +Mcu.Pin21=VP_FREERTOS_VS_CMSIS_V2 +Mcu.Pin22=VP_SYS_VS_Systick +Mcu.Pin3=PA4 +Mcu.Pin4=PA5 +Mcu.Pin5=PA6 +Mcu.Pin6=PA7 +Mcu.Pin7=PB0 +Mcu.Pin8=PB1 +Mcu.Pin9=PA8 +Mcu.PinsNb=23 +Mcu.ThirdPartyNb=0 +Mcu.UserConstants= +Mcu.UserName=STM32L432KBUx +MxCube.Version=6.3.0 +MxDb.Version=DB.6.0.30 +NVIC.ADC1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true +NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +NVIC.CAN1_RX0_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true +NVIC.CAN1_RX1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true +NVIC.CAN1_SCE_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true +NVIC.CAN1_TX_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true +NVIC.DMA1_Channel2_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true +NVIC.DMA1_Channel3_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true +NVIC.DMA2_Channel3_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true +NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +NVIC.ForceEnableDMAVector=true +NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +NVIC.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:false +NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 +NVIC.SPI1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true +NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false +NVIC.SavedPendsvIrqHandlerGenerated=false +NVIC.SavedSvcallIrqHandlerGenerated=false +NVIC.SavedSystickIrqHandlerGenerated=false +NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:true\:false\:true +NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +PA0.Mode=HSE-External-Clock-Source-for-LittleOrca +PA0.Signal=RCC_CK_IN +PA1.Locked=true +PA1.Signal=ADCx_IN6 +PA10.GPIOParameters=GPIO_Label +PA10.GPIO_Label=LED +PA10.Locked=true +PA10.Signal=GPIO_Output +PA11.Mode=CAN_Activate +PA11.Signal=CAN1_RX +PA12.Mode=CAN_Activate +PA12.Signal=CAN1_TX +PA13\ (JTMS-SWDIO).Mode=Serial_Wire +PA13\ (JTMS-SWDIO).Signal=SYS_JTMS-SWDIO +PA14\ (JTCK-SWCLK).Mode=Serial_Wire +PA14\ (JTCK-SWCLK).Signal=SYS_JTCK-SWCLK +PA15\ (JTDI).GPIOParameters=GPIO_Label +PA15\ (JTDI).GPIO_Label=ADR0 +PA15\ (JTDI).Locked=true +PA15\ (JTDI).Signal=GPIO_Input +PA2.Locked=true +PA2.Signal=ADCx_IN7 +PA4.Locked=true +PA4.Signal=COMP_DAC11_group +PA5.Mode=Full_Duplex_Master +PA5.Signal=SPI1_SCK +PA6.Mode=Full_Duplex_Master +PA6.Signal=SPI1_MISO +PA7.Mode=Full_Duplex_Master +PA7.Signal=SPI1_MOSI +PA8.GPIOParameters=GPIO_Label +PA8.GPIO_Label=EN +PA8.Locked=true +PA8.Signal=GPIO_Output +PB0.Locked=true +PB0.Signal=ADCx_IN15 +PB1.Locked=true +PB1.Signal=ADCx_IN16 +PB3\ (JTDO-TRACESWO).GPIOParameters=GPIO_Label +PB3\ (JTDO-TRACESWO).GPIO_Label=ADR1 +PB3\ (JTDO-TRACESWO).Locked=true +PB3\ (JTDO-TRACESWO).Signal=GPIO_Input +PB4\ (NJTRST).GPIOParameters=GPIO_Label +PB4\ (NJTRST).GPIO_Label=ADR2 +PB4\ (NJTRST).Locked=true +PB4\ (NJTRST).Signal=GPIO_Input +PB5.GPIOParameters=GPIO_Label +PB5.GPIO_Label=CS1 +PB5.Locked=true +PB5.Signal=GPIO_Output +PB6.GPIOParameters=GPIO_Label +PB6.GPIO_Label=CS2 +PB6.Locked=true +PB6.Signal=GPIO_Output +PB7.GPIOParameters=GPIO_Label +PB7.GPIO_Label=PG +PB7.Locked=true +PB7.Signal=GPIO_Input +PinOutPanel.RotationAngle=0 +ProjectManager.AskForMigrate=true +ProjectManager.BackupPrevious=false +ProjectManager.CompilerOptimize=6 +ProjectManager.ComputerToolchain=false +ProjectManager.CoupleFile=false +ProjectManager.CustomerFirmwarePackage= +ProjectManager.DefaultFWLocation=true +ProjectManager.DeletePrevious=true +ProjectManager.DeviceId=STM32L432KBUx +ProjectManager.FirmwarePackage=STM32Cube FW_L4 V1.17.0 +ProjectManager.FreePins=false +ProjectManager.HalAssertFull=false +ProjectManager.HeapSize=0x200 +ProjectManager.KeepUserCode=true +ProjectManager.LastFirmware=true +ProjectManager.LibraryCopy=1 +ProjectManager.MainLocation=Core/Src +ProjectManager.NoMain=false +ProjectManager.PreviousToolchain=STM32CubeIDE +ProjectManager.ProjectBuild=false +ProjectManager.ProjectFileName=PeltierControllerV3.ioc +ProjectManager.ProjectName=PeltierControllerV3 +ProjectManager.RegisterCallBack= +ProjectManager.StackSize=0x400 +ProjectManager.TargetToolchain=STM32CubeIDE +ProjectManager.ToolChainLocation= +ProjectManager.UnderRoot=true +ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_ADC1_Init-ADC1-false-HAL-true,5-MX_CAN1_Init-CAN1-false-HAL-true,6-MX_DAC1_Init-DAC1-false-HAL-true,7-MX_SPI1_Init-SPI1-false-HAL-true +RCC.ADCCLockSelection=RCC_ADCCLKSOURCE_SYSCLK +RCC.ADCFreq_Value=80000000 +RCC.AHBFreq_Value=80000000 +RCC.APB1Freq_Value=80000000 +RCC.APB1TimFreq_Value=80000000 +RCC.APB2Freq_Value=80000000 +RCC.APB2TimFreq_Value=80000000 +RCC.CortexFreq_Value=80000000 +RCC.FCLKCortexFreq_Value=80000000 +RCC.FamilyName=M +RCC.HCLKFreq_Value=80000000 +RCC.HSE_VALUE=40000000 +RCC.HSI48_VALUE=48000000 +RCC.HSI_VALUE=16000000 +RCC.I2C1Freq_Value=80000000 +RCC.I2C3Freq_Value=80000000 +RCC.IPParameters=ADCCLockSelection,ADCFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,MSI_VALUE,PLLM,PLLN,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PLLSourceVirtual,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USART2Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value +RCC.LPTIM1Freq_Value=80000000 +RCC.LPTIM2Freq_Value=80000000 +RCC.LPUART1Freq_Value=80000000 +RCC.LSCOPinFreq_Value=32000 +RCC.LSE_VALUE=32768 +RCC.LSI_VALUE=32000 +RCC.MCO1PinFreq_Value=80000000 +RCC.MSI_VALUE=4000000 +RCC.PLLM=4 +RCC.PLLN=16 +RCC.PLLPoutputFreq_Value=22857142.85714286 +RCC.PLLQoutputFreq_Value=80000000 +RCC.PLLRCLKFreq_Value=80000000 +RCC.PLLSAI1PoutputFreq_Value=11428571.42857143 +RCC.PLLSAI1QoutputFreq_Value=40000000 +RCC.PLLSAI1RoutputFreq_Value=40000000 +RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE +RCC.PWRFreq_Value=80000000 +RCC.RNGFreq_Value=40000000 +RCC.SAI1Freq_Value=11428571.42857143 +RCC.SWPMI1Freq_Value=80000000 +RCC.SYSCLKFreq_VALUE=80000000 +RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK +RCC.USART1Freq_Value=80000000 +RCC.USART2Freq_Value=80000000 +RCC.USBFreq_Value=40000000 +RCC.VCOInputFreq_Value=10000000 +RCC.VCOOutputFreq_Value=160000000 +RCC.VCOSAI1OutputFreq_Value=80000000 +SH.ADCx_IN15.0=ADC1_IN15,IN15-Single-Ended +SH.ADCx_IN15.ConfNb=1 +SH.ADCx_IN16.0=ADC1_IN16,IN16-Single-Ended +SH.ADCx_IN16.ConfNb=1 +SH.ADCx_IN6.0=ADC1_IN6,IN6-Single-Ended +SH.ADCx_IN6.ConfNb=1 +SH.ADCx_IN7.0=ADC1_IN7,IN7-Single-Ended +SH.ADCx_IN7.ConfNb=1 +SH.COMP_DAC11_group.0=DAC1_OUT1,DAC_OUT1 +SH.COMP_DAC11_group.ConfNb=1 +SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_128 +SPI1.CLKPhase=SPI_PHASE_2EDGE +SPI1.CalculateBaudRate=625.0 KBits/s +SPI1.DataSize=SPI_DATASIZE_8BIT +SPI1.Direction=SPI_DIRECTION_2LINES +SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,DataSize,BaudRatePrescaler,CLKPhase +SPI1.Mode=SPI_MODE_MASTER +SPI1.VirtualType=VM_MASTER +VP_FREERTOS_VS_CMSIS_V2.Mode=CMSIS_V2 +VP_FREERTOS_VS_CMSIS_V2.Signal=FREERTOS_VS_CMSIS_V2 +VP_SYS_VS_Systick.Mode=SysTick +VP_SYS_VS_Systick.Signal=SYS_VS_Systick +board=custom diff --git a/STM32-for-VSCode.config.yaml b/STM32-for-VSCode.config.yaml new file mode 100644 index 0000000..24c967c --- /dev/null +++ b/STM32-for-VSCode.config.yaml @@ -0,0 +1,77 @@ +# Configuration file for the STM32 for VSCode extension +# Arrays can be inputted in two ways. One is: [entry_1, entry_2, ..., entry_final] +# or by adding an indented list below the variable name e.g.: +# VARIABLE: +# - entry_1 +# - entry_2 + +# The project name +target: TEC +# Can be C or C++ +language: C + +optimization: Og + +# MCU settings +targetMCU: STM32L432KBUx +cpu: +fpu: +floatAbi: +ldscript: STM32L432KBUX_FLASH.ld # linker script + +# Compiler definitions. The -D prefix for the compiler will be automatically added. +cDefinitions: [] +cxxDefinitions: [] +asDefinitions: [] + +# Compiler definition files. you can add a single files or an array of files for different definitions. +# The file is expected to have a definition each new line. +# This allows to include for example a .definition file which can be ignored in git and can contain +# This can be convenient for passing along secrets at compile time, or generating a file for per device setup. +cDefinitionsFile: +cxxDefinitionsFile: +asDefinitionsFile: + +# Compiler flags +cFlags: [] +cxxFlags: [] +assemblyFlags: + - -specs=nosys.specs + + +# libraries to be included. The -l prefix to the library will be automatically added. +# Mind that non standard libraries should have a path to their respective directory. +libraries: [] +libraryDirectories: [] + +# Files or folders that will be excluded from compilation. +# Glob patterns (https://www.wikiwand.com/en/Glob_(programming)) can be used. +# Do mind that double stars are reserved in yaml +# these should be escaped with a: \ or the name should be in double quotes e.g. "**.test.**" +excludes: + - "**_Template.*" + + +# Include directories (directories containing .h or .hpp files) +# If a CubeMX makefile is present it will automatically include the include directories from that makefile. +includeDirectories: + - Core/Inc/** + - Middlewares/** + - Drivers/STM32L4xx_HAL_Driver/Inc/** + - Drivers/CMSIS/** + + +# Files that should be included in the compilation. +# If a CubeMX makefile is present it will automatically include the c and cpp/cxx files from that makefile. +# Glob patterns (https://www.wikiwand.com/en/Glob_(programming)) can be used. +# Do mind that double stars are reserved in yaml +# these should be escaped with a: \ or the name should be in double quotes e.g. "HARDWARE_DRIVER*.c" +sourceFiles: + - Core/Src/** + - Drivers/STM32L4xx_HAL_Driver/Src/** + + +# When no makefile is present it will show a warning pop-up. +# However when compilation without the CubeMX Makefile is desired, this can be turned of. +suppressMakefileWarning: false + \ No newline at end of file diff --git a/STM32Make.make b/STM32Make.make new file mode 100644 index 0000000..352bd13 --- /dev/null +++ b/STM32Make.make @@ -0,0 +1,239 @@ +########################################################################################################################## +# File automatically-generated by STM32forVSCode +########################################################################################################################## + +# ------------------------------------------------ +# Generic Makefile (based on gcc) +# +# ChangeLog : +# 2017-02-10 - Several enhancements + project update mode +# 2015-07-22 - first version +# ------------------------------------------------ + +###################################### +# target +###################################### +TARGET = TEC + + +###################################### +# building variables +###################################### +# debug build? +DEBUG = 1 +# optimization +OPT = -Og + + +####################################### +# paths +####################################### +# Build path +BUILD_DIR = build + +###################################### +# source +###################################### +# C sources +C_SOURCES = \ +Core/Src/freertos.c \ +Core/Src/main.c \ +Core/Src/stm32l4xx_hal_msp.c \ +Core/Src/stm32l4xx_it.c \ +Core/Src/syscalls.c \ +Core/Src/sysmem.c \ +Core/Src/system_stm32l4xx.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_can.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dac.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dac_ex.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi_ex.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c \ +Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c + + +CPP_SOURCES = \ + + +# ASM sources +ASM_SOURCES = \ + + + +####################################### +# binaries +####################################### +PREFIX = arm-none-eabi- +POSTFIX = " +# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx) +# either it can be added to the PATH environment variable. +GCC_PATH="/Users/noahpique/Library/Application Support/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/arm-none-eabi-gcc/10.3.1-2.3.1/.content/bin +ifdef GCC_PATH +CXX = $(GCC_PATH)/$(PREFIX)g++$(POSTFIX) +CC = $(GCC_PATH)/$(PREFIX)gcc$(POSTFIX) +AS = $(GCC_PATH)/$(PREFIX)gcc$(POSTFIX) -x assembler-with-cpp +CP = $(GCC_PATH)/$(PREFIX)objcopy$(POSTFIX) +SZ = $(GCC_PATH)/$(PREFIX)size$(POSTFIX) +else +CXX = $(PREFIX)g++ +CC = $(PREFIX)gcc +AS = $(PREFIX)gcc -x assembler-with-cpp +CP = $(PREFIX)objcopy +SZ = $(PREFIX)size +endif +HEX = $(CP) -O ihex +BIN = $(CP) -O binary -S + +####################################### +# CFLAGS +####################################### +# cpu +CPU = + +# fpu +FPU = + +# float-abi +FLOAT-ABI = + +# mcu +MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI) + +# macros for gcc +# AS defines +AS_DEFS = + +# C defines +C_DEFS = \ + + +# AS includes +AS_INCLUDES = \ + +# C includes +C_INCLUDES = \ +-ICore/Inc \ +-IDrivers/CMSIS/Device/ST/STM32L4xx/Include \ +-IDrivers/CMSIS/Include \ +-IDrivers/STM32L4xx_HAL_Driver/Inc \ +-IDrivers/STM32L4xx_HAL_Driver/Inc/Legacy \ +-IMiddlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 \ +-IMiddlewares/Third_Party/FreeRTOS/Source/include \ +-IMiddlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F + + + +# compile gcc flags +ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections + +CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections + +ifeq ($(DEBUG), 1) +CFLAGS += -g -gdwarf-2 +endif + +# Add additional flags +CFLAGS += +ASFLAGS += -specs=nosys.specs +CXXFLAGS = +CXXFLAGS += -feliminate-unused-debug-types + +# Generate dependency information +CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" + +####################################### +# LDFLAGS +####################################### +# link script +LDSCRIPT = STM32L432KBUX_FLASH.ld + +# libraries +LIBS = +LIBDIR = \ + + +# Additional LD Flags from config file +ADDITIONALLDFLAGS = -specs=nosys.specs + +LDFLAGS = $(MCU) $(ADDITIONALLDFLAGS) -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections + +# default action: build all +all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin + + +####################################### +# build the application +####################################### +# list of cpp program objects +OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(CPP_SOURCES:.cpp=.o))) +vpath %.cpp $(sort $(dir $(CPP_SOURCES))) +# list of C objects +OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) +vpath %.c $(sort $(dir $(C_SOURCES))) +# list of ASM program objects +OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))) +vpath %.s $(sort $(dir $(ASM_SOURCES))) + +$(BUILD_DIR)/%.o: %.cpp STM32Make.make | $(BUILD_DIR) + $(CXX) -c $(CXXFLAGS) $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.cpp=.lst)) $< -o $@ + +$(BUILD_DIR)/%.o: %.c STM32Make.make | $(BUILD_DIR) + $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ + +$(BUILD_DIR)/%.o: %.s STM32Make.make | $(BUILD_DIR) + $(AS) -c $(CFLAGS) $< -o $@ + +$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) STM32Make.make + $(CC) $(OBJECTS) $(LDFLAGS) -o $@ + $(SZ) $@ + +$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) + $(HEX) $< $@ + +$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) + $(BIN) $< $@ + +$(BUILD_DIR): + mkdir $@ + +####################################### +# flash +####################################### +flash: $(BUILD_DIR)/$(TARGET).elf + "/Users/noahpique/Library/Application Support/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/openocd/0.11.0-2.1/.content/bin/openocd" -f ./openocd.cfg -c "program $(BUILD_DIR)/$(TARGET).elf verify reset exit" + +####################################### +# erase +####################################### +erase: $(BUILD_DIR)/$(TARGET).elf + "/Users/noahpique/Library/Application Support/Code/User/globalStorage/bmd.stm32-for-vscode/@xpack-dev-tools/openocd/0.11.0-2.1/.content/bin/openocd" -f ./openocd.cfg -c "init; reset halt; STM32L432KBUx mass_erase 0; exit" + +####################################### +# clean up +####################################### +clean: + -rm -fR $(BUILD_DIR) + +####################################### +# dependencies +####################################### +-include $(wildcard $(BUILD_DIR)/*.d) + +# *** EOF *** \ No newline at end of file diff --git a/openocd.cfg b/openocd.cfg new file mode 100644 index 0000000..deb88d0 --- /dev/null +++ b/openocd.cfg @@ -0,0 +1,8 @@ +#OpenOCD configuration file, generated by STM32 for VSCode + +# Programmer, can be changed to several interfaces +# Standard will be the stlink interface as this is the standard for STM32 dev boards +source [find interface/stlink.cfg] + +# The target MCU. This should match your board +source [find target/.cfg]