Preheat the oven to 350°F (175°C). Grease and flour a 9-inch cake pan.
In a bowl, whisk together flour, baking powder, baking soda, and salt.
In another bowl, cream butter and sugar together until fluffy.
Beat in eggs and vanilla extract.
Gradually add the dry ingredients to the butter mixture, alternating with buttermilk, until smooth.
Gently fold in the raspberries.
Pour batter into the prepared pan.
Mix sugar and optional chopped pecans, then sprinkle over the batter.
Bake for 40 minutes or until a toothpick inserted in the center comes out clean.