chMBPost is hanging STM32F429iDiscovery

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
0st3n
Posts: 11
Joined: Tue Aug 25, 2015 11:11 am

chMBPost is hanging STM32F429iDiscovery

Post 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 ?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: chMBPost is hanging STM32F429iDiscovery

Post 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
0st3n
Posts: 11
Joined: Tue Aug 25, 2015 11:11 am

Re: chMBPost is hanging STM32F429iDiscovery

Post 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 ?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: chMBPost is hanging STM32F429iDiscovery

Post by Giovanni »

Look at the RT-STM32F407-OLIMEX_E407-LWIP-FATFS-USB demo.

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

Giovanni
0st3n
Posts: 11
Joined: Tue Aug 25, 2015 11:11 am

Re: chMBPost is hanging STM32F429iDiscovery

Post 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 ?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: chMBPost is hanging STM32F429iDiscovery

Post 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
Post Reply