Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 6.16 KB | None | 0 0
  1.  
  2. main.o:     file format elf32-littlearm
  3.  
  4.  
  5. Disassembly of section .text.startup.main:
  6.  
  7. 00000000 <main>:
  8.   * @brief  Main program
  9.   * @param  None
  10.   * @retval None
  11.   */
  12. int main(void)
  13. {
  14.    0:   b570        push    {r4, r5, r6, lr}
  15.    2:   b094        sub sp, #80 ; 0x50
  16.              duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
  17.              handled in milliseconds basis.
  18.            - Set NVIC Group Priority to 4
  19.            - Low Level Initialization
  20.          */
  21.     HAL_Init();
  22.    4:   f7ff fffe   bl  0 <HAL_Init>
  23.     RCC_ClkInitTypeDef RCC_ClkInitStruct;
  24.     RCC_OscInitTypeDef RCC_OscInitStruct;
  25.     HAL_StatusTypeDef ret = HAL_OK;
  26.  
  27.     /* Enable Power Control clock */
  28.     __HAL_RCC_PWR_CLK_ENABLE();
  29.    8:   4c30        ldr r4, [pc, #192]  ; (cc <main+0xcc>)
  30.    a:   2200        movs    r2, #0
  31.    c:   9200        str r2, [sp, #0]
  32.    e:   6c23        ldr r3, [r4, #64]   ; 0x40
  33.   10:   f043 5380   orr.w   r3, r3, #268435456  ; 0x10000000
  34.   14:   6423        str r3, [r4, #64]   ; 0x40
  35.   16:   6c23        ldr r3, [r4, #64]   ; 0x40
  36.   18:   f003 5380   and.w   r3, r3, #268435456  ; 0x10000000
  37.   1c:   9300        str r3, [sp, #0]
  38.   1e:   9b00        ldr r3, [sp, #0]
  39.  
  40.     /* The voltage scaling allows optimizing the power consumption when the device is
  41.        clocked below the maximum system frequency, to update the voltage scaling value
  42.        regarding system frequency refer to product datasheet.  */
  43.     __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
  44.   20:   4b2b        ldr r3, [pc, #172]  ; (d0 <main+0xd0>)
  45.   22:   9201        str r2, [sp, #4]
  46.   24:   681a        ldr r2, [r3, #0]
  47.   26:   f442 4240   orr.w   r2, r2, #49152  ; 0xc000
  48.   2a:   601a        str r2, [r3, #0]
  49.   2c:   681b        ldr r3, [r3, #0]
  50.   2e:   f403 4340   and.w   r3, r3, #49152  ; 0xc000
  51.   32:   9301        str r3, [sp, #4]
  52.   34:   9b01        ldr r3, [sp, #4]
  53.  
  54.     /* Enable HSE Oscillator and activate PLL with HSE as source */
  55.     RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  56.     RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
  57.   36:   2601        movs    r6, #1
  58.   38:   f44f 23a0   mov.w   r3, #327680 ; 0x50000
  59.     RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  60.     RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  61.   3c:   2502        movs    r5, #2
  62.     RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
  63.   3e:   e9cd 6307   strd    r6, r3, [sp, #28]
  64.     RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  65.   42:   f44f 0380   mov.w   r3, #4194304    ; 0x400000
  66.     RCC_OscInitStruct.PLL.PLLM = 8;
  67.     RCC_OscInitStruct.PLL.PLLN = 360;
  68.   46:   2008        movs    r0, #8
  69.     RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  70.   48:   e9cd 530d   strd    r5, r3, [sp, #52]   ; 0x34
  71.     RCC_OscInitStruct.PLL.PLLN = 360;
  72.   4c:   f44f 73b4   mov.w   r3, #360    ; 0x168
  73.   50:   e9cd 030f   strd    r0, r3, [sp, #60]   ; 0x3c
  74.     RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
  75.     RCC_OscInitStruct.PLL.PLLQ = 7;
  76.   54:   2307        movs    r3, #7
  77.     RCC_OscInitStruct.PLL.PLLR = 2;
  78.  
  79.     ret = HAL_RCC_OscConfig(&RCC_OscInitStruct);
  80.   56:   a807        add r0, sp, #28
  81.     RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
  82.   58:   9511        str r5, [sp, #68]   ; 0x44
  83.     RCC_OscInitStruct.PLL.PLLR = 2;
  84.   5a:   e9cd 3512   strd    r3, r5, [sp, #72]   ; 0x48
  85.     ret = HAL_RCC_OscConfig(&RCC_OscInitStruct);
  86.   5e:   f7ff fffe   bl  0 <HAL_RCC_OscConfig>
  87.     if (ret != HAL_OK)
  88.   62:   b100        cbz r0, 66 <main+0x66>
  89.     {
  90.         while (1) { ; }
  91.   64:   e7fe        b.n 64 <main+0x64>
  92.     }
  93.  
  94.     /* Activate the OverDrive to reach the 180 MHz Frequency */
  95.     ret = HAL_PWREx_EnableOverDrive();
  96.   66:   f7ff fffe   bl  0 <HAL_PWREx_EnableOverDrive>
  97.     if (ret != HAL_OK)
  98.   6a:   b100        cbz r0, 6e <main+0x6e>
  99.     {
  100.         while (1) { ; }
  101.   6c:   e7fe        b.n 6c <main+0x6c>
  102.     }
  103.  
  104.     /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 clocks dividers */
  105.     RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
  106.   6e:   230f        movs    r3, #15
  107.     RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  108.     RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  109.     RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
  110.     RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
  111.   70:   f44f 51a0   mov.w   r1, #5120   ; 0x1400
  112.     RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  113.   74:   e9cd 3502   strd    r3, r5, [sp, #8]
  114.     RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
  115.   78:   f44f 5380   mov.w   r3, #4096   ; 0x1000
  116.     RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  117.   7c:   9004        str r0, [sp, #16]
  118.     RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
  119.   7e:   e9cd 1305   strd    r1, r3, [sp, #20]
  120.  
  121.     ret = HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5);
  122.   82:   a802        add r0, sp, #8
  123.   84:   2105        movs    r1, #5
  124.   86:   f7ff fffe   bl  0 <HAL_RCC_ClockConfig>
  125.     if (ret != HAL_OK)
  126.   8a:   b100        cbz r0, 8e <main+0x8e>
  127.     {
  128.         while (1) { ; }
  129.   8c:   e7fe        b.n 8c <main+0x8c>
  130.     __HAL_RCC_GPIOB_CLK_ENABLE();
  131.   8e:   9007        str r0, [sp, #28]
  132.   90:   6b23        ldr r3, [r4, #48]   ; 0x30
  133.     GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  134.   92:   4910        ldr r1, [pc, #64]   ; (d4 <main+0xd4>)
  135.     HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
  136.   94:   4810        ldr r0, [pc, #64]   ; (d8 <main+0xd8>)
  137.     __HAL_RCC_GPIOB_CLK_ENABLE();
  138.   96:   f043 0302   orr.w   r3, r3, #2
  139.   9a:   6323        str r3, [r4, #48]   ; 0x30
  140.   9c:   6b23        ldr r3, [r4, #48]   ; 0x30
  141.         HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_0);
  142.   9e:   4c0e        ldr r4, [pc, #56]   ; (d8 <main+0xd8>)
  143.     __HAL_RCC_GPIOB_CLK_ENABLE();
  144.   a0:   f003 0302   and.w   r3, r3, #2
  145.   a4:   9307        str r3, [sp, #28]
  146.   a6:   9b07        ldr r3, [sp, #28]
  147.     GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  148.   a8:   2303        movs    r3, #3
  149.   aa:   60cb        str r3, [r1, #12]
  150.     GPIO_InitStruct.Pin = GPIO_PIN_8;
  151.   ac:   f44f 7380   mov.w   r3, #256    ; 0x100
  152.     GPIO_InitStruct.Pull = GPIO_PULLUP;
  153.   b0:   e9c1 6601   strd    r6, r6, [r1, #4]
  154.     GPIO_InitStruct.Pin = GPIO_PIN_8;
  155.   b4:   600b        str r3, [r1, #0]
  156.     HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
  157.   b6:   f7ff fffe   bl  0 <HAL_GPIO_Init>
  158.         HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_0);
  159.   ba:   4620        mov r0, r4
  160.   bc:   2101        movs    r1, #1
  161.   be:   f7ff fffe   bl  0 <HAL_GPIO_TogglePin>
  162.         HAL_Delay(500);
  163.   c2:   f44f 70fa   mov.w   r0, #500    ; 0x1f4
  164.   c6:   f7ff fffe   bl  0 <HAL_Delay>
  165.   ca:   e7f6        b.n ba <main+0xba>
  166.   cc:   40023800    .word   0x40023800
  167.   d0:   40007000    .word   0x40007000
  168.   d4:   00000000    .word   0x00000000
  169.   d8:   40020000    .word   0x40020000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement