Roast the karamani in a dry pan until it is bright red and aromatic (about 10 mins). Now wash the karamani well and soak it in enough water for about 2 hrs.
Cook the soaked karamani in a pressure cooker until it is very soft and it crushes in between your fingers easily. I would highly recommend using a pressure cooker for this, since it takes a long time for karamani to cook.
Once the karamani comes out of the cooker, drain it in a colander and also mush it up a little using a masher or a flat spoon.
In the mean time, add the jaggery and about ¼ cup of water in a heavy bottom pan. Melt the jaggery and let it boil vigorously until it comes to a soft ball stage. To test for the soft ball consistency, add a drop of syrup into a plate with some water in it. Now gather the drop and try to form a ball in between your thumb and finger. The ball should be very soft. If the ball is very hard, then you have reached the hard ball consistency. In that case add a tablespoon of 2 of water into the syrup and mix well and try again. If you are unable to gather the drop, then let the syrup cook for few more seconds and test again.
At this stage, add the cooked and mashed karamani to the syrup and mix well. You will notice that the syrup liquefies once the karamani is added.
Now add the grated coconut and mix well. Let the sundal cook in low flame for few minutes until it thickens up. Now add the ghee if using and the cardamom powder and mix well again.
Remove from flame and let it cool down a bit before serving. Try to remove the sundal from flame when it still has some moisture in it, since it will harden upon cooling.