Week-10 @RTEMS-GSoC-2025
Published on 12 Aug 2025
Overview
This week, I completed the following tasks :
- Developed approach for freeing
pbufs
associated with GRETH GBIT TX mechanism - Made minor changes to TX mechansim as a whole
Work completed this week
- Developed approach for freeing
pbufs
associated with GRETH GBIT TX mechanism- lwIP didn’t seem to have any inbuilt method to free single
pbuf
likem_free()
in BSD networking. - So, I made a custom approach, using
pbuf_free()
from lwIP, which frees apbuf
chain starting from given head. - My approach jumps as much buffer descriptors as much pbufs are needed to contain that packet, and then frees that whole pbuf chain.
- lwIP didn’t seem to have any inbuilt method to free single
- Made minor changes to TX mechansim as a whole :
- Modified IRQs of transmission functions, making them more suitable for the purpose
- The Transmit WRAP flag was set very early, during the buffer descriptor initialization, likewise with reception. I removed that WRAP flag setting from initialization part since it was not needed there.
- Error 1 : Descriptor already enabled
- Added several debug
printf()
statements throughout the code - Faced an issue that whenever
udp
command, which is custom command run to execute the test, is ru in the RTEMS SIS shell, the next descriptor appears to be in use as observed from its control field set to0x800
indicatingTX_EN
flagg of descriptor is set, which means the descriptor is still in use and hence, cannot be used for further transmission. - The code repeatedly tries to access the same descriptor, since previous atte,pt failed to use it, the descriptor pointer isn’t updated.
- Added several debug
- Error 2 :
ILLEGAL_USE_OF_FLOATING_POINT_UNIT
when usingprintf()
- Another issue was that I was getting
ILLEGAL_USE_OF_FLOATING_POINT_UNIT
when usingprintf()
statements, this probably indicated that the thread/context in which theprintf()
statement as well asgreth_send()
ultimately was being executed, was not having floating point support. - Using
iprintf()
which is a version ofprintf()
handling only integer formats helped solve this issue much faster.
- Another issue was that I was getting
- Error 3 : Descriptors not getting used in spite of being freed
- In my code, first, I was setting control field of TX decsriptors to 0 (i.e. disabling them), then setting required flags in RX descriptors
- Apparently, both the types of descriptors were getting assigned the same memory, so it was like the same descriptors are disabled tand then again enabled, since on the simulator they probably held zero value and simulator probably allocates memory starting from zero address.
- For this I started workig on including the TX and RX channel structs under the
greth_netif_state
structure, as told by mentors.
Plans for next week
-
Work on gettig expected results from GRETH lwIP driver transmission mechanism
-
Start with reception mechanism code atleast to some extent