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.

CCS/RM41L232: Editing registers results in "Trouble Writing Memory Block at [...] Error -2130"

Part Number: RM41L232
Other Parts Discussed in Thread: CCSTUDIO, HALCOGEN

Tool/software: Code Composer Studio

I have a board with an RM41L232 microcontroller and I'm using HAL CC 4.06 and Code Composer Studio 7.1.0.00016.

I am able to program the chip over JTAG using an XDS110 debug probe. However when I try to write to a register, I get an error

CortexR4: Trouble Writing Memory Block at 0xfff7c108 on Page 0 of Length 0x4: (Error -2130 @ 0xFFF7C108) Unable to access device memory. Verify that the memory address is in valid memory. If error persists, confirm configuration, power-cycle board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 6.0.576.0) 

I am trying to write to the ADCEVTSET register.

The steps I followed to create the project are:

1) create an empty project (while selecting the right microcontroller) in ccstudio

2) open the project in HAL CC and generate the code. I have only enabled some drivers and configured a bunch of pins to use as GIO. I have not changed anything related to flash or RAM.

After reading some forum topics I thought there might be a problem with the Linker command file. Please note I am relatively new to C and I'm not sure what the purpose of this file is. By analyzing the build log I discovered that by default, the project uses the file sys-link.cmd

'Building target: Testing.out'
'Invoking: ARM Linker'
"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/bin/armcl" -mv7R4 --code_state=32 -me -g --diag_warning=225 --diag_wrap=off --display_error_number --verbose_diagnostics --enum_type=packed --abi=eabi -z -m"Testing.map" --heap_size=0x800 --stack_size=0x800 -i"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/lib" -i"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="Testing_linkInfo.xml" --rom_model -o "Testing.out" "./source/adc.obj" "./source/can.obj" "./source/crc.obj" "./source/dabort.obj" "./source/dcc.obj" "./source/eqep.obj" "./source/esm.obj" "./source/gio.obj" "./source/het.obj" "./source/lin.obj" "./source/mibspi.obj" "./source/notification.obj" "./source/pinmux.obj" "./source/rti.obj" "./source/spi.obj" "./source/sys_core.obj" "./source/sys_intvecs.obj" "./source/sys_main.obj" "./source/sys_mpu.obj" "./source/sys_pcr.obj" "./source/sys_phantom.obj" "./source/sys_pmu.obj" "./source/sys_selftest.obj" "./source/sys_startup.obj" "./source/sys_vim.obj" "./source/system.obj" "../source/sys_link.cmd"  -llibc.a 
<Linking>
'Finished building target: Testing.out'
' '

When I opened the project properties, the field for Linker command file was empty. If I choose RM41L232FlashLnk.cmd I get an error while building about some things being already defined. I assume this is because the file sys-link.cmd is still present. So I renamed sys-link.cmd to sys-link.cmd.OLD. This results in a warning during building:

'Building target: Testing.out'
'Invoking: ARM Linker'
"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/bin/armcl" -mv7R4 --code_state=32 -me -g --diag_warning=225 --diag_wrap=off --display_error_number --verbose_diagnostics --enum_type=packed --abi=eabi -z -m"Testing.map" --heap_size=0x800 --stack_size=0x800 -i"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/lib" -i"C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="Testing_linkInfo.xml" --rom_model -o "Testing.out" "./source/adc.obj" "./source/can.obj" "./source/crc.obj" "./source/dabort.obj" "./source/dcc.obj" "./source/eqep.obj" "./source/esm.obj" "./source/gio.obj" "./source/het.obj" "./source/lin.obj" "./source/mibspi.obj" "./source/notification.obj" "./source/pinmux.obj" "./source/rti.obj" "./source/spi.obj" "./source/sys_core.obj" "./source/sys_intvecs.obj" "./source/sys_main.obj" "./source/sys_mpu.obj" "./source/sys_pcr.obj" "./source/sys_phantom.obj" "./source/sys_pmu.obj" "./source/sys_selftest.obj" "./source/sys_startup.obj" "./source/sys_vim.obj" "./source/system.obj" "../RM41L232FlashLnk.cmd"  -llibc.a 
<Linking>
warning #10247-D: creating output section ".sysmem" without a SECTIONS specification
'Finished building target: Testing.out'
' '

A debug session still launches, however the same problems are present.

The two linker command files are different, which surprises me, given that they are both supposed to be used with an RM41L232.

I'm a bit lost. It would be great if someone could shed some light on this issue.