AnsweredAssumed Answered

HardFault with cmsis Ethernet library

Question asked by mohamadi.parisa on Oct 11, 2016
Latest reply on Oct 11, 2016 by mohamadi.parisa
I send and receive data from Ethernet with cmsis library

I send my data with send function each 100ms(with each timer interrupt)

void send(void){
    unsigned char i;
    unsigned long int checksum;
    char msg[200];
        sendbuf = tcp_get_buf (i);
        memcpy (sendbuf, msg, i);
        tcp_send (socket, sendbuf,i);   
        memset(msg, '\0', sizeof(msg));                   

and receive data with call back function

uint32_t tcp_callback (int32_t soc, tcpEvent event, const uint8_t *buf, uint32_t len){
  switch (event) {
    case tcpEventConnect:return (1);
    case tcpEventAbort:tcp_close(socket);break;
    case tcpEventEstablished:break;
    case tcpEventClosed:break;
    case tcpEventACK:break;
    case tcpEventData:
        memset(&pcstr[0], '\0', sizeof(pcstr));
        memcpy (pcstr,buf, len);
  return (0);

and here is my main settings

int main (void)
    socket = tcp_get_socket (TCP_TYPE_SERVER | TCP_TYPE_KEEP_ALIVE, 0, 10,tcp_callback);
    tcp_listen (socket, 5000);
        while (1)

my code works fine and send and receive data and unfortunately it hangs after for several seconds.As I debug my MCU I see that  net_initialize() make it hangs(but I call it only once).
and it shows me the error line
and here is my fault report

why my bus makes fault? and what is my mistake?