LwIP demo for Nucleo-144

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

omcdr
Posts: 89
Joined: Wed Aug 17, 2016 3:25 pm
Has thanked: 7 times
Been thanked: 7 times

LwIP demo for Nucleo-144

Postby omcdr » Mon Dec 11, 2017 4:05 pm

Will RT-STM32-LWIP-FATFS-USB demo work on Nucleo-144 NUCLEO-F207ZG ?
Whether there is another example for LwIP on this board or for NUCLEO-F429ZI ?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: LwIP demo for Nucleo-144

Postby Giovanni » Mon Dec 11, 2017 4:36 pm

Hi,

There is an "unified" lwIP demo in trunk, those boards could be added easily but currently are not supported.

Giovanni

omcdr
Posts: 89
Joined: Wed Aug 17, 2016 3:25 pm
Has thanked: 7 times
Been thanked: 7 times

Re: LwIP demo for Nucleo-144

Postby omcdr » Wed Dec 13, 2017 12:26 pm

I have run this example on Nucleo-144, DHCP and ping is working correctly.
I have problem with HTTP server example thread, in netconn_new(NETCONN_TCP) I got timeout and WDG reset, other tasks has stop working. WDG has 1s period.
In function sys_arch_sem_wait(&apimsg->msg.conn->op_completed, 0); at line if (chSemWaitTimeoutS(*sem, tmo) != MSG_OK)
Could you explain why ? Is it LwIP misconfiguration ?


Code: Select all

u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout) {
  systime_t tmo, start, remaining;

  osalSysLock();
  tmo = timeout > 0 ? MS2ST((systime_t)timeout) : TIME_INFINITE;
  start = osalOsGetSystemTimeX();
  if (chSemWaitTimeoutS(*sem, tmo) != MSG_OK) {
    osalSysUnlock();
    return SYS_ARCH_TIMEOUT;
  }
  remaining = osalOsGetSystemTimeX() - start;
  osalSysUnlock();
  return (u32_t)ST2MS(remaining);
}

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: LwIP demo for Nucleo-144

Postby Giovanni » Wed Dec 13, 2017 1:11 pm

Hi,

You should check for stack overflow or other possible problems. I don't have enough info to tell why it is timing out.

Giovanni

omcdr
Posts: 89
Joined: Wed Aug 17, 2016 3:25 pm
Has thanked: 7 times
Been thanked: 7 times

Re: LwIP demo for Nucleo-144

Postby omcdr » Wed Dec 13, 2017 3:35 pm

My stack size is 0x8000.
Without debug functions, DHCP, ping works and led blink/WDG tasks correctly.

I have enabled DBG functions. Without LwIP initialization I got chSysHalt with reason S at this call stack

Code: Select all

chSysHalt
_dbg_check_enter_isr
VectorB0
<Exception frame>
_idle_thread
[_port_thread_start + 0x9]


With enalbled LwIP: lwipInit(NULL); I got chSysHalt with reason S at this call stack

Code: Select all

chSysHalt
_dbg_check_lock
chSysLock
chMtxLock
chHeapAllocAligned
chHeapAlloc
sys_sem_new
mem_init
lwip_init
tcpip_init
lwip_thread
[_port_thread_start + 0x9]


Why idle task has chSysHalt ?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: LwIP demo for Nucleo-144

Postby Giovanni » Wed Dec 13, 2017 4:41 pm

Hi,

The reason is a string, look for what is after that "S".

Moving this topic in "bug reports".

Giovanni

omcdr
Posts: 89
Joined: Wed Aug 17, 2016 3:25 pm
Has thanked: 7 times
Been thanked: 7 times

Re: LwIP demo for Nucleo-144

Postby omcdr » Wed Dec 13, 2017 4:50 pm

Reason is "SV#8"

omcdr
Posts: 89
Joined: Wed Aug 17, 2016 3:25 pm
Has thanked: 7 times
Been thanked: 7 times

Re: LwIP demo for Nucleo-144

Postby omcdr » Tue Dec 19, 2017 8:44 pm

For clarification:
In LWIP-FATFS-USB example I got chSysHalt SV#4 or SV#8 only in code compiled with IAR compiler, when http_server task is enabled, without this task ping works. Probably #pragma data_alignment is missing ?
The same code works correctly under GCC 6.3 compiled.
Tested with ChibiOS 17.6 and Nucleo-F429ZI


ps. Do you have plans to release makefile for IAR compiler. There is very nice IAR plugin for Eclipse.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: LwIP demo for Nucleo-144

Postby Giovanni » Tue Dec 19, 2017 9:18 pm

How do you enable the debug options? in chconf.h or project options?

It would be nice to create a rules.ml for IAR but it is not high priority.

Giovanni

omcdr
Posts: 89
Joined: Wed Aug 17, 2016 3:25 pm
Has thanked: 7 times
Been thanked: 7 times

Re: LwIP demo for Nucleo-144

Postby omcdr » Tue Dec 19, 2017 9:32 pm

I enabled it in chconf.h file


Will only two Makefile files be dedicated for IAR? Like in GCC ?

Code: Select all

$(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk
$(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk

Will the others remain unchanged?


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 21 guests