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: memcpy

Part Number: MSP430FR2355


I know this is going to be pretty vague but can someone tell me from experience what would make my board keep resetting when I place the following command into the code?

memset(&RXData, '\0', sizeof(RXData))

I am transmitting and receiving data from an RF link.  I would like to use this line to clear the array char bcz of bad incoming data now and again

  • It depends on what RXData is. If it is just a pointer, sizeof() might return 4.

  • volatile char RXData[BUFFER_SIZE] = { [ 0 ... BUFFER_SIZE-1 ] = 0xFF }, *rxMssg;
    
    buffer is 32

  • My code goes thru an initialization and then transmits a mssg to receiver, receiver gets message and transmits something back to transmitter.  After a 1/2 second I repeat.  The issue I am seeing is after a few rounds of this I am re-initializing the radio registers.  The ONLY place this is done is at the front end of the application code.  My gut says I am stepping on memory somewhere and it's causing this 're-boot'....The odd thing is if I place a breakpoint just after configuration and before the LPM3 while loop I never break other than the 1st time in, yet my logic analyzer is clearing showing radio re-configuration.....

    Any thoughts?

  • The usual idiom is to use

    memset(RXData...

    or memset(&RXData[0]

    It is conceivable that a naked RXData is a pointer to some other area of memory, so &RXData points to some weird place.

  • Possibly  .....RXData is 32 deep char so I guess &RXData would increment size of each element which is 1 byte ie fill 32 bytes with 0.....I will definitely change this however to use the norm as it CERTAINLY would be an issue with lets say integers which are 2 bytes each in which case my memory would write 64 bytes with 0 instead of expected 32.....

    thanks

**Attention** This is a public forum