-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce ROM size of USB_EPStartXfer #52
Comments
Thank you for this report. From my side, using EWARM 9.20.4 IDE, I found the following values:
I will forward your request to our development teams. I will let you know once I have their feedback. With regards, |
By the way, may I know the optimization level you have used to obtain the figures you shared? Thank you, |
@ALABSTM Thank you for taking l a look on it. |
I understand from the link you provided that you have used a "high size" optimization level. Could you please provide me with the compiler used and its version too? Thank you, |
@ALABSTM Thank you for asking more information. I'll try to ptovide as much as possible: Here are the compile commands:
"directory": "<build_dir_here>",
"command": "$HOME/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DCORE_CM4 -DHSE_VALUE=8000000 -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DSTM32G431xx -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I$HOME/Documents/dev/cannectivity/app/build/zephyr/include/generated/zephyr -I$HOME/Documents/dev/zephyrproject/zephyr/include -I$HOME/Documents/dev/cannectivity/app/build/zephyr/include/generated -I$HOME/Documents/dev/zephyrproject/zephyr/soc/st/stm32 -I$HOME/Documents/dev/zephyrproject/zephyr/soc/st/stm32/common/. -I$HOME/Documents/dev/zephyrproject/zephyr/drivers -I$HOME/Documents/dev/zephyrproject/zephyr/soc/st/stm32/stm32g4x/. -I$HOME/Documents/dev/zephyrproject/zephyr/subsys/usb/device -I$HOME/Documents/dev/zephyrproject/custom/cannectivity/include -I$HOME/Documents/dev/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -I$HOME/Documents/dev/zephyrproject/zephyr/modules/cmsis/. -I$HOME/Documents/dev/zephyrproject/modules/hal/stm32/stm32cube/stm32g4xx/soc -I$HOME/Documents/dev/zephyrproject/modules/hal/stm32/stm32cube/stm32g4xx/drivers/include -I$HOME/Documents/dev/zephyrproject/modules/hal/stm32/stm32cube/common_ll/include -I$HOME/Documents/dev/zephyrproject/modules/debug/segger/SEGGER -I$HOME/Documents/dev/zephyrproject/modules/debug/segger/Config -isystem $HOME/Documents/dev/zephyrproject/zephyr/lib/libc/common/include -fno-strict-aliasing -Os -flto=auto -imacros $HOME/Documents/dev/cannectivity/app/build/zephyr/include/generated/zephyr/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=$HOME/zephyr-sdk-0.17.0/arm-zephyr-eabi/arm-zephyr-eabi -imacros $HOME/Documents/dev/zephyrproject/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=$HOME/Documents/dev/cannectivity/app=CMAKE_SOURCE_DIR -fmacro-prefix-map=$HOME/Documents/dev/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=$HOME/Documents/dev/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c99 -o modules/hal_stm32/stm32cube/CMakeFiles/..__modules__hal__stm32__stm32cube.dir/stm32g4xx/drivers/src/stm32g4xx_ll_usb.c.obj -c $HOME/Documents/dev/zephyrproject/modules/hal/stm32/stm32cube/stm32g4xx/drivers/src/stm32g4xx_ll_usb.c",
"file": "$HOME/Documents/dev/zephyrproject/modules/hal/stm32/stm32cube/stm32g4xx/drivers/src/stm32g4xx_ll_usb.c",
"output": "modules/hal_stm32/stm32cube/CMakeFiles/..__modules__hal__stm32__stm32cube.dir/stm32g4xx/drivers/src/stm32g4xx_ll_usb.c.obj" Here I get (988 bytes):
"directory": "<build_directory>",
"command": "$HOME/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DCORE_CM4 -DHSE_VALUE=8000000 -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DSTM32G431xx -DUSE_FULL_LL_DRIVER -DUSE_HAL_DRIVER -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I$HOME/Documents/dev/cannectivity/app/build/zephyr/include/generated/zephyr -I$HOME/Documents/dev/zephyrproject/zephyr/include -I$HOME/Documents/dev/cannectivity/app/build/zephyr/include/generated -I$HOME/Documents/dev/zephyrproject/zephyr/soc/st/stm32 -I$HOME/Documents/dev/zephyrproject/zephyr/soc/st/stm32/common/. -I$HOME/Documents/dev/zephyrproject/zephyr/drivers -I$HOME/Documents/dev/zephyrproject/zephyr/soc/st/stm32/stm32g4x/. -I$HOME/Documents/dev/zephyrproject/zephyr/subsys/usb/device -I$HOME/Documents/dev/zephyrproject/custom/cannectivity/include -I$HOME/Documents/dev/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -I$HOME/Documents/dev/zephyrproject/zephyr/modules/cmsis/. -I$HOME/Documents/dev/zephyrproject/modules/hal/stm32/stm32cube/stm32g4xx/soc -I$HOME/Documents/dev/zephyrproject/modules/hal/stm32/stm32cube/stm32g4xx/drivers/include -I$HOME/Documents/dev/zephyrproject/modules/hal/stm32/stm32cube/common_ll/include -isystem $HOME/Documents/dev/zephyrproject/zephyr/lib/libc/common/include -fno-strict-aliasing -O2 -imacros $HOME/Documents/dev/cannectivity/app/build/zephyr/include/generated/zephyr/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=$HOME/zephyr-sdk-0.17.0/arm-zephyr-eabi/arm-zephyr-eabi -imacros $HOME/Documents/dev/zephyrproject/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=$HOME/Documents/dev/cannectivity/app=CMAKE_SOURCE_DIR -fmacro-prefix-map=$HOME/Documents/dev/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=$HOME/Documents/dev/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=picolibc.specs -std=c99 -o modules/hal_stm32/stm32cube/CMakeFiles/..__modules__hal__stm32__stm32cube.dir/stm32g4xx/drivers/src/stm32g4xx_ll_usb.c.obj -c $HOME/Documents/dev/zephyrproject/modules/hal/stm32/stm32cube/stm32g4xx/drivers/src/stm32g4xx_ll_usb.c",
"file": "$HOME/Documents/dev/zephyrproject/modules/hal/stm32/stm32cube/stm32g4xx/drivers/src/stm32g4xx_ll_usb.c",
"output": "modules/hal_stm32/stm32cube/CMakeFiles/..__modules__hal__stm32__stm32cube.dir/stm32g4xx/drivers/src/stm32g4xx_ll_usb.c.obj" Here I get (988 bytes):
Additionaly you can see I am using I can not get 1440 bytes anymore, but there were also HAL update inbetween, since I am evolving in my project. Thus please consider this post as a reference. The most thing I am wonderign about, that the code section (.text) alone is so huge. Therefore I am here to ask for help in additional savings possible. Most interesting scenario is the usage of stm32 series with pretty low memory on board, which makes them less costly, but more hard to opti,ize for size. |
ST Internal Reference: 199294 |
Your point has been forwarded to our development teams. Let's wait for their feedback and see. With regards, |
I hope you are doing well. According to development teams, the symbol From my side, still using EWARM 9.20.4 IDE, I set
I hope this addresses your needs. Please let me know your feedback. With regards, PS: Best wishes for this new year. |
This issue were observed within zephyr rtos project using stm32g4, USB stack from zephyr rtos and stm32g4 HAL drivers.
Is your feature request related to a problem? Please describe.
USB_EPStartXfer
for stm32g4 has 1440 KiBi text section, which is huge in my opinion.Describe the solution you'd like
The size of
USB_EPStartXfer
shall be reduced or the reason for such text section size shall be mentioned.Describe alternatives you've considered
none
Additional context
To reproduce the behaviour any USB sample for stm32g4 could be taken. Afterwards execute
ninja -C build rom_report > rom_report.log
.In my case I am getting following values:
especially:
The text was updated successfully, but these errors were encountered: