Page 1 of 1

MEM_TCP_PCB not declared

Posted: Fri Oct 16, 2020 2:37 pm
by Patrick
I try to compile TelnetClient from STM32Duino STM32Ethernet library.
I also added STM32Duino LwIP to the project.
There is an error message: 'MEM_TCP_PCB' not declared.
In lwipopts_defaults.h, included by default, there is a MEMP_NUM_TCP_PCB defined (and other defines with same prefix, MEMP_NUM_TCP).
Libraries are last released version, respectively 1.2.0 and 2.1.2.
Board is STM32F746 Discovery, core is 1.9.0.
Any clue?

Re: MEM_TCP_PCB not declared

Posted: Fri Oct 16, 2020 2:55 pm
by fpiSTM
Hi @Patrick

I've tested and have no error.
You used Arduino IDE ?

Re: MEM_TCP_PCB not declared

Posted: Fri Oct 16, 2020 3:37 pm
by Patrick
No, Eclipse + Sloeber.
But where is declared MEM_TCP_PCB in this case?

Re: MEM_TCP_PCB not declared

Posted: Fri Oct 16, 2020 6:26 pm
by fpiSTM
I don't know. Did you change lwip options?

Re: MEM_TCP_PCB not declared

Posted: Fri Oct 16, 2020 6:46 pm
by Patrick
No.
Still at work?

Re: MEM_TCP_PCB not declared

Posted: Fri Oct 16, 2020 8:03 pm
by fpiSTM
No. Anyway I guess something goes wrong with sloeber.

Re: MEM_TCP_PCB not declared

Posted: Sat Oct 17, 2020 8:50 am
by Patrick
It's definitely a Sloeber problem.

In STM32duino_LwIP/src/lwip/memp.h, LWIP_MEMPOOL macro is defined:

Code: Select all

/** Create the list of all memory pools managed by memp. MEMP_MAX represents a NULL pool at the end */
typedef enum {
#define LWIP_MEMPOOL(name,num,size,desc)  MEMP_##name,
#include "lwip/priv/memp_std.h"
  MEMP_MAX
} memp_t;
This code will define MEMP_TCP_PCB.
I solved it by commenting the pragma added by Sloeber in STM32duino_LwIP/src/lwip/priv/memp_std.h:

Code: Select all

//Added by Sloeber 
//#pragma once
So, Arduino IDE is useless to track this kind of problem. I used VSCode, to do it, then solved it in Sloeber.
@fpiSTM, thank you for your help!

Re: MEM_TCP_PCB not declared

Posted: Sat Oct 17, 2020 1:34 pm
by fpiSTM
welcome, you made all the jobs ;)
I guess you should raised an issue on Sloeber GitHub. Like this you will have Jantje's feedback.

Re: MEM_TCP_PCB not declared

Posted: Mon Oct 19, 2020 7:29 am
by Patrick