Skip to content

Commit

Permalink
Fix for SOS(HardFault Exception) while using local cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
satishgn committed Aug 11, 2014
1 parent 2ff3f38 commit 5e18860
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/spark_utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@ void Multicast_Presence_Announcement(void)
addr.sa_data[4] = 0x01;
addr.sa_data[5] = 0xbb; // IP LSB

for (int i = 3; i > 0; i--)
//why loop here? Uncommenting this leads to SOS(HardFault Exception) on local cloud
//for (int i = 3; i > 0; i--)
{
sendto(multicast_socket, announcement, 19, 0, &addr, sizeof(sockaddr));
}
Expand Down

2 comments on commit 5e18860

@kennethlimcp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@satishgn, i would like to dive deeper and find the issue with this. I see that we have this function (Multicast_Presence_Announcement) available. What's the difference between this and calling the sendto()?

Opps. I didn't realized it's called in the Multicast_Presence_Announcement. Will test further!

@kennethlimcp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@satishgn, seems like a delayMicroseconds(50) after calling `sendto() will not lead to a hard fault. At least that's what i found out when testing this....

I'm thinking that the sendto() is being called too rapidly which causes some overflow of the socket buffer? Might need to explore checking the return value or something before the next call instead of have a simple for loop

Please sign in to comment.