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.

MSPM0L1306: Memory map prevented reading 0x2000101C

Part Number: MSPM0L1306

How do I fix this memory map prevented error and get an output my code is below the screenshot.

#include <ti/driverlib/m0p/dl_interrupt.h>
#include "ti_msp_dl_config.h"
int main(void)
{
SYSCFG_DL_init();
volatile char my_rgb[10] = {'R', 'B', '0', 'R', 'G', 'M', 'B','X', '3', 'G'};
volatile int i;
for (i=0; i<10; i++){
if (my_rgb[i]=='R'){ // only red on
DL_GPIO_setPins(GPIO_LEDS_PORT, GPIO_LEDS_R_PIN);
DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_G_PIN);
DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_B_PIN);
}
else if (my_rgb[i]=='G'){ // only green on
DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_R_PIN);
DL_GPIO_setPins(GPIO_LEDS_PORT, GPIO_LEDS_G_PIN);
DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_B_PIN);
}
else if (my_rgb[i]=='B'){ // only blue on
DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_R_PIN);
DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_G_PIN);
DL_GPIO_setPins(GPIO_LEDS_PORT, GPIO_LEDS_B_PIN);
}
else{//all off
DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_R_PIN);
DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_G_PIN);
DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_B_PIN);
}

}
while (1) {}
}

  • Hello Reese,

    The "volatile" make that this variable "i" must be read from the memory indicated by its address. If you want to see the variable "i" in the debug mode, you can delete the "volatile". In most case, as long as the compiler optimization level is not too high, the "i" will not be optimized by the compiler.

    Janz Bai