This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Network Component recv() locked when Net4_CM3_L.lib(net_eth.o) compiled to off-chip RAM

Hi guys,

I am facing this problem for a long time and different versions of Keil.

When net_eth.o is in off-chip RW_RAM1 (beginning at 0x60000000) networking does not work properly. (STM32F4xx, Network Component 7.12) Simplified Problem:

Thread 1:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
netInitialize();
osThreadNew(ts_net_thread);
socket();
ioctlsocket(set non-blocking);
connect();
set socket connecting
while(1){
osEventFlagsWait(.....);
if( received ){
PrintData();
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Thread 2 - ts_net_thread:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
while(1){
osEventFlagsWait(any, 1500ms);
if(socket is connecting){
int ret = connect(sckId, .... );
if( ret == BSD_ISCONN)
socket = connected;
}
if(socket is connected){
int ret = recv(scktId, .... );
if( ret < 0)
print("0x%X");
else
osEventFlagsSet(datarecvd)
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When the code is compiled and eth is in RW_IRAM1 recv does not return BSD_ELOCKED but when eth is in RW_RAM1 problem appear and recv() returns BSD_LOCKED.

Earlier I find that there should be a problem with ETH driver and DMA. Does anybody have a hint to this problem?

0