diff --git a/FileInclude/MyADC.c b/FileInclude/MyADC.c index 40faa42..8a772f8 100644 --- a/FileInclude/MyADC.c +++ b/FileInclude/MyADC.c @@ -2,10 +2,30 @@ #include "MyTimer.h" #include "Driver_GPIO.h" #define NULL 0 +//#define nombreChannel 1 - void initADC(int channel){ - //coucou + + // activer la clock de l'ADC 1 + RCC->APB2ENR |= RCC_APB2ENR_ADC1EN; + RCC->CFGR |= 0x8000; + ADC1->CR2 |= ADC_CR2_ADON; + + // Choix du channel + ADC1->SQR3 |= channel << 0;// on est sur le premier car on a qu'un seul channel +} + +void startADC(void) { + ADC1->CR2 |= ADC_CR2_ADON; +} + +int read(void) { + int value ; + // Recuperer le bit de End of conversion + while (!(ADC1->SR & (0x01 << 1))); + //on veut masquer les 12 bits les plus bas donc on prend le not de 0x0f >> 12 (111000000000) + value = ADC1->DR & (~(0x0f << 12)); + return value; } @@ -13,3 +33,4 @@ void initADC(int channel){ + diff --git a/FileInclude/MyADC.h b/FileInclude/MyADC.h index 2263fe0..c3202fd 100644 --- a/FileInclude/MyADC.h +++ b/FileInclude/MyADC.h @@ -5,4 +5,8 @@ // initialise tout ce au'il y a a faire pour l'ADC: void initADC(int channel); +void startADC(void); + +int read(void); + #endif diff --git a/Listings/Projet1_Simulation.map b/Listings/Projet1_Simulation.map index 6dfea31..61228a5 100644 --- a/Listings/Projet1_Simulation.map +++ b/Listings/Projet1_Simulation.map @@ -4,10 +4,14 @@ Component: ARM Compiler 5.06 update 7 (build 960) Tool: armlink [4d3601] Section Cross References + prinicpal.o(i.Callback) refers to myadc.o(i.startADC) for startADC + prinicpal.o(i.Callback) refers to myadc.o(i.read) for read + prinicpal.o(i.Callback) refers to prinicpal.o(.data) for a prinicpal.o(i.main) refers to mytimer.o(i.MyTimer_Base_Init) for MyTimer_Base_Init - prinicpal.o(i.main) refers to mytimer.o(i.MyTimer_PWM) for MyTimer_PWM + prinicpal.o(i.main) refers to myadc.o(i.initADC) for initADC + prinicpal.o(i.main) refers to mytimer.o(i.MyTimer_ActiveIT) for MyTimer_ActiveIT prinicpal.o(i.main) refers to mytimer.o(i.MyTimer_Base_Start) for MyTimer_Base_Start - prinicpal.o(i.main) refers to mytimer.o(i.Set_PWM_PRCT) for Set_PWM_PRCT + prinicpal.o(i.main) refers to prinicpal.o(i.Callback) for Callback mytimer.o(i.MyTimer_ActiveIT) refers to mytimer.o(.data) for ptr1 mytimer.o(i.MyTimer_PWM) refers to driver_gpio.o(i.MyGPIO_Init) for MyGPIO_Init mytimer.o(i.TIM1_UP_IRQHandler) refers to mytimer.o(.data) for ptr1 @@ -53,6 +57,7 @@ Removing Unused input sections from the image. Removing driver_gpio.o(.rev16_text), (4 bytes). Removing driver_gpio.o(.revsh_text), (4 bytes). Removing driver_gpio.o(.rrx_text), (6 bytes). + Removing driver_gpio.o(i.MyGPIO_Init), (180 bytes). Removing driver_gpio.o(i.MyGPIO_Read), (12 bytes). Removing driver_gpio.o(i.MyGPIO_Reset), (14 bytes). Removing driver_gpio.o(i.MyGPIO_Set), (12 bytes). @@ -60,8 +65,12 @@ Removing Unused input sections from the image. Removing mytimer.o(.rev16_text), (4 bytes). Removing mytimer.o(.revsh_text), (4 bytes). Removing mytimer.o(.rrx_text), (6 bytes). - Removing mytimer.o(i.MyTimer_ActiveIT), (176 bytes). Removing mytimer.o(i.MyTimer_Base_Stop), (10 bytes). + Removing mytimer.o(i.MyTimer_PWM), (464 bytes). + Removing mytimer.o(i.Set_PWM_PRCT), (56 bytes). + Removing myadc.o(.rev16_text), (4 bytes). + Removing myadc.o(.revsh_text), (4 bytes). + Removing myadc.o(.rrx_text), (6 bytes). Removing startup_stm32f10x_md.o(HEAP), (512 bytes). Removing system_stm32f10x.o(.rev16_text), (4 bytes). Removing system_stm32f10x.o(.revsh_text), (4 bytes). @@ -69,7 +78,7 @@ Removing Unused input sections from the image. Removing system_stm32f10x.o(i.SystemCoreClockUpdate), (164 bytes). Removing system_stm32f10x.o(.data), (20 bytes). -21 unused section(s) (total 988 bytes) removed from the image. +26 unused section(s) (total 1526 bytes) removed from the image. ============================================================================== @@ -79,22 +88,24 @@ Image Symbol Table Symbol Name Value Ov Type Size Object(Section) - ../clib/microlib/init/entry.s 0x00000000 Number 0 entry9a.o ABSOLUTE - ../clib/microlib/init/entry.s 0x00000000 Number 0 entry7a.o ABSOLUTE - ../clib/microlib/init/entry.s 0x00000000 Number 0 entry8b.o ABSOLUTE ../clib/microlib/init/entry.s 0x00000000 Number 0 entry12b.o ABSOLUTE - ../clib/microlib/init/entry.s 0x00000000 Number 0 entry8a.o ABSOLUTE - ../clib/microlib/init/entry.s 0x00000000 Number 0 entry7b.o ABSOLUTE - ../clib/microlib/init/entry.s 0x00000000 Number 0 entry5.o ABSOLUTE - ../clib/microlib/init/entry.s 0x00000000 Number 0 entry.o ABSOLUTE - ../clib/microlib/init/entry.s 0x00000000 Number 0 entry2.o ABSOLUTE - ../clib/microlib/init/entry.s 0x00000000 Number 0 entry12a.o ABSOLUTE ../clib/microlib/init/entry.s 0x00000000 Number 0 entry11b.o ABSOLUTE ../clib/microlib/init/entry.s 0x00000000 Number 0 entry11a.o ABSOLUTE ../clib/microlib/init/entry.s 0x00000000 Number 0 entry10b.o ABSOLUTE ../clib/microlib/init/entry.s 0x00000000 Number 0 entry10a.o ABSOLUTE ../clib/microlib/init/entry.s 0x00000000 Number 0 entry9b.o ABSOLUTE + ../clib/microlib/init/entry.s 0x00000000 Number 0 entry12a.o ABSOLUTE + ../clib/microlib/init/entry.s 0x00000000 Number 0 entry9a.o ABSOLUTE + ../clib/microlib/init/entry.s 0x00000000 Number 0 entry8b.o ABSOLUTE + ../clib/microlib/init/entry.s 0x00000000 Number 0 entry8a.o ABSOLUTE + ../clib/microlib/init/entry.s 0x00000000 Number 0 entry7b.o ABSOLUTE + ../clib/microlib/init/entry.s 0x00000000 Number 0 entry7a.o ABSOLUTE + ../clib/microlib/init/entry.s 0x00000000 Number 0 entry.o ABSOLUTE + ../clib/microlib/init/entry.s 0x00000000 Number 0 entry5.o ABSOLUTE + ../clib/microlib/init/entry.s 0x00000000 Number 0 entry2.o ABSOLUTE + FileInclude\MyADC.c 0x00000000 Number 0 myadc.o ABSOLUTE FileInclude\MyTimer.c 0x00000000 Number 0 mytimer.o ABSOLUTE + FileInclude\\MyADC.c 0x00000000 Number 0 myadc.o ABSOLUTE FileInclude\\MyTimer.c 0x00000000 Number 0 mytimer.o ABSOLUTE RTE\Device\STM32F103RB\startup_stm32f10x_md.s 0x00000000 Number 0 startup_stm32f10x_md.o ABSOLUTE RTE\Device\STM32F103RB\system_stm32f10x.c 0x00000000 Number 0 system_stm32f10x.o ABSOLUTE @@ -120,26 +131,29 @@ Image Symbol Table __lit__00000000 0x08000100 Data 4 entry2.o(.ARM.Collect$$$$00002712) .text 0x08000104 Section 36 startup_stm32f10x_md.o(.text) .text 0x08000128 Section 36 init.o(.text) - i.MyGPIO_Init 0x0800014c Section 0 driver_gpio.o(i.MyGPIO_Init) - i.MyTimer_Base_Init 0x08000200 Section 0 mytimer.o(i.MyTimer_Base_Init) - i.MyTimer_Base_Start 0x0800026c Section 0 mytimer.o(i.MyTimer_Base_Start) - i.MyTimer_PWM 0x08000278 Section 0 mytimer.o(i.MyTimer_PWM) - i.SetSysClock 0x08000448 Section 0 system_stm32f10x.o(i.SetSysClock) - SetSysClock 0x08000449 Thumb Code 8 system_stm32f10x.o(i.SetSysClock) - i.SetSysClockTo72 0x08000450 Section 0 system_stm32f10x.o(i.SetSysClockTo72) - SetSysClockTo72 0x08000451 Thumb Code 214 system_stm32f10x.o(i.SetSysClockTo72) - i.Set_PWM_PRCT 0x08000530 Section 0 mytimer.o(i.Set_PWM_PRCT) - i.SystemInit 0x08000568 Section 0 system_stm32f10x.o(i.SystemInit) - i.TIM1_UP_IRQHandler 0x080005c8 Section 0 mytimer.o(i.TIM1_UP_IRQHandler) - i.TIM2_IRQHandler 0x080005ec Section 0 mytimer.o(i.TIM2_IRQHandler) - i.TIM3_IRQHandler 0x08000610 Section 0 mytimer.o(i.TIM3_IRQHandler) - i.TIM4_IRQHandler 0x08000634 Section 0 mytimer.o(i.TIM4_IRQHandler) - i.__scatterload_copy 0x08000658 Section 14 handlers.o(i.__scatterload_copy) - i.__scatterload_null 0x08000666 Section 2 handlers.o(i.__scatterload_null) - i.__scatterload_zeroinit 0x08000668 Section 14 handlers.o(i.__scatterload_zeroinit) - i.main 0x08000676 Section 0 prinicpal.o(i.main) - .data 0x20000000 Section 16 mytimer.o(.data) - STACK 0x20000010 Section 1024 startup_stm32f10x_md.o(STACK) + i.Callback 0x0800014c Section 0 prinicpal.o(i.Callback) + i.MyTimer_ActiveIT 0x08000160 Section 0 mytimer.o(i.MyTimer_ActiveIT) + i.MyTimer_Base_Init 0x08000210 Section 0 mytimer.o(i.MyTimer_Base_Init) + i.MyTimer_Base_Start 0x0800027c Section 0 mytimer.o(i.MyTimer_Base_Start) + i.SetSysClock 0x08000286 Section 0 system_stm32f10x.o(i.SetSysClock) + SetSysClock 0x08000287 Thumb Code 8 system_stm32f10x.o(i.SetSysClock) + i.SetSysClockTo72 0x08000290 Section 0 system_stm32f10x.o(i.SetSysClockTo72) + SetSysClockTo72 0x08000291 Thumb Code 214 system_stm32f10x.o(i.SetSysClockTo72) + i.SystemInit 0x08000370 Section 0 system_stm32f10x.o(i.SystemInit) + i.TIM1_UP_IRQHandler 0x080003d0 Section 0 mytimer.o(i.TIM1_UP_IRQHandler) + i.TIM2_IRQHandler 0x080003f4 Section 0 mytimer.o(i.TIM2_IRQHandler) + i.TIM3_IRQHandler 0x08000418 Section 0 mytimer.o(i.TIM3_IRQHandler) + i.TIM4_IRQHandler 0x0800043c Section 0 mytimer.o(i.TIM4_IRQHandler) + i.__scatterload_copy 0x08000460 Section 14 handlers.o(i.__scatterload_copy) + i.__scatterload_null 0x0800046e Section 2 handlers.o(i.__scatterload_null) + i.__scatterload_zeroinit 0x08000470 Section 14 handlers.o(i.__scatterload_zeroinit) + i.initADC 0x08000480 Section 0 myadc.o(i.initADC) + i.main 0x080004bc Section 0 prinicpal.o(i.main) + i.read 0x080004f8 Section 0 myadc.o(i.read) + i.startADC 0x08000520 Section 0 myadc.o(i.startADC) + .data 0x20000000 Section 4 prinicpal.o(.data) + .data 0x20000004 Section 16 mytimer.o(.data) + STACK 0x20000018 Section 1024 startup_stm32f10x_md.o(STACK) Global Symbols @@ -217,27 +231,30 @@ Image Symbol Table WWDG_IRQHandler 0x0800011f Thumb Code 0 startup_stm32f10x_md.o(.text) __scatterload 0x08000129 Thumb Code 28 init.o(.text) __scatterload_rt2 0x08000129 Thumb Code 0 init.o(.text) - MyGPIO_Init 0x0800014d Thumb Code 166 driver_gpio.o(i.MyGPIO_Init) - MyTimer_Base_Init 0x08000201 Thumb Code 98 mytimer.o(i.MyTimer_Base_Init) - MyTimer_Base_Start 0x0800026d Thumb Code 10 mytimer.o(i.MyTimer_Base_Start) - MyTimer_PWM 0x08000279 Thumb Code 448 mytimer.o(i.MyTimer_PWM) - Set_PWM_PRCT 0x08000531 Thumb Code 56 mytimer.o(i.Set_PWM_PRCT) - SystemInit 0x08000569 Thumb Code 78 system_stm32f10x.o(i.SystemInit) - TIM1_UP_IRQHandler 0x080005c9 Thumb Code 28 mytimer.o(i.TIM1_UP_IRQHandler) - TIM2_IRQHandler 0x080005ed Thumb Code 32 mytimer.o(i.TIM2_IRQHandler) - TIM3_IRQHandler 0x08000611 Thumb Code 28 mytimer.o(i.TIM3_IRQHandler) - TIM4_IRQHandler 0x08000635 Thumb Code 28 mytimer.o(i.TIM4_IRQHandler) - __scatterload_copy 0x08000659 Thumb Code 14 handlers.o(i.__scatterload_copy) - __scatterload_null 0x08000667 Thumb Code 2 handlers.o(i.__scatterload_null) - __scatterload_zeroinit 0x08000669 Thumb Code 14 handlers.o(i.__scatterload_zeroinit) - main 0x08000677 Thumb Code 56 prinicpal.o(i.main) - Region$$Table$$Base 0x080006b0 Number 0 anon$$obj.o(Region$$Table) - Region$$Table$$Limit 0x080006d0 Number 0 anon$$obj.o(Region$$Table) - ptr1 0x20000000 Data 4 mytimer.o(.data) - ptr2 0x20000004 Data 4 mytimer.o(.data) - ptr3 0x20000008 Data 4 mytimer.o(.data) - ptr4 0x2000000c Data 4 mytimer.o(.data) - __initial_sp 0x20000410 Data 0 startup_stm32f10x_md.o(STACK) + Callback 0x0800014d Thumb Code 16 prinicpal.o(i.Callback) + MyTimer_ActiveIT 0x08000161 Thumb Code 148 mytimer.o(i.MyTimer_ActiveIT) + MyTimer_Base_Init 0x08000211 Thumb Code 98 mytimer.o(i.MyTimer_Base_Init) + MyTimer_Base_Start 0x0800027d Thumb Code 10 mytimer.o(i.MyTimer_Base_Start) + SystemInit 0x08000371 Thumb Code 78 system_stm32f10x.o(i.SystemInit) + TIM1_UP_IRQHandler 0x080003d1 Thumb Code 28 mytimer.o(i.TIM1_UP_IRQHandler) + TIM2_IRQHandler 0x080003f5 Thumb Code 32 mytimer.o(i.TIM2_IRQHandler) + TIM3_IRQHandler 0x08000419 Thumb Code 28 mytimer.o(i.TIM3_IRQHandler) + TIM4_IRQHandler 0x0800043d Thumb Code 28 mytimer.o(i.TIM4_IRQHandler) + __scatterload_copy 0x08000461 Thumb Code 14 handlers.o(i.__scatterload_copy) + __scatterload_null 0x0800046f Thumb Code 2 handlers.o(i.__scatterload_null) + __scatterload_zeroinit 0x08000471 Thumb Code 14 handlers.o(i.__scatterload_zeroinit) + initADC 0x08000481 Thumb Code 50 myadc.o(i.initADC) + main 0x080004bd Thumb Code 56 prinicpal.o(i.main) + read 0x080004f9 Thumb Code 36 myadc.o(i.read) + startADC 0x08000521 Thumb Code 14 myadc.o(i.startADC) + Region$$Table$$Base 0x08000534 Number 0 anon$$obj.o(Region$$Table) + Region$$Table$$Limit 0x08000554 Number 0 anon$$obj.o(Region$$Table) + a 0x20000000 Data 4 prinicpal.o(.data) + ptr1 0x20000004 Data 4 mytimer.o(.data) + ptr2 0x20000008 Data 4 mytimer.o(.data) + ptr3 0x2000000c Data 4 mytimer.o(.data) + ptr4 0x20000010 Data 4 mytimer.o(.data) + __initial_sp 0x20000418 Data 0 startup_stm32f10x_md.o(STACK) @@ -245,54 +262,64 @@ Image Symbol Table Memory Map of the image - Image Entry point : 0x080000ed + Image Entry point : 0x08000105 - Load Region LR_IROM1 (Base: 0x08000000, Size: 0x000006e0, Max: 0x00020000, ABSOLUTE) + Load Region LR_1 (Base: 0x08000000, Size: 0x00000568, Max: 0xffffffff, ABSOLUTE) - Execution Region ER_IROM1 (Exec base: 0x08000000, Load base: 0x08000000, Size: 0x000006d0, Max: 0x00020000, ABSOLUTE) + Execution Region ER_RO (Exec base: 0x08000000, Load base: 0x08000000, Size: 0x00000554, Max: 0xffffffff, ABSOLUTE) Exec Addr Load Addr Size Type Attr Idx E Section Name Object - 0x08000000 0x08000000 0x000000ec Data RO 200 RESET startup_stm32f10x_md.o - 0x080000ec 0x080000ec 0x00000000 Code RO 251 * .ARM.Collect$$$$00000000 mc_w.l(entry.o) - 0x080000ec 0x080000ec 0x00000004 Code RO 254 .ARM.Collect$$$$00000001 mc_w.l(entry2.o) - 0x080000f0 0x080000f0 0x00000004 Code RO 257 .ARM.Collect$$$$00000004 mc_w.l(entry5.o) - 0x080000f4 0x080000f4 0x00000000 Code RO 259 .ARM.Collect$$$$00000008 mc_w.l(entry7b.o) - 0x080000f4 0x080000f4 0x00000000 Code RO 261 .ARM.Collect$$$$0000000A mc_w.l(entry8b.o) - 0x080000f4 0x080000f4 0x00000008 Code RO 262 .ARM.Collect$$$$0000000B mc_w.l(entry9a.o) - 0x080000fc 0x080000fc 0x00000004 Code RO 269 .ARM.Collect$$$$0000000E mc_w.l(entry12b.o) - 0x08000100 0x08000100 0x00000000 Code RO 264 .ARM.Collect$$$$0000000F mc_w.l(entry10a.o) - 0x08000100 0x08000100 0x00000000 Code RO 266 .ARM.Collect$$$$00000011 mc_w.l(entry11a.o) - 0x08000100 0x08000100 0x00000004 Code RO 255 .ARM.Collect$$$$00002712 mc_w.l(entry2.o) - 0x08000104 0x08000104 0x00000024 Code RO 201 .text startup_stm32f10x_md.o - 0x08000128 0x08000128 0x00000024 Code RO 270 .text mc_w.l(init.o) - 0x0800014c 0x0800014c 0x000000b4 Code RO 63 i.MyGPIO_Init driver_gpio.o - 0x08000200 0x08000200 0x0000006c Code RO 115 i.MyTimer_Base_Init mytimer.o - 0x0800026c 0x0800026c 0x0000000a Code RO 116 i.MyTimer_Base_Start mytimer.o - 0x08000276 0x08000276 0x00000002 PAD - 0x08000278 0x08000278 0x000001d0 Code RO 118 i.MyTimer_PWM mytimer.o - 0x08000448 0x08000448 0x00000008 Code RO 208 i.SetSysClock system_stm32f10x.o - 0x08000450 0x08000450 0x000000e0 Code RO 209 i.SetSysClockTo72 system_stm32f10x.o - 0x08000530 0x08000530 0x00000038 Code RO 119 i.Set_PWM_PRCT mytimer.o - 0x08000568 0x08000568 0x00000060 Code RO 211 i.SystemInit system_stm32f10x.o - 0x080005c8 0x080005c8 0x00000024 Code RO 120 i.TIM1_UP_IRQHandler mytimer.o - 0x080005ec 0x080005ec 0x00000024 Code RO 121 i.TIM2_IRQHandler mytimer.o - 0x08000610 0x08000610 0x00000024 Code RO 122 i.TIM3_IRQHandler mytimer.o - 0x08000634 0x08000634 0x00000024 Code RO 123 i.TIM4_IRQHandler mytimer.o - 0x08000658 0x08000658 0x0000000e Code RO 274 i.__scatterload_copy mc_w.l(handlers.o) - 0x08000666 0x08000666 0x00000002 Code RO 275 i.__scatterload_null mc_w.l(handlers.o) - 0x08000668 0x08000668 0x0000000e Code RO 276 i.__scatterload_zeroinit mc_w.l(handlers.o) - 0x08000676 0x08000676 0x00000038 Code RO 4 i.main prinicpal.o - 0x080006ae 0x080006ae 0x00000002 PAD - 0x080006b0 0x080006b0 0x00000020 Data RO 272 Region$$Table anon$$obj.o + 0x08000000 0x08000000 0x000000ec Data RO 251 RESET startup_stm32f10x_md.o + 0x080000ec 0x080000ec 0x00000000 Code RO 302 * .ARM.Collect$$$$00000000 mc_w.l(entry.o) + 0x080000ec 0x080000ec 0x00000004 Code RO 305 .ARM.Collect$$$$00000001 mc_w.l(entry2.o) + 0x080000f0 0x080000f0 0x00000004 Code RO 308 .ARM.Collect$$$$00000004 mc_w.l(entry5.o) + 0x080000f4 0x080000f4 0x00000000 Code RO 310 .ARM.Collect$$$$00000008 mc_w.l(entry7b.o) + 0x080000f4 0x080000f4 0x00000000 Code RO 312 .ARM.Collect$$$$0000000A mc_w.l(entry8b.o) + 0x080000f4 0x080000f4 0x00000008 Code RO 313 .ARM.Collect$$$$0000000B mc_w.l(entry9a.o) + 0x080000fc 0x080000fc 0x00000004 Code RO 320 .ARM.Collect$$$$0000000E mc_w.l(entry12b.o) + 0x08000100 0x08000100 0x00000000 Code RO 315 .ARM.Collect$$$$0000000F mc_w.l(entry10a.o) + 0x08000100 0x08000100 0x00000000 Code RO 317 .ARM.Collect$$$$00000011 mc_w.l(entry11a.o) + 0x08000100 0x08000100 0x00000004 Code RO 306 .ARM.Collect$$$$00002712 mc_w.l(entry2.o) + 0x08000104 0x08000104 0x00000024 Code RO 252 * .text startup_stm32f10x_md.o + 0x08000128 0x08000128 0x00000024 Code RO 321 .text mc_w.l(init.o) + 0x0800014c 0x0800014c 0x00000014 Code RO 4 i.Callback prinicpal.o + 0x08000160 0x08000160 0x000000b0 Code RO 126 i.MyTimer_ActiveIT mytimer.o + 0x08000210 0x08000210 0x0000006c Code RO 127 i.MyTimer_Base_Init mytimer.o + 0x0800027c 0x0800027c 0x0000000a Code RO 128 i.MyTimer_Base_Start mytimer.o + 0x08000286 0x08000286 0x00000008 Code RO 259 i.SetSysClock system_stm32f10x.o + 0x0800028e 0x0800028e 0x00000002 PAD + 0x08000290 0x08000290 0x000000e0 Code RO 260 i.SetSysClockTo72 system_stm32f10x.o + 0x08000370 0x08000370 0x00000060 Code RO 262 i.SystemInit system_stm32f10x.o + 0x080003d0 0x080003d0 0x00000024 Code RO 132 i.TIM1_UP_IRQHandler mytimer.o + 0x080003f4 0x080003f4 0x00000024 Code RO 133 i.TIM2_IRQHandler mytimer.o + 0x08000418 0x08000418 0x00000024 Code RO 134 i.TIM3_IRQHandler mytimer.o + 0x0800043c 0x0800043c 0x00000024 Code RO 135 i.TIM4_IRQHandler mytimer.o + 0x08000460 0x08000460 0x0000000e Code RO 325 i.__scatterload_copy mc_w.l(handlers.o) + 0x0800046e 0x0800046e 0x00000002 Code RO 326 i.__scatterload_null mc_w.l(handlers.o) + 0x08000470 0x08000470 0x0000000e Code RO 327 i.__scatterload_zeroinit mc_w.l(handlers.o) + 0x0800047e 0x0800047e 0x00000002 PAD + 0x08000480 0x08000480 0x0000003c Code RO 213 i.initADC myadc.o + 0x080004bc 0x080004bc 0x0000003c Code RO 5 i.main prinicpal.o + 0x080004f8 0x080004f8 0x00000028 Code RO 214 i.read myadc.o + 0x08000520 0x08000520 0x00000014 Code RO 215 i.startADC myadc.o + 0x08000534 0x08000534 0x00000020 Data RO 323 Region$$Table anon$$obj.o - Execution Region RW_IRAM1 (Exec base: 0x20000000, Load base: 0x080006d0, Size: 0x00000410, Max: 0x00005000, ABSOLUTE) + Execution Region ER_RW (Exec base: 0x20000000, Load base: 0x08000554, Size: 0x00000014, Max: 0xffffffff, ABSOLUTE) Exec Addr Load Addr Size Type Attr Idx E Section Name Object - 0x20000000 0x080006d0 0x00000010 Data RW 124 .data mytimer.o - 0x20000010 - 0x00000400 Zero RW 198 STACK startup_stm32f10x_md.o + 0x20000000 0x08000554 0x00000004 Data RW 6 .data prinicpal.o + 0x20000004 0x08000558 0x00000010 Data RW 136 .data mytimer.o + + + Execution Region ER_ZI (Exec base: 0x20000014, Load base: 0x08000568, Size: 0x00000404, Max: 0xffffffff, ABSOLUTE) + + Exec Addr Load Addr Size Type Attr Idx E Section Name Object + + 0x20000014 0x08000568 0x00000004 PAD + 0x20000018 - 0x00000400 Zero RW 249 STACK startup_stm32f10x_md.o ============================================================================== @@ -302,16 +329,16 @@ Image component sizes Code (inc. data) RO Data RW Data ZI Data Debug Object Name - 180 14 0 0 0 1658 driver_gpio.o - 782 54 0 16 0 5979 mytimer.o - 56 0 0 0 0 207723 prinicpal.o - 36 8 236 0 1024 804 startup_stm32f10x_md.o - 328 28 0 0 0 1949 system_stm32f10x.o + 120 20 0 0 0 1284 myadc.o + 438 66 0 16 0 4557 mytimer.o + 80 8 0 4 0 208330 prinicpal.o + 36 8 236 0 1024 808 startup_stm32f10x_md.o + 328 28 0 0 0 1973 system_stm32f10x.o ---------------------------------------------------------------------- - 1386 104 268 16 1024 218113 Object Totals + 1004 130 268 20 1028 216952 Object Totals 0 0 32 0 0 0 (incl. Generated) - 4 0 0 0 0 0 (incl. Padding) + 2 0 0 0 4 0 (incl. Padding) ---------------------------------------------------------------------- @@ -330,8 +357,8 @@ Image component sizes 36 8 0 0 0 68 init.o ---------------------------------------------------------------------- - 90 16 0 0 0 68 Library Totals - 0 0 0 0 0 0 (incl. Padding) + 92 16 0 0 0 68 Library Totals + 2 0 0 0 0 0 (incl. Padding) ---------------------------------------------------------------------- @@ -340,7 +367,7 @@ Image component sizes 90 16 0 0 0 68 mc_w.l ---------------------------------------------------------------------- - 90 16 0 0 0 68 Library Totals + 92 16 0 0 0 68 Library Totals ---------------------------------------------------------------------- @@ -349,15 +376,15 @@ Image component sizes Code (inc. data) RO Data RW Data ZI Data Debug - 1476 120 268 16 1024 217761 Grand Totals - 1476 120 268 16 1024 217761 ELF Image Totals - 1476 120 268 16 0 0 ROM Totals + 1096 146 268 20 1028 216548 Grand Totals + 1096 146 268 20 1028 216548 ELF Image Totals + 1096 146 268 20 0 0 ROM Totals ============================================================================== - Total RO Size (Code + RO Data) 1744 ( 1.70kB) - Total RW Size (RW Data + ZI Data) 1040 ( 1.02kB) - Total ROM Size (Code + RO Data + RW Data) 1760 ( 1.72kB) + Total RO Size (Code + RO Data) 1364 ( 1.33kB) + Total RW Size (RW Data + ZI Data) 1048 ( 1.02kB) + Total ROM Size (Code + RO Data + RW Data) 1384 ( 1.35kB) ============================================================================== diff --git a/Listings/startup_stm32f10x_md.lst b/Listings/startup_stm32f10x_md.lst index 8f160af..7398f8f 100644 --- a/Listings/startup_stm32f10x_md.lst +++ b/Listings/startup_stm32f10x_md.lst @@ -465,12 +465,12 @@ ARM Macro Assembler Page 8 00000000 Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M3 --apcs=interw ork --depend=.\objects\startup_stm32f10x_md.d -o.\objects\startup_stm32f10x_md. -o -I.\RTE\Device\STM32F103RB -I.\RTE\_R_el -IC:\Programdata\Keil\Arm\Packs\ARM\ -CMSIS\5.7.0\CMSIS\Core\Include -IC:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_D -FP\2.3.0\Device\Include --predefine="__EVAL SETA 1" --predefine="__MICROLIB SET -A 1" --predefine="__UVISION_VERSION SETA 534" --predefine="_RTE_ SETA 1" --pred -efine="STM32F10X_MD SETA 1" --predefine="_RTE_ SETA 1" --list=.\listings\startu -p_stm32f10x_md.lst RTE\Device\STM32F103RB\startup_stm32f10x_md.s +o -I.\RTE\Device\STM32F103RB -I.\RTE\_SImulation -IC:\Programdata\Keil\Arm\Pack +s\ARM\CMSIS\5.7.0\CMSIS\Core\Include -IC:\Programdata\Keil\Arm\Packs\Keil\STM32 +F1xx_DFP\2.3.0\Device\Include --predefine="__EVAL SETA 1" --predefine="__MICROL +IB SETA 1" --predefine="__UVISION_VERSION SETA 534" --predefine="_RTE_ SETA 1" +--predefine="STM32F10X_MD SETA 1" --predefine="_RTE_ SETA 1" --list=.\listings\ +startup_stm32f10x_md.lst RTE\Device\STM32F103RB\startup_stm32f10x_md.s diff --git a/Objects/Projet1_SImulation.dep b/Objects/Projet1_SImulation.dep index 490a867..1351e48 100644 --- a/Objects/Projet1_SImulation.dep +++ b/Objects/Projet1_SImulation.dep @@ -1,6 +1,6 @@ Dependencies for Project 'Projet1', Target 'SImulation': (DO NOT MODIFY !) CompilerVersion: 5060960::V5.06 update 7 (build 960)::.\ARMCC -F (.\Sources\prinicpal.c)(0x63402527)(-c --cpu Cortex-M3 -D__EVAL -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I .\FileInclude -I.\RTE\Device\STM32F103RB -I.\RTE\_SImulation -IC:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -IC:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include -D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -o .\objects\prinicpal.o --omf_browse .\objects\prinicpal.crf --depend .\objects\prinicpal.d) +F (.\Sources\prinicpal.c)(0x63495DAA)(-c --cpu Cortex-M3 -D__EVAL -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I .\FileInclude -I.\RTE\Device\STM32F103RB -I.\RTE\_SImulation -IC:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -IC:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include -D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -o .\objects\prinicpal.o --omf_browse .\objects\prinicpal.crf --depend .\objects\prinicpal.d) I (C:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h)(0x58258CCC) I (.\RTE\_SImulation\RTE_Components.h)(0x63284DB0) I (C:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm3.h)(0x5E8F2582) @@ -11,6 +11,7 @@ I (C:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_armcc. I (C:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\system_stm32f10x.h)(0x58258CCC) I (.\FileInclude\Driver_GPIO.h)(0x63315001) I (.\FileInclude\MyTimer.h)(0x6340244A) +I (.\FileInclude\MyADC.h)(0x63495643) F (U:\Documents\4ir\S1\Microcontroleur\Drivers\FileInclude\Driver_GPIO.c)(0x633153E6)(-c --cpu Cortex-M3 -D__EVAL -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I .\FileInclude -I.\RTE\Device\STM32F103RB -I.\RTE\_SImulation -IC:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -IC:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include -D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -o .\objects\driver_gpio.o --omf_browse .\objects\driver_gpio.crf --depend .\objects\driver_gpio.d) I (U:\Documents\4ir\S1\Microcontroleur\Drivers\FileInclude\Driver_GPIO.h)(0x63315001) I (C:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h)(0x58258CCC) @@ -33,6 +34,19 @@ I (C:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_armcc. I (C:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\system_stm32f10x.h)(0x58258CCC) I (FileInclude\Driver_GPIO.h)(0x63315001) F (.\FileInclude\MyTimer.h)(0x6340244A)() +F (.\FileInclude\MyADC.c)(0x63495C37)(-c --cpu Cortex-M3 -D__EVAL -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I .\FileInclude -I.\RTE\Device\STM32F103RB -I.\RTE\_SImulation -IC:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -IC:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include -D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -o .\objects\myadc.o --omf_browse .\objects\myadc.crf --depend .\objects\myadc.d) +I (FileInclude\MyADC.h)(0x63495643) +I (C:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h)(0x58258CCC) +I (.\RTE\_SImulation\RTE_Components.h)(0x63284DB0) +I (C:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\core_cm3.h)(0x5E8F2582) +I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5E8E9122) +I (C:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_version.h)(0x5E8F2582) +I (C:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_compiler.h)(0x5E835B22) +I (C:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include\cmsis_armcc.h)(0x5E8F2582) +I (C:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\system_stm32f10x.h)(0x58258CCC) +I (FileInclude\MyTimer.h)(0x6340244A) +I (FileInclude\Driver_GPIO.h)(0x63315001) +F (.\FileInclude\MyADC.h)(0x63495643)() F (RTE\Device\STM32F103RB\RTE_Device.h)(0x59283406)() F (RTE\Device\STM32F103RB\startup_stm32f10x_md.s)(0x58258CCC)(--cpu Cortex-M3 --pd "__EVAL SETA 1" -g --apcs=interwork --pd "__MICROLIB SETA 1" -I.\RTE\Device\STM32F103RB -I.\RTE\_SImulation -IC:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -IC:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include --pd "__UVISION_VERSION SETA 534" --pd "_RTE_ SETA 1" --pd "STM32F10X_MD SETA 1" --pd "_RTE_ SETA 1" --list .\listings\startup_stm32f10x_md.lst --xref -o .\objects\startup_stm32f10x_md.o --depend .\objects\startup_stm32f10x_md.d) F (RTE\Device\STM32F103RB\system_stm32f10x.c)(0x58258CCC)(-c --cpu Cortex-M3 -D__EVAL -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I .\FileInclude -I.\RTE\Device\STM32F103RB -I.\RTE\_SImulation -IC:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include -IC:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include -D__UVISION_VERSION="534" -D_RTE_ -DSTM32F10X_MD -D_RTE_ -o .\objects\system_stm32f10x.o --omf_browse .\objects\system_stm32f10x.crf --depend .\objects\system_stm32f10x.d) diff --git a/Objects/Projet1_Simulation.axf b/Objects/Projet1_Simulation.axf index dd1dede..7c66e8e 100644 Binary files a/Objects/Projet1_Simulation.axf and b/Objects/Projet1_Simulation.axf differ diff --git a/Objects/Projet1_Simulation.build_log.htm b/Objects/Projet1_Simulation.build_log.htm index e667486..01e1e99 100644 --- a/Objects/Projet1_Simulation.build_log.htm +++ b/Objects/Projet1_Simulation.build_log.htm @@ -17,23 +17,24 @@ Library Manager: ArmAr.exe V5.06 update 7 (build 960) Hex Converter: FromElf.exe V5.06 update 7 (build 960) CPU DLL: SARMCM3.DLL V5.34.0.0 Dialog DLL: DARMSTM.DLL V1.68.0.0 -Target DLL: STLink\ST-LINKIII-KEIL_SWO.dll V3.0.8.0 +Target DLL: UL2CM3.DLL V1.163.9.0 Dialog DLL: TARMSTM.DLL V1.66.0.0

Project:

-U:\Documents\4ir\S1\Microcontroleur\Timer\Projet1.uvprojx -Project File Date: 10/02/2022 +U:\Documents\4ir\S1\Microcontroleur\TP_Voilier\Projet1.uvprojx +Project File Date: 10/14/2022

Output:

*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' -Rebuild target 'Réel' +Rebuild target 'SImulation' assembling startup_stm32f10x_md.s... compiling Driver_GPIO.c... -compiling prinicpal.c... -compiling MyTimer.c... compiling system_stm32f10x.c... +compiling MyTimer.c... +compiling prinicpal.c... +compiling MyADC.c... linking... -Program Size: Code=1476 RO-data=268 RW-data=16 ZI-data=1024 +Program Size: Code=1096 RO-data=268 RW-data=20 ZI-data=1028 ".\Objects\Projet1_Simulation.axf" - 0 Error(s), 0 Warning(s).

Software Packages used:

@@ -52,7 +53,7 @@ Package Vendor: Keil

Collection of Component include folders:

.\RTE\Device\STM32F103RB - .\RTE\_R_el + .\RTE\_SImulation C:\Programdata\Keil\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include C:\Programdata\Keil\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include @@ -61,11 +62,11 @@ Package Vendor: Keil * Component: ARM::CMSIS:CORE:5.4.0 * Component: Keil::Device:Startup:1.0.0 - Include file: RTE_Driver\Config\RTE_Device.h Source file: Device\Source\ARM\STM32F1xx_OPT.s - Source file: Device\Source\ARM\startup_stm32f10x_md.s Source file: Device\Source\system_stm32f10x.c -Build Time Elapsed: 00:00:01 + Include file: RTE_Driver\Config\RTE_Device.h + Source file: Device\Source\ARM\startup_stm32f10x_md.s +Build Time Elapsed: 00:00:02 diff --git a/Objects/Projet1_Simulation.htm b/Objects/Projet1_Simulation.htm index 46d6a0b..29be12b 100644 --- a/Objects/Projet1_Simulation.htm +++ b/Objects/Projet1_Simulation.htm @@ -3,11 +3,11 @@ Static Call Graph - [.\Objects\Projet1_Simulation.axf]

Static Call Graph for image .\Objects\Projet1_Simulation.axf


-

#<CALLGRAPH># ARM Linker, 5060960: Last Updated: Fri Oct 07 15:10:37 2022 +

#<CALLGRAPH># ARM Linker, 5060960: Last Updated: Fri Oct 14 15:01:44 2022

-

Maximum Stack Usage = 52 bytes + Unknown(Cycles, Untraceable Function Pointers)

+

Maximum Stack Usage = 28 bytes + Unknown(Cycles, Untraceable Function Pointers)

Call chain for Maximum Stack Depth:

-main ⇒ MyTimer_PWM ⇒ MyGPIO_Init +SystemInit ⇒ SetSysClock ⇒ SetSysClockTo72

Mutually Recursive functions @@ -30,6 +30,7 @@ Function Pointers
  • BusFault_Handler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET)
  • CAN1_RX1_IRQHandler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET)
  • CAN1_SCE_IRQHandler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET) +
  • Callback from prinicpal.o(i.Callback) referenced from prinicpal.o(i.main)
  • DMA1_Channel1_IRQHandler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET)
  • DMA1_Channel2_IRQHandler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET)
  • DMA1_Channel3_IRQHandler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET) @@ -58,7 +59,7 @@ Function Pointers
  • RCC_IRQHandler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET)
  • RTCAlarm_IRQHandler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET)
  • RTC_IRQHandler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET) -
  • Reset_Handler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET) +
  • Reset_Handler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET)
  • SPI1_IRQHandler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET)
  • SPI2_IRQHandler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET)
  • SVC_Handler from startup_stm32f10x_md.o(.text) referenced from startup_stm32f10x_md.o(RESET) @@ -90,31 +91,30 @@ Global Symbols

    __main (Thumb, 0 bytes, Stack size unknown bytes, entry.o(.ARM.Collect$$$$00000000))
    [Address Reference Count : 1]

    -

    _main_stk (Thumb, 0 bytes, Stack size unknown bytes, entry2.o(.ARM.Collect$$$$00000001)) +

    _main_stk (Thumb, 0 bytes, Stack size unknown bytes, entry2.o(.ARM.Collect$$$$00000001)) -

    _main_scatterload (Thumb, 0 bytes, Stack size unknown bytes, entry5.o(.ARM.Collect$$$$00000004)) -

    [Calls]