From 980b9a2d9b8e145df60d2762b81e89cb4bd4b8a7 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Mon, 30 Dec 2024 11:49:48 +0100 Subject: [PATCH] GPIO alternative function registers are 32bit each, not 64bit --- build/final.elf | Bin 55088 -> 55052 bytes build/final.elf.map | 20 ++++----- build/gpio.S | 105 ++++++++++++++++---------------------------- build/gpio.i | 4 +- build/gpio.o | Bin 42320 -> 42280 bytes build/main.i | 4 +- src/gpio.h | 4 +- 7 files changed, 55 insertions(+), 82 deletions(-) diff --git a/build/final.elf b/build/final.elf index 364d3f75554307ee5409e2fa3d5859e17ffd3deb..e33c69c2a2e56e6c04b23ef014809fd17b1bf246 100755 GIT binary patch delta 543 zcmdn6j=5(Y^8^J(k&TLnMR*yR7#LU?7+Dw?7#KJve-z1OGiqs!!l*VGv| cOg?!{ol#)&$7|{m9+w#yPJ<#HiW#9a05mLcr2qf` delta 583 zcmeBK$Gl-3^8^J(i;aqhMR>)S7#LU?7+Dw?7#KJwe-z1O0}Ktl^{Px1_u5wDhv#ayllT18901EO6MG8WME(|$joElm72o9z`!&y zkF_i@hk;iaB*8Q>m*XGEs1uAJsS*Z8MyBK-1_l9^y$lQtf|KWo$(sr>s53Ayvgwq9 zl|a<9L)8lx@GvrZ3WFHDiVU8@`rHf*d@PK1 z+}zxr!caw%&nZapfm8_aGk}Ca{#&OYCc?lV#0s(>Y!t+H;mv;(;+YwxCda6#GiFR~ zQPF4ouz8D0@1o5v$Jg*Os!slRMVXaTfq}t$vgB1|#*oRjSJhens4y_(OkQ|Jcyi5E z0mh8Uy;s$lI1(psyQ;>xd-C0@>Wul5S+A)xZkeomO`Y+@g)w)LC;bGccS683F(Zt$1hv diff --git a/build/final.elf.map b/build/final.elf.map index 006e196..57b4ee1 100644 --- a/build/final.elf.map +++ b/build/final.elf.map @@ -261,17 +261,17 @@ LOAD build/timer.o OUTPUT(build/final.elf elf32-littlearm) LOAD linker stubs -.debug_info 0x00000000 0xb25 - .debug_info 0x00000000 0x21a build/gpio.o - .debug_info 0x0000021a 0x44e build/main.o - .debug_info 0x00000668 0x188 build/startup.o - .debug_info 0x000007f0 0x335 build/timer.o +.debug_info 0x00000000 0xb10 + .debug_info 0x00000000 0x205 build/gpio.o + .debug_info 0x00000205 0x44e build/main.o + .debug_info 0x00000653 0x188 build/startup.o + .debug_info 0x000007db 0x335 build/timer.o -.debug_abbrev 0x00000000 0x44b - .debug_abbrev 0x00000000 0x12b build/gpio.o - .debug_abbrev 0x0000012b 0x144 build/main.o - .debug_abbrev 0x0000026f 0x127 build/startup.o - .debug_abbrev 0x00000396 0xb5 build/timer.o +.debug_abbrev 0x00000000 0x439 + .debug_abbrev 0x00000000 0x119 build/gpio.o + .debug_abbrev 0x00000119 0x144 build/main.o + .debug_abbrev 0x0000025d 0x127 build/startup.o + .debug_abbrev 0x00000384 0xb5 build/timer.o .debug_aranges 0x00000000 0xa8 .debug_aranges diff --git a/build/gpio.S b/build/gpio.S index 630dcd5..11ce30e 100644 --- a/build/gpio.S +++ b/build/gpio.S @@ -182,12 +182,12 @@ gpio_write: .file 4 "src/gpio.h" .section .debug_info,"",%progbits .Ldebug_info0: - .4byte 0x216 + .4byte 0x201 .2byte 0x5 .byte 0x1 .byte 0x4 .4byte .Ldebug_abbrev0 - .uleb128 0x9 + .uleb128 0x8 .4byte .LASF894 .byte 0x1d .4byte .LASF895 @@ -240,7 +240,7 @@ gpio_write: .byte 0x8 .byte 0x7 .4byte .LASF872 - .uleb128 0xa + .uleb128 0x9 .byte 0x4 .byte 0x5 .ascii "int\000" @@ -266,7 +266,7 @@ gpio_write: .byte 0x30 .byte 0x14 .4byte 0x59 - .uleb128 0x6 + .uleb128 0xa .4byte 0xa0 .uleb128 0x3 .4byte .LASF877 @@ -276,7 +276,7 @@ gpio_write: .4byte 0x81 .uleb128 0xb .4byte .LASF893 - .byte 0x30 + .byte 0x28 .byte 0x4 .byte 0x7 .byte 0x8 @@ -301,12 +301,12 @@ gpio_write: .byte 0xb .4byte 0xac .byte 0xc - .uleb128 0x7 + .uleb128 0x6 .ascii "IDR\000" .byte 0xc .4byte 0xac .byte 0x10 - .uleb128 0x7 + .uleb128 0x6 .ascii "ODR\000" .byte 0xd .4byte 0xac @@ -324,31 +324,22 @@ gpio_write: .uleb128 0x2 .4byte .LASF884 .byte 0x10 - .4byte 0x149 + .4byte 0xac .byte 0x20 .uleb128 0x2 .4byte .LASF885 .byte 0x11 - .4byte 0x149 - .byte 0x28 + .4byte 0xac + .byte 0x24 .byte 0 .uleb128 0xc - .4byte 0xac - .4byte 0x149 - .uleb128 0xd - .4byte 0x8d - .byte 0x1 - .byte 0 - .uleb128 0x6 - .4byte 0x139 - .uleb128 0xe .byte 0x7 .byte 0x1 .4byte 0x31 .byte 0x4 .byte 0x20 .byte 0xe - .4byte 0x175 + .4byte 0x160 .uleb128 0x4 .4byte .LASF886 .byte 0 @@ -367,8 +358,8 @@ gpio_write: .byte 0x4 .byte 0x25 .byte 0x3 - .4byte 0x14e - .uleb128 0xf + .4byte 0x139 + .uleb128 0xd .4byte .LASF897 .byte 0x1 .byte 0xd @@ -377,7 +368,7 @@ gpio_write: .4byte .LFE1-.LFB1 .uleb128 0x1 .byte 0x9c - .4byte 0x1c1 + .4byte 0x1ac .uleb128 0x5 .ascii "pin\000" .byte 0xd @@ -390,14 +381,14 @@ gpio_write: .ascii "val\000" .byte 0xd .byte 0x23 - .4byte 0x1c1 + .4byte 0x1ac .uleb128 0x2 .byte 0x91 .sleb128 -19 - .uleb128 0x8 + .uleb128 0x7 .4byte .LASF893 .byte 0xe - .4byte 0x1c8 + .4byte 0x1b3 .uleb128 0x2 .byte 0x91 .sleb128 -12 @@ -406,10 +397,10 @@ gpio_write: .byte 0x1 .byte 0x2 .4byte .LASF891 - .uleb128 0x10 + .uleb128 0xe .byte 0x4 .4byte 0xbd - .uleb128 0x11 + .uleb128 0xf .4byte .LASF898 .byte 0x1 .byte 0x6 @@ -426,23 +417,23 @@ gpio_write: .uleb128 0x2 .byte 0x91 .sleb128 -18 - .uleb128 0x12 + .uleb128 0x10 .4byte .LASF892 .byte 0x1 .byte 0x6 .byte 0x2c - .4byte 0x175 + .4byte 0x160 .uleb128 0x2 .byte 0x91 .sleb128 -19 - .uleb128 0x8 + .uleb128 0x7 .4byte .LASF893 .byte 0x7 - .4byte 0x1c8 + .4byte 0x1b3 .uleb128 0x2 .byte 0x91 .sleb128 -12 - .uleb128 0x13 + .uleb128 0x11 .ascii "pn\000" .byte 0x1 .byte 0x8 @@ -528,13 +519,6 @@ gpio_write: .byte 0 .byte 0 .uleb128 0x6 - .uleb128 0x35 - .byte 0 - .uleb128 0x49 - .uleb128 0x13 - .byte 0 - .byte 0 - .uleb128 0x7 .uleb128 0xd .byte 0 .uleb128 0x3 @@ -553,7 +537,7 @@ gpio_write: .uleb128 0xb .byte 0 .byte 0 - .uleb128 0x8 + .uleb128 0x7 .uleb128 0x34 .byte 0 .uleb128 0x3 @@ -572,7 +556,7 @@ gpio_write: .uleb128 0x18 .byte 0 .byte 0 - .uleb128 0x9 + .uleb128 0x8 .uleb128 0x11 .byte 0x1 .uleb128 0x25 @@ -593,7 +577,7 @@ gpio_write: .uleb128 0x17 .byte 0 .byte 0 - .uleb128 0xa + .uleb128 0x9 .uleb128 0x24 .byte 0 .uleb128 0xb @@ -604,6 +588,13 @@ gpio_write: .uleb128 0x8 .byte 0 .byte 0 + .uleb128 0xa + .uleb128 0x35 + .byte 0 + .uleb128 0x49 + .uleb128 0x13 + .byte 0 + .byte 0 .uleb128 0xb .uleb128 0x13 .byte 0x1 @@ -622,24 +613,6 @@ gpio_write: .byte 0 .byte 0 .uleb128 0xc - .uleb128 0x1 - .byte 0x1 - .uleb128 0x49 - .uleb128 0x13 - .uleb128 0x1 - .uleb128 0x13 - .byte 0 - .byte 0 - .uleb128 0xd - .uleb128 0x21 - .byte 0 - .uleb128 0x49 - .uleb128 0x13 - .uleb128 0x2f - .uleb128 0xb - .byte 0 - .byte 0 - .uleb128 0xe .uleb128 0x4 .byte 0x1 .uleb128 0x3e @@ -658,7 +631,7 @@ gpio_write: .uleb128 0x13 .byte 0 .byte 0 - .uleb128 0xf + .uleb128 0xd .uleb128 0x2e .byte 0x1 .uleb128 0x3f @@ -685,7 +658,7 @@ gpio_write: .uleb128 0x13 .byte 0 .byte 0 - .uleb128 0x10 + .uleb128 0xe .uleb128 0xf .byte 0 .uleb128 0xb @@ -694,7 +667,7 @@ gpio_write: .uleb128 0x13 .byte 0 .byte 0 - .uleb128 0x11 + .uleb128 0xf .uleb128 0x2e .byte 0x1 .uleb128 0x3f @@ -719,7 +692,7 @@ gpio_write: .uleb128 0x19 .byte 0 .byte 0 - .uleb128 0x12 + .uleb128 0x10 .uleb128 0x5 .byte 0 .uleb128 0x3 @@ -736,7 +709,7 @@ gpio_write: .uleb128 0x18 .byte 0 .byte 0 - .uleb128 0x13 + .uleb128 0x11 .uleb128 0x34 .byte 0 .uleb128 0x3 diff --git a/build/gpio.i b/build/gpio.i index 5d3f033..e5588a3 100644 --- a/build/gpio.i +++ b/build/gpio.i @@ -1995,8 +1995,8 @@ struct gpio { volatile uint32_t ODR; volatile uint32_t BSRR; volatile uint32_t LCKR; - volatile uint32_t AFRL[2]; - volatile uint32_t AFRH[2]; + volatile uint32_t AFRL; + volatile uint32_t AFRH; }; #define GPIO_BASE_ADDR (0x40020000U) diff --git a/build/gpio.o b/build/gpio.o index 64cd8881277e668c43232d14a82e22bb98918575..6fcc9010e5320fc9e738f8d055f1e154ee32cfa4 100644 GIT binary patch delta 939 zcmca`ifP3urU?p+9UB!h8F?9*7#LU?7+Dw?7#KJvPiM?!@USr2adUHf3L}Jg^%(6XnfV|B z>XMV|Sa{g@_!+plJtya|NQp2o2(W^z2O9ygTyXO~mdO0g5+x-Zi5?(-@G~&@LFo`E z9R;Nmp>!^kE&@O%z~YD20lNaCR^-FgP+WFvw5V zoiELLO@M(x3oQ3xf#77p1?sE}f(#5XU=fFff|C;$sI$fhGBDVHML=eXOy0Oaoo$97 z0|PVTWWV`Jj3JX57pk+)7Ghwq0xK$5EI2uEp*rhTAqIwUun0)onaK+mssi_}?9Ng?~#WU}F6b=Egh3=Ae<6BHJUOm11M!l*EL9gR%bMu{ByB7 zqwi$JCF+cmCwneYXZlb)xoC+RW6I>2OVk+yCLdg)&e$^fC72XksxHwo6XaP?zJOpx H2*m&ZzL(G_ delta 895 zcmZ2+is`~BrU?p+8#XFtGV+QsF)*+)FtRW(FfedVp3a!d$TgXj$xxha0RsaA^8*bA z2Ie5qMg|53Ze}J127}4IOvXIyo-RQQJZl&j7zEfS_b{m$dNMLFC@?kKGcX8(m>LjC z5Rm(U5_GfklC@bn-bSm3lu$1_u5GstgQ_ylf!reLza*9Aso* zU@geZW8jsV!oa}5G%=60EHQ_HR~aP1G%=S0j?Qy8j9 zLzsbqUyspVl9>-8qAn@OD8%Ld_s&&joHF_0Ty@qZ%nS_LlX>SUGoGJpI8UAN%jC#;>WtqfH_lUM z;;EgyYMvUC0PEyS^VFDRYA64ir^c8zS#dr{ndf|U#*WE_^VOMTdM3}Bug3Uy^1=D) zj7uiJoUhKPK3Q;qI^&hemJ8Gwng1j)EPfcez*vvi*vC$tFSZ!gUMvpg({OH7ppV6Pi|bS z&Uj?<%Eju8v6C+@R%a}k{ByB7