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: pointer assignment warnings and address not assigning

Part Number: MSP430FR2355

Pointers.....UGH!!!!

I have the following in an h file:

Fullscreen
1
2
3
4
5
6
7
char *pMetaData[] = {"DC_", "ST_", "SP_", "SW_"};
typedef struct
{
char *pMeta;
uint16_t *pData;
}toPC;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

In main I have the following:

Fullscreen
1
2
3
4
5
6
7
8
9
10
#pragma PERSISTENT(dc_offset)
#pragma location = 0x1800
uint16_t dc_offset = DC_OFFSET_DAC;
toPC *uartTx;
int main(void)
{
uartTx->pData = &dc_offset;
uartTx->pMeta = &pMetaData;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Two issues:

Fullscreen
1
#515-D a value of type "char *(*)[4]" cannot be assigned to an entity of type "char *"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

First is warning (I have tried a ton of things at this end and seems it only removes the warning if I set in main uartTx->pMeta =  &pMetaData[0][0]).....Why is this in my mind it's simple I need a pointer to point to the 1st array....seems like &pMetaData should work????

Second issue:

If I get rid of the warning and I build the code and look at expressions you can see the assignments are pointing to completely different spaces than the variables I want (see below)....What is a person supposed to do here??  Seems no matter how much I do with pointers they ALWAYS stump me....

4530.Doc1.docx

**Attention** This is a public forum