This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0C1104: Hard fault during division

Part Number: MSPM0C1104

On my MSPM0C1104 divisions cause hard faults when calling GCC implementations such as __udivsi3. The fault ultimately is triggered by a .word operation in the flash, which I understand to allocate memory at its position.

How is it that write operations are put into the flash when using the GCC ARM library? And more importantly, how can I move them to the RAM?

division_hard_fault_trace.png

    FLASH           (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00003BFF
    SRAM            (RWX) : ORIGIN = 0x20000000, LENGTH = 0x00000400
    DEVICE_CONFIG   (RW!x) : ORIGIN = 0x00003C00, LENGTH = 0x000001FF
    BCR_CONFIG      (R)   : ORIGIN = 0x41C00000, LENGTH = 0x000000FF

Compiler:

"C:/TI/gcc_arm_none_eabi_9_2_1/bin/arm-none-eabi-gcc-9.2.1.exe" 
-c 
@"device.opt" 
-mcpu=cortex-m0plus 
-march=armv6-m 
-mthumb 
-mfloat-abi=soft 
-I"C:/TI/mspm0_sdk_2_09_00_01/source/third_party/CMSIS/Core/Include" 
-I"C:/TI/mspm0_sdk_2_09_00_01/source" 
-I"C:/MYPROJ/src" 
-I"C:/MYPROJ/src/modules" 
-I"C:/MYPROJ/src/modules/comp1" 
-I"C:/MYPROJ/src/modules/communication" 
-I"C:/MYPROJ/src/modules/mylib" 
-I"C:/MYPROJ/src/modules/battery" 
-I"C:/MYPROJ/src/modules/accelerometer" 
-I"C:/MYPROJ" 
-I"C:/MYPROJ/Debug" 
-O2 
-ffunction-sections 
-fdata-sections 
-gdwarf-3 
-gstrict-dwarf 
-Wall 
-fno-math-errno 
-MMD 
-MP 
-MF"src/modules/communication/communication.d_raw" 
-MT"src/modules/communication/communication.o" 
-std=c99 
@"./device.opt" 
-o"src/modules/communication/communication.o" 
"../src/modules/communication/communication.c" 

Linker:

"C:/TI/gcc_arm_none_eabi_9_2_1/bin/arm-none-eabi-gcc-9.2.1.exe" 
@"device.opt" 
-O2
-ffunction-sections 
-fdata-sections 
-gdwarf-3
-gstrict-dwarf 
-Wall
-fno-math-errno 
-mthumb
-mfloat-abi=soft 
-Wl,-Map,"myproj.map" 
-nostartfiles 
-nostdlib
-static 
-Wl,--gc-sections 
-L"C:/TI/mspm0_sdk_2_09_00_01/source/ti/driverlib/lib/gcc/m0p/mspm0c110x" 
-L"C:/TI/mspm0_sdk_2_09_00_01/source" 
-L"C:/MYPROJ" 
-L"C:/MYPROJ/Debug/syscfg" 
-L"C:/TI/gcc_arm_none_eabi_9_2_1/lib/gcc/arm-none-eabi/9.2.1" 
-L"C:/TI/gcc_arm_none_eabi_9_2_1/arm-none-eabi/lib/thumb/v6-m/nofp" 
-march=armv6-m 
-mthumb
--specs=nano.specs 
-o"myproj.out" 
"./ti_msp_dl_config.o" 
"./startup_mspm0c110x_gcc.o" 
"./main.o" 
"./src/modules/accelerometer/accelerometer.o" 
"./src/modules/battery/battery.o" 
"./src/modules/mylib/communication/communication.o" 
"./src/modules/rear_light/comp1.o" 
-Wl,-T"../make/myproj.lds" 
-Wl,-Tdevice.lds.genlibs 
-lm
-lgcc 
-lc 
-l:driverlib.a 

.map file

 .text          0x000004e8      0x114 C:/TI/gcc_arm_none_eabi_9_2_1/lib/gcc/arm-none-eabi/9.2.1\libgcc.a(_udivsi3.o)
                0x000004e8                __aeabi_uidiv
                0x000004e8                __udivsi3

**Attention** This is a public forum