- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello I'm using a XMC45 and an external flash IS25LP128F. My XMC communicate with a PC by modbus.
I would like to recover data from the flash by it.
to test the data transmission, I use strcpy(Holding_Register->strMsg, "OFF - ON");
definition:
typedef struct
{
...
chr8_t strMsg;
chr8_t strMsgtest[10];
...
} Data_Modbus_Holding_Register;
Declaration :
Holding_Register = (Data_Modbus_Holding_Register*)®_holding_buffer;
This solution work correctly, I recover data.
but when I use : strcpy(Holding_Register->strMsg, "OFF - ON"); OR Holding_Register->strMsg = "OFF - ON" OR Holding_Register->strMsg[0] = "OFF - ON" I don't arrived to recover data. Someone can help me ?
Best regards,
Pierre Gachet
Solved! Go to Solution.
- Labels:
-
DAVE™
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Pierre,
strcpy(Holding_Register->strMsg, "OFF - ON"); Could result in overflow, that could be your actual issue.
OR Holding_Register->strMsg = "OFF - ON" and Holding_Register->strMsg[0] = "OFF - ON" are not right way to access the structure variable.
This could resolve your problem.
Best Regards,
Vasanth R S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Pierre,
I did not understand the difference between the working code and non-working code from the explanation. Could you please list them as working code and non-working code in separate section for better understanding?
Best Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Pierre,
strcpy(Holding_Register->strMsg, "OFF - ON"); Could result in overflow, that could be your actual issue.
OR Holding_Register->strMsg = "OFF - ON" and Holding_Register->strMsg[0] = "OFF - ON" are not right way to access the structure variable.
This could resolve your problem.
Best Regards,
Vasanth R S