CH32V003勾選Link-time optimizer后可以初始化,但是跑不了程序了,該如何解決?

CH32V003勾選Link-time optimizer后可以初始化,但是跑不了程序了,該如何解決?



1716459987451.jpg

您好,開啟LTO選項之后,為了減少代碼,編譯器會在鏈接階段對整個程序而不是單獨文件來優(yōu)化,包含提取內(nèi)聯(lián)消除冗余等等,可能會在執(zhí)行時間和順序上與原來有區(qū)別,導(dǎo)致在您的硬件上運行不正常。代碼尺寸沒有絕對要求的話可以不用開啟此選項。


感覺差不多

Building?target:?ch32v003.elf
Invoking:?GNU?RISC-V?Cross?C?Linker
riscv-none-embed-gcc?-msmall-data-limit=0?-msave-restore?-march=rv32ec?-mabi=ilp32e?-O1?-fmessage-length=0?-fsigned-char?-ffunction-sections?-fdata-sections?-flto?-T?"/home/alanfans/Desktop/elink/STM32/eclipse-workspaces/ch32v003/startup/Link.ld"?-nostartfiles?-Xlinker?--gc-sections?-Wl,-Map,"ch32v003.map"?--specs=nano.specs?--specs=nosys.specs?-o?"ch32v003.elf"?./system/src/Peripheral/ch32v00x_adc.o?./system/src/Peripheral/ch32v00x_dbgmcu.o?./system/src/Peripheral/ch32v00x_dma.o?./system/src/Peripheral/ch32v00x_exti.o?./system/src/Peripheral/ch32v00x_flash.o?./system/src/Peripheral/ch32v00x_gpio.o?./system/src/Peripheral/ch32v00x_i2c.o?./system/src/Peripheral/ch32v00x_iwdg.o?./system/src/Peripheral/ch32v00x_misc.o?./system/src/Peripheral/ch32v00x_opa.o?./system/src/Peripheral/ch32v00x_pwr.o?./system/src/Peripheral/ch32v00x_rcc.o?./system/src/Peripheral/ch32v00x_spi.o?./system/src/Peripheral/ch32v00x_tim.o?./system/src/Peripheral/ch32v00x_usart.o?./system/src/Peripheral/ch32v00x_wwdg.o??./system/src/Core/core_riscv.o??./startup/startup_ch32v00x.o??./src/ch32v00x_it.o?./src/debug.o?./src/ds18b20.o?./src/main.o?./src/system_ch32v00x.o???
Finished?building?target:?ch32v003.elf
?
Invoking:?GNU?RISC-V?Cross?Create?Flash?Image
riscv-none-embed-objcopy?-O?ihex?"ch32v003.elf"??"ch32v003.hex"
Invoking:?GNU?RISC-V?Cross?Print?Size
riscv-none-embed-size?--format=berkeley?"ch32v003.elf"
???text	???data	????bss	????dec	????hex	filename
???7444	????168	????536	???8148	???1fd4	ch32v003.elf
Finished?building:?ch32v003.siz
Finished?building:?ch32v003.hex

image.png



我用的gcc+eclipse


只有登錄才能回復(fù),可以選擇微信賬號登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频