Melt butter in a large frying pan. When it just begins to brown, add the onions and blueberries, cook until translucent. Add the maple syrup, salt and pepper. Bring to a boil then lower heat and let reduce until as little liquid as possible remains (about 45 minutes) without having the onions stick to the pan.