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

using interrupt ethernet IRQ

HI,

I want to use interrupt ethernet_IRQ provided by keil. In the routine, memory was allocated, where is it being
freed?

How do I access the received ethernet data? Is the data which is "put in queue" in the FIFO or RAM?

Pls help.

Thanks
vivek

Parents
  • most of your questions can be answered by actually spending some time studying how the code works. about the memory issue: many embedded system don't bother to free memory if it was allocated as part of startup procedure. it is allocated as one large chunk (of many smaller ones) and never released (until power down) because:
    1) it is needed anyway
    2) to prevent memory fragmentation
    3) it is time consuming to allocate and free memory
    4) ...

Reply
  • most of your questions can be answered by actually spending some time studying how the code works. about the memory issue: many embedded system don't bother to free memory if it was allocated as part of startup procedure. it is allocated as one large chunk (of many smaller ones) and never released (until power down) because:
    1) it is needed anyway
    2) to prevent memory fragmentation
    3) it is time consuming to allocate and free memory
    4) ...

Children
  • Thanks Tamir.

    But when i put a break point next to the place where the code allocates memory, i could observe that the pointer was NULL. Also the alloc_mem is called for each frame.

    My question is, Is freeing taken care already or should i free it myself. If alloc_mem calls "realloc" instead, then i think i would have sufficient memory in my heap.

    Thats why i get the feel that i should free it. I couldnt find this in the code documentation.

    How do i access the data after it has been put in the queue in case memory is freed already?

    Thanks for your prompt reply

    -vivek