由于64位地址导致ARM Cortex M3硬故障

时间:2019-06-04 15:07:38

标签: c

运行C库函数“ localtime()”时,我的ARM Cortex M3 micro产生了硬故障错误。单步执行localtime函数显示64位地址正在各处使用。直到这行代码“ str r1,[r3,r2]”使用相对的64位地址时,这才引起任何问题。将GCC编译器设置为Thumb模式。编译器/链接器是否应该识别Thumb模式,并为此模式编译/链接代码?我该怎么办才能解决此问题?

单步执行localtime()函数以查找地址错误的来源。

str r1,[r3,r2]

=========================================== 制作文件

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

-include ../makefile.init

RM := rm -rf

# All of the sources participating in the build are defined here
-include sources.mk
-include Source/subdir.mk
-include subdir.mk
-include objects.mk

ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables 

# All Target
all: GPS_Clock3.axf

dependents:
    -cd C:/Users/Greg/SimplicityStudio/v4_workspace/GPS_Clock3/GNU\ ARM\ v4.9.3\ -\ Release && $(MAKE) all

# Tool invocations
GPS_Clock3.axf: $(OBJS) $(USER_OBJS) C:/Users/Greg/SimplicityStudio/v4_workspace/GPS_Clock3/GNU\ ARM\ v4.9.3\ -\ Release/GPS_Clock3.axf
    @echo 'Building target: $@'
    @echo 'Invoking: GNU ARM C Linker'
    arm-none-eabi-gcc -g3 -gdwarf-2 -mcpu=cortex-m3 -mthumb -T "C:/Users/Greg/SimplicityStudio/v4_workspace/GPS_Clock3/GNU ARM v4.9.3 - Debug/GPS_Clock3.ld" -nostartfiles --specs=nosys.specs -Xlinker --gc-sections -Xlinker -Map="GPS_Clock3.map" --specs=nano.specs -o GPS_Clock3.axf "./Source/aeabi_memset-thumb.o" "./Source/crt0.o" "./Source/em_emu.o" "./Source/functions.o" "./Source/interrupts.o" "./Source/main.o" "./Source/startup_efm32jg1b.o" "./Source/test.o" -lm -Wl,--start-group -lgcc -lc -lnosys -Wl,--end-group
    @echo 'Finished building target: $@'
    @echo ' '

    @echo 'Building hex file: GPS_Clock3.hex'
    arm-none-eabi-objcopy -O ihex "GPS_Clock3.axf" "GPS_Clock3.hex"
    @echo ' '

    @echo 'Building bin file: GPS_Clock3.bin'
    arm-none-eabi-objcopy -O binary "GPS_Clock3.axf" "GPS_Clock3.bin"
    @echo ' '

    @echo 'Building s37 file: GPS_Clock3.s37'
    arm-none-eabi-objcopy -O srec "GPS_Clock3.axf" "GPS_Clock3.s37"
    @echo ' '

    @echo 'Running size tool'
    arm-none-eabi-size "GPS_Clock3.axf"
    @echo ' '

# Other Targets
clean:
    -$(RM) $(EXECUTABLES)$(OBJS)$(C_DEPS) GPS_Clock3.axf
    -@echo ' '

.PHONY: all clean dependents
.SECONDARY:
C:/Users/Greg/SimplicityStudio/v4_workspace/GPS_Clock3/GNU\ ARM\ v4.9.3\ -\ Release/GPS_Clock3.axf:

-include ../makefile.targets

0 个答案:

没有答案