ALTracer commented on PR #8976:
URL: https://github.com/apache/nuttx/pull/8976#issuecomment-1501200852

   This does not compile. I "cherry-picked" (copy-pasted) your change for stm32 
chip family (not h7, not f7), had both `CONFIG_DEBUG_FEATURES` and 
`CONFIG_STM32_USBDEV_REGDEBUG` options enabled, and ran a build.
   ```
   altracer@glacier ~/g/a/incubator-nuttx (minif4-periph)> env LANG=C 
/usr/bin/time -v make CROSSDEV=arm-none-eabi- -j4
   CC:  chip/stm32_otgfsdev.c chip/stm32_otgfsdev.c: In function 
'stm32_epin_request':
   chip/stm32_otgfsdev.c:1386:18: error: void value not ignored as it ought to 
be
    1386 |           regval = stm32_putreg(regval, 
STM32_OTGFS_DIEPTXF(privep->epphy));
         |                  ^
   make[1]: *** [Makefile:157: stm32_otgfsdev.o] Error 1
   make: *** [tools/LibTargets.mk:164: arch/arm/src/libarch.a] Error 2
   ```
   Sorry to nag on an already merged PR, but HOW did you test it? Release 
stm32h7 build with `CONFIG_DEBUG_FEATURES` but without 
`CONFIG_STM32H7_USBDEV_REGDEBUG`? Because yes, without 
`CONFIG_STM32_USBDEV_REGDEBUG`, which was non-existent, this code actually 
compiles to something for me.
   ```asm
             regval = stm32_putreg(regval, STM32_OTGFS_DIEPTXF(privep->epphy));
    8001928:    7e23            ldrb    r3, [r4, #24]
             uerr("EP%" PRId8 " TXLEN=%" PRId32 " nwords=%d\n",
    800192a:    4927            ldr     r1, [pc, #156]  ; (80019c8 
<stm32_epin_request+0x160>)
             regval = stm32_putreg(regval, STM32_OTGFS_DIEPTXF(privep->epphy));
    800192c:    009b            lsls    r3, r3, #2
    800192e:    4413            add     r3, r2
             uerr("EP%" PRId8 " TXLEN=%" PRId32 " nwords=%d\n",
    8001930:    2003            movs    r0, #3
             regval = stm32_putreg(regval, STM32_OTGFS_DIEPTXF(privep->epphy));
    8001932:    f8c3 7100       str.w   r7, [r3, #256]  ; 0x100
             regval >>= OTGFS_DIEPTXF_INEPTXFD_SHIFT;
    8001936:    0c3f            lsrs    r7, r7, #16
             uerr("EP%" PRId8 " TXLEN=%" PRId32 " nwords=%d\n",
    8001938:    e9cd 7800       strd    r7, r8, [sp]
    800193c:    4a21            ldr     r2, [pc, #132]  ; (80019c4 
<stm32_epin_request+0x15c>)
    800193e:    7e23            ldrb    r3, [r4, #24]
    8001940:    f005 fec8       bl      80076d4 <syslog>
             DEBUGASSERT(regval >= nwords);
    8001944:    4547            cmp     r7, r8
    8001946:    d2aa            bcs.n   800189e <stm32_epin_request+0x36>
    8001948:    4a20            ldr     r2, [pc, #128]  ; (80019cc 
<stm32_epin_request+0x164>)
    800194a:    4821            ldr     r0, [pc, #132]  ; (80019d0 
<stm32_epin_request+0x168>)
    800194c:    f240 5171       movw    r1, #1393       ; 0x571
    8001950:    f005 f8e4       bl      8006b1c <__assert>
   ```
   Compare with
   ```asm
             regval = stm32_getreg(STM32_OTGFS_DIEPTXF(privep->epphy));
    8001b0a:    7e20            ldrb    r0, [r4, #24]
    8001b0c:    0080            lsls    r0, r0, #2
    8001b0e:    f100 40a0       add.w   r0, r0, #1342177280     ; 0x50000000
    8001b12:    f500 7080       add.w   r0, r0, #256    ; 0x100
    8001b16:    f7ff fab9       bl      800108c <stm32_getreg>
             regval >>= OTGFS_DIEPTXF_INEPTXFD_SHIFT;
    8001b1a:    0c05            lsrs    r5, r0, #16
             uerr("EP%" PRId8 " TXLEN=%" PRId32 " nwords=%d\n",
    8001b1c:    e9cd 5700       strd    r5, r7, [sp]
    8001b20:    4a22            ldr     r2, [pc, #136]  ; (8001bac 
<stm32_epin_request+0x168>)
    8001b22:    7e23            ldrb    r3, [r4, #24]
    8001b24:    4923            ldr     r1, [pc, #140]  ; (8001bb4 
<stm32_epin_request+0x170>)
    8001b26:    2003            movs    r0, #3
    8001b28:    f005 ffa8       bl      8007a7c <syslog>
             DEBUGASSERT(regval >= nwords);
    8001b2c:    42af            cmp     r7, r5
    8001b2e:    d9a7            bls.n   8001a80 <stm32_epin_request+0x3c>
    8001b30:    4a21            ldr     r2, [pc, #132]  ; (8001bb8 
<stm32_epin_request+0x174>)
    8001b32:    4822            ldr     r0, [pc, #136]  ; (8001bbc 
<stm32_epin_request+0x178>)
    8001b34:    f240 5171       movw    r1, #1393       ; 0x571
    8001b38:    f005 f9c4       bl      8006ec4 <__assert>
   ```
   Additionally, see my comments on "emf32".
   
   <details>
   <summary>GCC-12 Gentoo-crossdev config:</summary>
   
   ```
   altracer@glacier ~/g/a/incubator-nuttx (minif4-periph)> env LANG=C 
arm-none-eabi-gcc -v
   Using built-in specs.
   COLLECT_GCC=arm-none-eabi-gcc
   COLLECT_LTO_WRAPPER=/usr/libexec/gcc/arm-none-eabi/12/lto-wrapper
   Target: arm-none-eabi
   Configured with: 
/var/tmp/portage/cross-arm-none-eabi/gcc-12.2.1_p20230121-r1/work/gcc-12-20230121/configure
 --host=x86_64-pc-linux-gnu --target=arm-none-eabi --build=x86_64-pc-linux-gnu 
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/arm-none-eabi/gcc-bin/12 
--includedir=/usr/lib/gcc/arm-none-eabi/12/include 
--datadir=/usr/share/gcc-data/arm-none-eabi/12 
--mandir=/usr/share/gcc-data/arm-none-eabi/12/man 
--infodir=/usr/share/gcc-data/arm-none-eabi/12/info 
--with-gxx-include-dir=/usr/lib/gcc/arm-none-eabi/12/include/g++-v12 
--with-python-dir=/share/gcc-data/arm-none-eabi/12/python 
--enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror 
--with-system-zlib --enable-nls --without-included-gettext 
--disable-libunwind-exceptions --enable-checking=release 
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 
12.2.1_p20230121-r1 p10' --with-gcc-major-version-only --disable-esp 
--enable-libstdcxx-time --disable-libstdcxx-pch --enable-poison-system-director
 ies --disable-libstdcxx-time --with-sysroot=/usr/arm-none-eabi 
--disable-bootstrap --with-newlib --enable-multilib --disable-fixed-point 
--with-multilib-list=aprofile,rmprofile --disable-libgomp --disable-libssp 
--disable-libada --disable-cet --disable-systemtap 
--disable-valgrind-annotations --disable-vtable-verify --disable-libvtv 
--without-zstd --enable-lto --with-isl --disable-isl-version-check 
--disable-libsanitizer --disable-default-pie --disable-default-ssp
   Thread model: single
   Supported LTO compression algorithms: zlib
   gcc version 12.2.1 20230121 (Gentoo 12.2.1_p20230121-r1 p10) 
   ```
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to