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.

MSP430FR2355: CCS: MPU Memory Protection Unit config in C application

Part Number: MSP430FR2355

Hello,

I would like to reserve 4kB non-initialized data block in FRAM to store some logged data.

I created in my C program:

#pragma NOINIT (data_log)

uint16_t   data_log[2000];

And added in linker .cmd file: 

.TI.noinit    : {} section in FRAM READ_WRITE_MEMORY group

All works fine according to .map output file - the data is correctly allocated

The next step would be to tune Memory Protection Unit (MPU) and exclude this data block from write protection (PFWPOA = 0x04 offset)

How shall I modify either Project Properties or linker .cmd file to tune MPU offset to be effective before the main() is being executed?

In CCS 10.4.0.00006  I use I can only engage/disengage FRWI and DFWP in Project's Properties

  • There is no memory protection unit on this part. You can of course change PFWPOA by writing to the FRAM control register using the correct magic number/password of course. Your data must be at the start of FRAM for this to work.

  • Dear David,

    Looks like I asked my question not precise enough.

    Meanwhile I have made some experiments with Project Properties settings.

    1. When FRWP is engaged in Project Properties (CCS General -> FRWP tab) CCS handles correct value of PFWPOA automatically.

    The appropriate SYSCFG0 setup code is  located in C boot section (pre-main routines).

    2. When FRWP is disengaged in Project Properties, SYSCFG0 remains unaltered with its default value after cold boot/reset (0x9601).

    If there is a need to prepare own configuration of SYSCFG0 in C boot section, it is possible to implement the code in system_pre_init.c as described in SLAA628 MSP430 FRAM Technology – How To and Best Practices

**Attention** This is a public forum