LwIP demo for Nucleo-144

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

Moderators: RoccoMarco, lbednarz, tfAteba

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

LwIP demo for Nucleo-144

Post by omcdr »

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: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: LwIP demo for Nucleo-144

Post by Giovanni »

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

Post by omcdr »

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: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: LwIP demo for Nucleo-144

Post by Giovanni »

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

Post by omcdr »

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: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: LwIP demo for Nucleo-144

Post by Giovanni »

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

Post by omcdr »

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

Post by omcdr »

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: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: LwIP demo for Nucleo-144

Post by Giovanni »

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

Post by omcdr »

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