Hi again
I had a read through the pitfalls page, but still am a bit confused.
So what I have done is the following, in my own robot.c file, I have done the
following:
static struct udp_pcb *robot_pcb = NULL;
static void
robot_receive( void *arg, struct udp_pcb *pcb, struct pbuf *p,
ip_addr_t *rip, u16_t rport )
{
printf( "We received a packet\n" );
pbuf_free(p)
}
void robot_init (
struct udp_pcb *pcb = udp_new();
if( pcb != NULL )
{
udp_bind( pcb, IP_ADDR_ANY, 50000 );
udp_recv( pcb, robot_receive, NULL );
robot_pcb = pcb;
}
In my main loop where I initialize dhcp_start etc. I add robot_init(); and
that is when I get:
Assertion "dhcp_create_msg: dhcp->p_out == NULL" failed at line 1774 in
src/core/ipv4/dhcp.c
Assertion "dhcp_create_msg: dhcp->msg_out == NULL" failed at line 1775 in
src/core/ipv4/dhcp.c
I havent received a packet yet, so it cant be the callback, it has to be the
init code. What would I need to change on the init code to allow this to work
with lwip OS Mode.
Do I have to add a critical section when initializing? I tried disabling
interrupts but the problem still prints out.
Thanks for all the help, it has been very informative.
________________________________
From: lwip-users <[email protected]> on
behalf of Dirk Ziegelmeier <[email protected]>
Sent: January 23, 2017 7:23 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Assertions when using DHCP when using LWIP 2.0
And read this:
http://www.nongnu.org/lwip/2_0_0/pitfalls.html
lwIP: Common pitfalls -
nongnu.org<http://www.nongnu.org/lwip/2_0_0/pitfalls.html>
www.nongnu.org
The most common source of lwIP problems is to have multiple execution contexts
inside the lwIP code. lwIP can be used in two basic modes: Mainloop mode
("NO_SYS") (no ...
Dirk
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users