MEM_TCP_PCB not declared

Post here first, or if you can't find a relevant section!
Post Reply
Patrick
Posts: 22
Joined: Thu Dec 19, 2019 9:50 am
Answers: 2

MEM_TCP_PCB not declared

Post 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?
by Patrick » Sat Oct 17, 2020 8:50 am
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!
Go to full post
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: MEM_TCP_PCB not declared

Post by fpiSTM »

Hi @Patrick

I've tested and have no error.
You used Arduino IDE ?
Patrick
Posts: 22
Joined: Thu Dec 19, 2019 9:50 am
Answers: 2

Re: MEM_TCP_PCB not declared

Post by Patrick »

No, Eclipse + Sloeber.
But where is declared MEM_TCP_PCB in this case?
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: MEM_TCP_PCB not declared

Post by fpiSTM »

I don't know. Did you change lwip options?
Patrick
Posts: 22
Joined: Thu Dec 19, 2019 9:50 am
Answers: 2

Re: MEM_TCP_PCB not declared

Post by Patrick »

No.
Still at work?
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: MEM_TCP_PCB not declared

Post by fpiSTM »

No. Anyway I guess something goes wrong with sloeber.
Patrick
Posts: 22
Joined: Thu Dec 19, 2019 9:50 am
Answers: 2

Re: MEM_TCP_PCB not declared

Post 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!
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: MEM_TCP_PCB not declared

Post 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.
Patrick
Posts: 22
Joined: Thu Dec 19, 2019 9:50 am
Answers: 2

Re: MEM_TCP_PCB not declared

Post by Patrick »

Post Reply

Return to “General discussion”