Page 1 of 2
LwIP demo for Nucleo-144
Posted: Mon Dec 11, 2017 4:05 pm
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 ?
Re: LwIP demo for Nucleo-144
Posted: Mon Dec 11, 2017 4:36 pm
by Giovanni
Hi,
There is an "unified" lwIP demo in trunk, those boards could be added easily but currently are not supported.
Giovanni
Re: LwIP demo for Nucleo-144
Posted: Wed Dec 13, 2017 12:26 pm
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);
}
Re: LwIP demo for Nucleo-144
Posted: Wed Dec 13, 2017 1:11 pm
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
Re: LwIP demo for Nucleo-144
Posted: Wed Dec 13, 2017 3:35 pm
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 ?
Re: LwIP demo for Nucleo-144
Posted: Wed Dec 13, 2017 4:41 pm
by Giovanni
Hi,
The reason is a string, look for what is after that "S".
Moving this topic in "bug reports".
Giovanni
Re: LwIP demo for Nucleo-144
Posted: Wed Dec 13, 2017 4:50 pm
by omcdr
Reason is "SV#8"
Re: LwIP demo for Nucleo-144
Posted: Tue Dec 19, 2017 8:44 pm
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.
Re: LwIP demo for Nucleo-144
Posted: Tue Dec 19, 2017 9:18 pm
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
Re: LwIP demo for Nucleo-144
Posted: Tue Dec 19, 2017 9:32 pm
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?