Sound like you have variable boundary problems most likely the cause of your hard fault problems. Use snprintf (which takes the array length as an argument) in place of sprintf to be safer. Otherwise, you need to be absolutely sure that you never write more to the char array than you have length for (in your case 512 characters.)
1 Like