Freertos based application is taking too long to get started
I have a FreeRTOS application which
opens a UDP socket and transmit packets and receive response.I have used socket.c and W5100.c iomedia library files to build this application with WHiznet EThernet shield. Now When i put a task delay between startup and UDP socket transmitting first packet my application works fine, But if i remove this task delay then no packet is received at Server end. However sendto still returns correct length of packet transmitted.Can somebody please suggest some way how i can debug the application.
void vTaskCode( void * pvParameters )
{
/* The parameter value is expected to be 1 as 1 is passed in the
pvParameters value in the call to xTaskCreate() below.*/
configASSERT( ( ( uint32_t ) pvParameters ) == 1 );
vTaskDelay(20000/portTICK_PERIOD_MS); ***// If I remove this delay packet will never reach other machine.***
socket(DHCP_SOCKET, Sn_MR_UDP, DHCP_CLIENT_PORT, 0x00);
**// create the DHCP message here.**
sendto(DHCP_SOCKET, (uint8_t *)pDHCPMSG, RIP_MSG_SIZE, ip, DHCP_SERVER_PORT);
}
freertos nucleo
add a comment |
I have a FreeRTOS application which
opens a UDP socket and transmit packets and receive response.I have used socket.c and W5100.c iomedia library files to build this application with WHiznet EThernet shield. Now When i put a task delay between startup and UDP socket transmitting first packet my application works fine, But if i remove this task delay then no packet is received at Server end. However sendto still returns correct length of packet transmitted.Can somebody please suggest some way how i can debug the application.
void vTaskCode( void * pvParameters )
{
/* The parameter value is expected to be 1 as 1 is passed in the
pvParameters value in the call to xTaskCreate() below.*/
configASSERT( ( ( uint32_t ) pvParameters ) == 1 );
vTaskDelay(20000/portTICK_PERIOD_MS); ***// If I remove this delay packet will never reach other machine.***
socket(DHCP_SOCKET, Sn_MR_UDP, DHCP_CLIENT_PORT, 0x00);
**// create the DHCP message here.**
sendto(DHCP_SOCKET, (uint8_t *)pDHCPMSG, RIP_MSG_SIZE, ip, DHCP_SERVER_PORT);
}
freertos nucleo
add a comment |
I have a FreeRTOS application which
opens a UDP socket and transmit packets and receive response.I have used socket.c and W5100.c iomedia library files to build this application with WHiznet EThernet shield. Now When i put a task delay between startup and UDP socket transmitting first packet my application works fine, But if i remove this task delay then no packet is received at Server end. However sendto still returns correct length of packet transmitted.Can somebody please suggest some way how i can debug the application.
void vTaskCode( void * pvParameters )
{
/* The parameter value is expected to be 1 as 1 is passed in the
pvParameters value in the call to xTaskCreate() below.*/
configASSERT( ( ( uint32_t ) pvParameters ) == 1 );
vTaskDelay(20000/portTICK_PERIOD_MS); ***// If I remove this delay packet will never reach other machine.***
socket(DHCP_SOCKET, Sn_MR_UDP, DHCP_CLIENT_PORT, 0x00);
**// create the DHCP message here.**
sendto(DHCP_SOCKET, (uint8_t *)pDHCPMSG, RIP_MSG_SIZE, ip, DHCP_SERVER_PORT);
}
freertos nucleo
I have a FreeRTOS application which
opens a UDP socket and transmit packets and receive response.I have used socket.c and W5100.c iomedia library files to build this application with WHiznet EThernet shield. Now When i put a task delay between startup and UDP socket transmitting first packet my application works fine, But if i remove this task delay then no packet is received at Server end. However sendto still returns correct length of packet transmitted.Can somebody please suggest some way how i can debug the application.
void vTaskCode( void * pvParameters )
{
/* The parameter value is expected to be 1 as 1 is passed in the
pvParameters value in the call to xTaskCreate() below.*/
configASSERT( ( ( uint32_t ) pvParameters ) == 1 );
vTaskDelay(20000/portTICK_PERIOD_MS); ***// If I remove this delay packet will never reach other machine.***
socket(DHCP_SOCKET, Sn_MR_UDP, DHCP_CLIENT_PORT, 0x00);
**// create the DHCP message here.**
sendto(DHCP_SOCKET, (uint8_t *)pDHCPMSG, RIP_MSG_SIZE, ip, DHCP_SERVER_PORT);
}
freertos nucleo
freertos nucleo
edited Nov 29 '18 at 4:52
proudengineer
asked Nov 26 '18 at 3:55
proudengineerproudengineer
589
589
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I think first of all you need 2 different tasks for transmiting and receiving.
Sometimes delay is neccessary for tasks synchronzation.
Could you share a part of code?
Well The problem is not with rx side as once 1st packet is successfully transmitted , than flow works fine and i can send any number of packets after this. But I have to introduce a 20 seconds delay after application init and before transmitting else my socket won't transmit packet eventhough sendto doesn't returns error.
– proudengineer
Nov 29 '18 at 4:48
Added the code snippet.
– proudengineer
Nov 29 '18 at 4:52
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53474593%2ffreertos-based-application-is-taking-too-long-to-get-started%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think first of all you need 2 different tasks for transmiting and receiving.
Sometimes delay is neccessary for tasks synchronzation.
Could you share a part of code?
Well The problem is not with rx side as once 1st packet is successfully transmitted , than flow works fine and i can send any number of packets after this. But I have to introduce a 20 seconds delay after application init and before transmitting else my socket won't transmit packet eventhough sendto doesn't returns error.
– proudengineer
Nov 29 '18 at 4:48
Added the code snippet.
– proudengineer
Nov 29 '18 at 4:52
add a comment |
I think first of all you need 2 different tasks for transmiting and receiving.
Sometimes delay is neccessary for tasks synchronzation.
Could you share a part of code?
Well The problem is not with rx side as once 1st packet is successfully transmitted , than flow works fine and i can send any number of packets after this. But I have to introduce a 20 seconds delay after application init and before transmitting else my socket won't transmit packet eventhough sendto doesn't returns error.
– proudengineer
Nov 29 '18 at 4:48
Added the code snippet.
– proudengineer
Nov 29 '18 at 4:52
add a comment |
I think first of all you need 2 different tasks for transmiting and receiving.
Sometimes delay is neccessary for tasks synchronzation.
Could you share a part of code?
I think first of all you need 2 different tasks for transmiting and receiving.
Sometimes delay is neccessary for tasks synchronzation.
Could you share a part of code?
answered Nov 27 '18 at 15:43
SG92SG92
416
416
Well The problem is not with rx side as once 1st packet is successfully transmitted , than flow works fine and i can send any number of packets after this. But I have to introduce a 20 seconds delay after application init and before transmitting else my socket won't transmit packet eventhough sendto doesn't returns error.
– proudengineer
Nov 29 '18 at 4:48
Added the code snippet.
– proudengineer
Nov 29 '18 at 4:52
add a comment |
Well The problem is not with rx side as once 1st packet is successfully transmitted , than flow works fine and i can send any number of packets after this. But I have to introduce a 20 seconds delay after application init and before transmitting else my socket won't transmit packet eventhough sendto doesn't returns error.
– proudengineer
Nov 29 '18 at 4:48
Added the code snippet.
– proudengineer
Nov 29 '18 at 4:52
Well The problem is not with rx side as once 1st packet is successfully transmitted , than flow works fine and i can send any number of packets after this. But I have to introduce a 20 seconds delay after application init and before transmitting else my socket won't transmit packet eventhough sendto doesn't returns error.
– proudengineer
Nov 29 '18 at 4:48
Well The problem is not with rx side as once 1st packet is successfully transmitted , than flow works fine and i can send any number of packets after this. But I have to introduce a 20 seconds delay after application init and before transmitting else my socket won't transmit packet eventhough sendto doesn't returns error.
– proudengineer
Nov 29 '18 at 4:48
Added the code snippet.
– proudengineer
Nov 29 '18 at 4:52
Added the code snippet.
– proudengineer
Nov 29 '18 at 4:52
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53474593%2ffreertos-based-application-is-taking-too-long-to-get-started%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown