Part Number: MSPM0G1106
Hello E2E Experts,
Good day.
I’m currently working with the MSPM0G1106 microcontroller using Code Composer Studio as my development environment.
I’d like to ask you a technical question regarding code execution from RAM, and confirm whether my understanding is correct or if I might be missing something.
During my tests, I attempted to copy a binary from Flash to RAM and execute it from there. Here’s what I observed:
- The available RAM is 32KB, while the full binary size is 58KB, so there isn’t enough space to store it entirely.
- When I load a simple function into RAM (e.g., turning on an LED), the system enters Default_Handler(), indicating that an exception has occurred.
- According to the documentation, the MSPM0 triggers an exception if it executes an invalid instruction, accesses a forbidden address, or attempts to run code from a non-executable region.
Since there’s no specific handler for this exception, the system ends up in:
void Default_Handler(void) {
while (1);
}
This leads me to believe that the execution from RAM is failing because the copied code contains instructions that rely on its original location in Flash.
When moved to RAM, those references break, potentially causing jumps to invalid addresses and triggering the exception.
I understand that it’s possible to load functions into RAM for data handling, buffers, or structures, but any instruction that depends on its memory location such as relative jumps,
constant access, or internal calls may fail if executed from a different address than the one it was originally built for.
Additionally, I’ve only been able to compile the project in debug mode, which results in a larger binary.
I’d like to know if there’s a way to compile in release mode using Code Composer Studio, as this could reduce the binary size and potentially allow it to fit in RAM.
Could you please confirm if my interpretation is correct?
Is there a recommended technique for executing functions from RAM on this microcontroller, or a way to avoid these addressing issues?
And how can I configure CCS to build in release mode?
Regards,
TICSC