Page 1 of 1

chMBPost is hanging STM32F429iDiscovery

Posted: Tue Aug 25, 2015 11:18 am
by 0st3n
I have connected my discovery to an external phy (LAN8720). I have removed everything else which was connected to the pins (LCD, MEMS, usb OTG).

I now having some troubles with the LWIP stack. When i try to make a new netconn_new(NETCONN_TCP) object, it hangs in some of the lwip bindings for chibios.

Code: Select all

void sys_mbox_post(sys_mbox_t *mbox, void *msg) {
  chMBPost(*mbox, (msg_t)msg, TIME_INFINITE);
}


i have called the tcpip_init(NULL,NULL); function before i trying to create the new netconn.

Anyone who have any ideas of what could be wrong ?

Re: chMBPost is hanging STM32F429iDiscovery

Posted: Tue Aug 25, 2015 1:29 pm
by Giovanni
Hi,

What ChibiOS version are you using? this is likely an initialization order issue, the mailbox is used before it is initialized.

In 3.0.1 there is a new initialization method that should avoid that issue.

Giovanni

Re: chMBPost is hanging STM32F429iDiscovery

Posted: Tue Aug 25, 2015 1:59 pm
by 0st3n
Giovanni wrote:Hi,

What ChibiOS version are you using? this is likely an initialization order issue, the mailbox is used before it is initialized.

In 3.0.1 there is a new initialization method that should avoid that issue.

Giovanni


It's the version 3.0.1. Witch init function should i use for having the LWIP stack / bindings to create the right mailbox init ?

Re: chMBPost is hanging STM32F429iDiscovery

Posted: Tue Aug 25, 2015 2:38 pm
by Giovanni
Look at the RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB demo.

There is a single lwipInit(NULL); function to call.

Giovanni

Re: chMBPost is hanging STM32F429iDiscovery

Posted: Wed Aug 26, 2015 1:21 pm
by 0st3n
Thanks, now i got the network working, and able to send udp broadcast.

I have copied the lwipopts.h from the demo project you referred to.
But even after i called the

Code: Select all

lwipInit(NULL);

then i'm not able to ping the board. It doesn't seem to answer on the ARP requests. Do you know what could be wrong now ? or should there bee some different setup in the lwipopts.h file for the STM32F429 ?

Re: chMBPost is hanging STM32F429iDiscovery

Posted: Wed Aug 26, 2015 1:45 pm
by Giovanni
Not sure, I am able to ping that demo.

I am not a huge lwIP expert/user anyway :) I am more involved with RTOS-lwIP integration.

Giovanni